1 Star 0 Fork 31

fattyhg/exam-zh

forked from xkwxdyy/exam-zh 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
exam-zh-symbols.sty 51.87 KB
一键复制 编辑 原始数据 按行查看 历史
xkwxdyy 提交于 2023-06-22 19:18 . Update version
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
%
% Copyright (c) 2022 Kangwei Xia
% Released under the LaTeX Project Public License v1.3c License.
% Repository: https://gitee.com/xkwxdyy/exam-zh
%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\ProvidesExplPackage {exam-zh-symbols} {2023-06-22} {v0.1.26}
{exam-zh symbols module}
\RequirePackage { tikz }
\keys_define:nn { exam-zh }
{ symbols .meta:nn = { exam-zh / symbols } {#1} }
% 正体的 e 和 i
\NewDocumentCommand \eu { } { \mathrm{ e } }
\NewDocumentCommand \upe { } { \mathrm{ e } }
\NewDocumentCommand \iu { } { \mathrm{ i } }
\NewDocumentCommand \upi { } { \mathrm{ i } }
\NewDocumentCommand \uppi { } { \mathrm{ \pi } }
% 分数 \frac \dfrac
\int_new:N \l__examzh_symbols_frac_numerator_str_int % frac 分子字符数
\int_new:N \l__examzh_symbols_frac_denominator_str_int % frac 分母字符数
\int_new:N \l__examzh_symbols_dfrac_numerator_str_int % frac 分子字符数
\int_new:N \l__examzh_symbols_dfrac_denominator_str_int % frac 分母字符数
\keys_define:nn { exam-zh / symbols }
{
% 是否重定义 \frac
change-frac-style .bool_set:N = \l__examzh_symbols_change_frac_style_bool,
% 是否重定义 \dfrac
change-dfrac-style .bool_set:N = \l__examzh_symbols_change_dfrac_style_bool,
% \frac 分子分母增加的额外距离
frac-add .muskip_set:N = \l__examzh_symbols_frac_add_distance_muskip,
% \dfrac 分子分母增加的额外距离
dfrac-add .muskip_set:N = \l__examzh_symbols_dfrac_add_distance_muskip,
}
\keys_set:nn { exam-zh / symbols }
{
change-frac-style = false,
change-dfrac-style = false,
frac-add = 5mu,
dfrac-add = 5mu,
}
\NewCommandCopy { \examzhfrac } { \frac }
\NewCommandCopy { \examzhdfrac } { \dfrac }
\RenewDocumentCommand { \frac } { m m }
{
\group_begin:
\bool_if:NTF \l__examzh_symbols_change_frac_style_bool
{
% 计算分子分母的字符数
\__examzh_symbols_frac_calc_str_num:nn {#1} {#2}
% 根据字符数选择将额外的距离加在哪
\__examzh_symbols_frac_add_distance:NNNNnn
\examzhfrac
\l__examzh_symbols_frac_numerator_str_int
\l__examzh_symbols_frac_denominator_str_int
\l__examzh_symbols_frac_add_distance_muskip
{#1}{#2}
}
{ \examzhfrac {#1} {#2} }
\group_end:
}
\RenewDocumentCommand { \dfrac } { m m }
{
\group_begin:
\bool_if:NTF \l__examzh_symbols_change_dfrac_style_bool
{
% 计算分子分母的字符数
\__examzh_symbols_frac_calc_str_num:nn {#1} {#2}
% 根据字符数选择将额外的距离加在哪
\__examzh_symbols_frac_add_distance:NNNNnn
\examzhdfrac
\l__examzh_symbols_frac_numerator_str_int
\l__examzh_symbols_frac_denominator_str_int
\l__examzh_symbols_dfrac_add_distance_muskip
{#1}{#2}
}
{ \examzhdfrac {#1} {#2} }
\group_end:
}
\cs_new:Npn \__examzh_symbols_frac_calc_str_num:nn #1#2
{
\int_set:Nn \l__examzh_symbols_frac_numerator_str_int
{ \str_count:n {#1} }
\int_set:Nn \l__examzh_symbols_frac_denominator_str_int
{ \str_count:n {#2} }
}
% \__examzh_symbols_frac_add_distance:NNNNnn
% <\oldfrac><numerator str num><denominator str num><add muskip><numerator><denominator>
\cs_new:Npn \__examzh_symbols_frac_add_distance:NNNNnn #1#2#3#4#5#6
{
\int_compare:nNnTF {#2} = {1}
{
\int_compare:nNnTF {#3} = {1}
{
% 分子字符数=1,分母字符数=1
#1
{
\mskip #4
#5
\mskip #4
} {#6}
}
{
% 分子字符数=1,分母字符数>1
#1 {#5}
{
\mskip #4
#6
\mskip #4
}
}
}
{
\int_compare:nNnTF {#3} = {1}
{
% 分子字符数>1,分母字符数=1
#1
{
\mskip #4
#5
\mskip #4
} {#6}
}
{
% 分子字符数>1,分母字符数>1
#1
{
\mskip #4
#5
\mskip #4
} {#6}
}
}
}
% 向量 vec
\int_new:N \l__examzh_symbols_vec_input_count_int
\AtBeginDocument
{
\RenewDocumentCommand { \vec } { m }
{ \__examzh_symbols_vec:n {#1} }
}
\cs_new:Npn \__examzh_symbols_vec:n #1
{
% 先检测 #1 有多少个字符
\__examzh_symbols_vec_detect_number_of_input_str:n {#1}
% 只有 1 个的:加粗,多于两个的加箭头
\int_compare:nNnTF { \l__examzh_symbols_vec_input_count_int } = {1}
{ \symbfit {#1} }
{ \overrightarrow {#1} }
}
\cs_new:Npn \__examzh_symbols_vec_detect_number_of_input_str:n #1
{
\int_set:Nn \l__examzh_symbols_vec_input_count_int
{ \str_count:n { #1 } }
}
% 平行四边形 \parallelogram
\keys_define:nn { exam-zh / symbols }
{
parallelogram-angle .fp_set:N = \l__examzh_symbols_parallelogram_angle_fp,
parallelogram-x .dim_set:N = \l__examzh_symbols_parallelogram_x_dim,
parallelogram-y .dim_set:N = \l__examzh_symbols_parallelogram_y_dim
}
\cs_new:Npn \__examzh_symbols_parallelogram:
{
\begin{tikzpicture}[baseline]
\draw[line~join = round] (0,0) --++ (\l__examzh_symbols_parallelogram_x_dim,0) --++ (\fp_use:N \l__examzh_symbols_parallelogram_angle_fp \c_colon_str \l__examzh_symbols_parallelogram_y_dim) -- (\fp_use:N \l__examzh_symbols_parallelogram_angle_fp \c_colon_str \l__examzh_symbols_parallelogram_y_dim) -- cycle;
\end{tikzpicture}
}
\AtBeginDocument
{
\RenewDocumentCommand { \parallelogram } { }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
parallelogram-angle = 67,
parallelogram-x = 0.9em,
parallelogram-y = 0.7em
}
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_parallelogram: }
}
\group_end:
}
}
% 平行 \parallel
\bool_new:N \l__examzh_symbols_parallel_slant_bool
\bool_new:N \l__examzh_symbols_nparallel_slant_bool
\keys_define:nn { exam-zh / symbols }
{
parallel-angle .fp_set:N = \l__examzh_symbols_parallel_angle_fp,
parallel-twoline-distance .dim_set:N = \l__examzh_symbols_parallel_twoline_distance_dim,
parallel-length .dim_set:N = \l__examzh_symbols_parallel_length_dim,
parallel-baseline .dim_set:N = \l__examzh_symbols_parallel_baseline_dim,
nparallel-slant-angle .fp_set:N = \l__examzh_symbols_nparallel_slant_angle_fp,
nparallel-slant-length .dim_set:N = \l__examzh_symbols_nparallel_slant_length_dim,
parallel-type .choice:,
parallel-type / slant.code:n =
{ \bool_set_true:N \l__examzh_symbols_parallel_slant_bool },
parallel-type / perpendicular .code:n =
{ \bool_set_false:N \l__examzh_symbols_parallel_slant_bool },
nparallel-type .choice:,
nparallel-type / slant.code:n =
{ \bool_set_true:N \l__examzh_symbols_nparallel_slant_bool },
nparallel-type / perpendicular .code:n =
{ \bool_set_false:N \l__examzh_symbols_nparallel_slant_bool },
}
\keys_set:nn { exam-zh / symbols }
{
parallel-type = slant,
nparallel-type = slant,
}
\cs_new:Npn \__examzh_symbols_parallel:
{
\begin{tikzpicture}[baseline=\l__examzh_symbols_parallel_baseline_dim]
\draw[line~cap = round] (0, 0) --++ (\fp_use:N \l__examzh_symbols_parallel_angle_fp \c_colon_str \l__examzh_symbols_parallel_length_dim)
(\l__examzh_symbols_parallel_twoline_distance_dim, 0) --++ (\fp_use:N \l__examzh_symbols_parallel_angle_fp \c_colon_str \l__examzh_symbols_parallel_length_dim);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nparallel:
{
\begin{tikzpicture}[line~cap = round, baseline=\l__examzh_symbols_parallel_baseline_dim]
\draw
(0, 0) --++ (\fp_use:N \l__examzh_symbols_parallel_angle_fp \c_colon_str \l__examzh_symbols_parallel_length_dim)
(\l__examzh_symbols_parallel_twoline_distance_dim, 0) --++ (\fp_use:N \l__examzh_symbols_parallel_angle_fp \c_colon_str \l__examzh_symbols_parallel_length_dim);
% n 线
\draw
(\l__examzh_symbols_parallel_twoline_distance_dim / 2, 0)++(\fp_use:N \l__examzh_symbols_parallel_angle_fp \c_colon_str \l__examzh_symbols_parallel_length_dim / 2) --++ (\fp_use:N \l__examzh_symbols_nparallel_slant_angle_fp \c_colon_str \l__examzh_symbols_nparallel_slant_length_dim / 2)
(\l__examzh_symbols_parallel_twoline_distance_dim / 2, 0)++(\fp_use:N \l__examzh_symbols_parallel_angle_fp \c_colon_str \l__examzh_symbols_parallel_length_dim / 2) --++ (\fp_eval:n { \l__examzh_symbols_nparallel_slant_angle_fp + 180 } \c_colon_str \l__examzh_symbols_nparallel_slant_length_dim / 2);
\end{tikzpicture}
}
\AtBeginDocument
{
\cs_set_eq:NN \__examzh_symbols_old_parallel: \parallel
\cs_set_eq:NN \__examzh_symbols_old_nparallel: \nparallel
\RenewDocumentCommand { \parallel } { }
{
\group_begin:
\bool_if:NTF \l__examzh_symbols_parallel_slant_bool
{
\keys_set:nn { exam-zh / symbols }
{
parallel-angle = 60,
parallel-twoline-distance = 0.28em,
parallel-length = 0.98em,
parallel-baseline = 0.5pt
}
}
{
% 竖直
\keys_set:nn { exam-zh / symbols }
{
parallel-angle = 90,
parallel-twoline-distance = 0.2em,
parallel-length = 0.93em,
parallel-baseline = 1pt
}
}
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_parallel: }
}
\group_end:
}
\RenewDocumentCommand { \nparallel } { }
{
\group_begin:
\bool_if:NTF \l__examzh_symbols_nparallel_slant_bool
{
\keys_set:nn { exam-zh / symbols }
{
parallel-angle = 60,
parallel-twoline-distance = 0.28em,
parallel-length = 0.98em,
parallel-baseline = 0.5pt,
nparallel-slant-angle = 120,
nparallel-slant-length = 0.65em
}
}
{
\keys_set:nn { exam-zh / symbols }
{
parallel-angle = 90,
parallel-twoline-distance = 0.2em,
parallel-length = 0.93em,
parallel-baseline = 1pt,
nparallel-slant-angle = 50,
nparallel-slant-length = 0.6em
}
% \tikz[baseline = {([yshift = 5pt]current~bounding~box.south)}]{ \node { $\__examzh_symbols_old_nparallel:$ }; }
}
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nparallel: }
}
\group_end:
}
}
% 平行且相等 \paralleleq
\bool_new:N \l__examzh_symbols_paralleleq_slant_bool
\keys_define:nn { exam-zh / symbols }
{
% 上面部分的倾斜角
paralleleq-slant-angle .fp_set:N = \l__examzh_symbols_paralleleq_angle_fp,
% 线长度
paralleleq-upper-line-length .dim_set:N = \l__examzh_symbols_paralleleq_upper_line_length_dim,
paralleleq-lower-line-length .dim_set:N = \l__examzh_symbols_paralleleq_lower_line_length_dim,
% 线间距
paralleleq-upper-twoline-distance .dim_set:N = \l__examzh_symbols_paralleleq_upper_twoline_distance_dim,
paralleleq-lower-twoline-distance .dim_set:N = \l__examzh_symbols_paralleleq_lower_twoline_distance_dim,
% 下面部分的水平偏移量
paralleleq-lower-xshift .dim_set:N = \l__examzh_symbols_paralleleq_lower_xshift_dim,
paralleleq-type .choice:,
paralleleq-type / slant.code:n =
{ \bool_set_true:N \l__examzh_symbols_paralleleq_slant_bool },
paralleleq-type / perpendicular .code:n =
{ \bool_set_false:N \l__examzh_symbols_paralleleq_slant_bool },
}
\keys_set:nn { exam-zh / symbols }
{ paralleleq-type = slant }
\cs_new:Npn \__examzh_symbols_paralleleq:
{
\begin{tikzpicture}[baseline = -1.7pt]
\draw[line~cap = round, name = parallel] (0, 0) --++ (\fp_use:N \l__examzh_symbols_paralleleq_angle_fp \c_colon_str \l__examzh_symbols_paralleleq_upper_line_length_dim)
(\l__examzh_symbols_paralleleq_upper_twoline_distance_dim, 0) --++ (\fp_use:N \l__examzh_symbols_paralleleq_angle_fp \c_colon_str \l__examzh_symbols_paralleleq_upper_line_length_dim);
\draw[anchor = parallel.south]
(\l__examzh_symbols_paralleleq_upper_twoline_distance_dim / 2 + \l__examzh_symbols_paralleleq_lower_xshift_dim,0) --++ (\l__examzh_symbols_paralleleq_lower_line_length_dim / 2,0)
(\l__examzh_symbols_paralleleq_upper_twoline_distance_dim / 2 + \l__examzh_symbols_paralleleq_lower_xshift_dim,0) --++ (-\l__examzh_symbols_paralleleq_lower_line_length_dim / 2,0)
(\l__examzh_symbols_paralleleq_upper_twoline_distance_dim / 2 + \l__examzh_symbols_paralleleq_lower_xshift_dim,-\l__examzh_symbols_paralleleq_lower_twoline_distance_dim) --++ (\l__examzh_symbols_paralleleq_lower_line_length_dim / 2 ,0)
(\l__examzh_symbols_paralleleq_upper_twoline_distance_dim / 2 + \l__examzh_symbols_paralleleq_lower_xshift_dim,-\l__examzh_symbols_paralleleq_lower_twoline_distance_dim) --++ (-\l__examzh_symbols_paralleleq_lower_line_length_dim / 2,0)
;
\end{tikzpicture}
}
\NewDocumentCommand { \paralleleq } { }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
paralleleq-upper-line-length = 0.65em,
paralleleq-lower-line-length = 0.8em,
paralleleq-upper-twoline-distance = 0.2em,
paralleleq-lower-twoline-distance = 0.18em,
}
\bool_if:NTF \l__examzh_symbols_paralleleq_slant_bool
{
% \paralleleq : 倾斜型
\keys_set:nn { exam-zh / symbols }
{
paralleleq-slant-angle = 70,
paralleleq-lower-xshift = 0.04em
}
}
{
% \paralleleq* : 垂直型
\keys_set:nn { exam-zh / symbols }
{
paralleleq-slant-angle = 90,
paralleleq-lower-xshift = 0em
}
}
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_paralleleq: }
}
\group_end:
}
% 子集 \subset 真子集 \subseteqq
\keys_define:nn { exam-zh / symbols }
{
% 半圆的半径
subset-radius .dim_set:N = \l__examzh_symbols_subset_semicircle_radius_dim,
% 半圆右边横线的长度
subset-upper-linewidth .dim_set:N = \l__examzh_symbols_subset_semicircle_line_width_dim,
% 下面线的长度
subset-lower-linewidth .dim_set:N = \l__examzh_symbols_subset_lower_line_width_dim,
% 上面部分和下面部分的距离
subset-upper-lower-distance .dim_set:N = \l__examzh_symbols_subset_upper_lower_distance_dim,
% 下面部分 两条线的距离
subsetneqq-lower-twoline-distance .dim_set:N = \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim,
% 下面斜线的长度
subsetneqq-lower-slant-length .dim_set:N = \l__examzh_symbols_subsetneqq_lower_slant_line_length_dim,
supsetneqq-lower-slant-length .dim_set:N = \l__examzh_symbols_supsetneqq_lower_slant_line_length_dim,
% 真子集下方斜线的倾斜角度
subsetneqq-lower-slant-angle .fp_set:N = \l__examzh_symbols_subsetneqq_lower_slant_line_angle_fp,
supsetneqq-lower-slant-angle .fp_set:N = \l__examzh_symbols_supsetneqq_lower_slant_line_angle_fp,
% nxxx 类的参数
% --角度--
nsubset-n-slant-angle .fp_set:N = \l__examzh_symbols_nsubset_slant_angle_fp,
nsubseteq-n-slant-angle .fp_set:N = \l__examzh_symbols_nsubseteq_slant_angle_fp,
nsubsetneqq-n-slant-angle .fp_set:N = \l__examzh_symbols_nsubsetneqq_slant_angle_fp,
% --长度--
nsubset-n-slant-length .dim_set:N = \l__examzh_symbols_nsubset_slant_length_dim,
nsubseteq-n-slant-length .dim_set:N = \l__examzh_symbols_nsubseteq_slant_length_dim,
nsubsetneqq-n-slant-length .dim_set:N = \l__examzh_symbols_nsubsetneqq_slant_length_dim,
}
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
subsetneqq-lower-twoline-distance = 0.14em,
subsetneqq-lower-slant-length = 0.42em,
supsetneqq-lower-slant-length = 0.4em,
subsetneqq-lower-slant-angle = 55,
supsetneqq-lower-slant-angle = 60,
nsubset-n-slant-angle = 65,
nsubseteq-n-slant-angle = 68,
nsubsetneqq-n-slant-angle = 70,
nsubset-n-slant-length = 1em,
nsubseteq-n-slant-length = 1em,
nsubsetneqq-n-slant-length = 1.2em,
}
\cs_new:Npn \__examzh_symbols_subset:
{
\begin{tikzpicture}[line~cap=round,baseline = {([yshift = -1pt]current~bounding~box.south)}]
% 半圆 + 两条线
\draw[line~cap=round] (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str 270 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsubset:
{
\begin{tikzpicture}[line~cap=round,baseline = {([yshift = -1pt]current~bounding~box.south)}]
% 半圆 + 两条线
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str 270 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0);
% 定位斜线的中心
\coordinate (n-center) at (\l__examzh_symbols_subset_semicircle_line_width_dim / 2 - \l__examzh_symbols_subset_semicircle_radius_dim / 2,0);
% 画斜线
\draw[overlay]
(n-center) --++ (\fp_use:N \l__examzh_symbols_nsubset_slant_angle_fp \c_colon_str \l__examzh_symbols_nsubset_slant_length_dim / 2)
(n-center) --++ (\fp_eval:n { \l__examzh_symbols_nsubset_slant_angle_fp + 180} \c_colon_str \l__examzh_symbols_nsubset_slant_length_dim / 2);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_subseteq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
% 半圆 + 两条线
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str 270 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0);
% 下面的一条线
\draw (-\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (\l__examzh_symbols_subset_lower_line_width_dim, 0);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsubseteq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
% 半圆 + 两条线
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str 270 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0);
% 下面的一条线
\draw (-\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (\l__examzh_symbols_subset_lower_line_width_dim, 0);
% 定位斜线的中心
\coordinate (n-center) at (\l__examzh_symbols_subset_semicircle_line_width_dim / 2 - \l__examzh_symbols_subset_semicircle_radius_dim / 2,0);
% 画斜线
\draw[overlay]
(n-center) --++ (\fp_use:N \l__examzh_symbols_nsubseteq_slant_angle_fp \c_colon_str \l__examzh_symbols_nsubseteq_slant_length_dim / 8 * 3.5)
(n-center) --++ (\fp_eval:n { \l__examzh_symbols_nsubseteq_slant_angle_fp + 180} \c_colon_str \l__examzh_symbols_nsubseteq_slant_length_dim / 8 * 4.5);
\end{tikzpicture}
}
% 真子集
\cs_new:Npn \__examzh_symbols_subsetneqq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
% 半圆 + 两条线
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str 270 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0);
% 下面的两条线
\draw (-\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (\l__examzh_symbols_subset_lower_line_width_dim, 0)
(-\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim) --++ (\l__examzh_symbols_subset_lower_line_width_dim, 0);
% 定位斜线的中心点
\coordinate (lower-center) at
(\l__examzh_symbols_subset_semicircle_line_width_dim / 2 - \l__examzh_symbols_subset_semicircle_radius_dim / 2 , - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim / 2 );
% 画斜线
\draw[overlay]
(lower-center) --++ (\fp_use:N \l__examzh_symbols_subsetneqq_lower_slant_line_angle_fp \c_colon_str \l__examzh_symbols_subsetneqq_lower_slant_line_length_dim / 2)
(lower-center) --++ (\fp_eval:n {\l__examzh_symbols_subsetneqq_lower_slant_line_angle_fp + 180} \c_colon_str \l__examzh_symbols_subsetneqq_lower_slant_line_length_dim / 2);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsubsetneqq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
% 半圆 + 两条线
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str 270 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (\l__examzh_symbols_subset_semicircle_line_width_dim,0);
% 下面的两条线
\draw (-\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (\l__examzh_symbols_subset_lower_line_width_dim, 0)
(-\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim) --++ (\l__examzh_symbols_subset_lower_line_width_dim, 0);
% 定位斜线的中心点
\coordinate (lower-center) at
(\l__examzh_symbols_subset_semicircle_line_width_dim / 2 - \l__examzh_symbols_subset_semicircle_radius_dim / 2 , - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim / 2 );
% 画斜线
\draw[overlay]
(lower-center) --++ (\fp_use:N \l__examzh_symbols_subsetneqq_lower_slant_line_angle_fp \c_colon_str \l__examzh_symbols_subsetneqq_lower_slant_line_length_dim / 2)
(lower-center) --++ (\fp_eval:n {\l__examzh_symbols_subsetneqq_lower_slant_line_angle_fp + 180} \c_colon_str \l__examzh_symbols_subsetneqq_lower_slant_line_length_dim / 2);
% 定位斜线的中心
\coordinate (n-center) at (\l__examzh_symbols_subset_semicircle_line_width_dim / 2 - \l__examzh_symbols_subset_semicircle_radius_dim / 2,0);
% 画斜线
\draw[overlay]
(n-center) --++ (\fp_use:N \l__examzh_symbols_nsubsetneqq_slant_angle_fp \c_colon_str \l__examzh_symbols_nsubsetneqq_slant_length_dim / 8 * 3.2)
(n-center) --++ (\fp_eval:n { \l__examzh_symbols_nsubsetneqq_slant_angle_fp + 180} \c_colon_str \l__examzh_symbols_nsubsetneqq_slant_length_dim / 8 * 4.8);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_supset:
{
\begin{tikzpicture}[line~cap=round,baseline = {([yshift = -1pt]current~bounding~box.south)}]
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str -90 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsupset:
{
\begin{tikzpicture}[line~cap=round,baseline = {([yshift = -1pt]current~bounding~box.south)}]
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str -90 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
% 定位斜线的中心
\coordinate (n-center) at (- \l__examzh_symbols_subset_semicircle_line_width_dim / 2 + \l__examzh_symbols_subset_semicircle_radius_dim / 2,0);
% 画斜线
\draw[overlay]
(n-center) --++ (\fp_use:N \l__examzh_symbols_nsubset_slant_angle_fp \c_colon_str \l__examzh_symbols_nsubset_slant_length_dim / 2)
(n-center) --++ (\fp_eval:n { \l__examzh_symbols_nsubset_slant_angle_fp + 180} \c_colon_str \l__examzh_symbols_nsubset_slant_length_dim / 2);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_supseteq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str -90 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim);
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw (0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw
(\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim - \l__examzh_symbols_subset_semicircle_radius_dim, 0);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsupseteq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str -90 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim)
(0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0)
(0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw
(\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim - \l__examzh_symbols_subset_semicircle_radius_dim, 0);
\coordinate (n-center) at (-\l__examzh_symbols_subset_semicircle_line_width_dim / 2 + \l__examzh_symbols_subset_semicircle_radius_dim / 2,0);
% 画斜线
\draw[overlay]
(n-center) --++ (\fp_use:N \l__examzh_symbols_nsubseteq_slant_angle_fp \c_colon_str \l__examzh_symbols_nsubseteq_slant_length_dim / 8 * 3.5)
(n-center) --++ (\fp_eval:n { \l__examzh_symbols_nsubseteq_slant_angle_fp + 180} \c_colon_str \l__examzh_symbols_nsubseteq_slant_length_dim / 8 * 4.5);
\end{tikzpicture}
}
% 反向真子集
\cs_new:Npn \__examzh_symbols_supsetneqq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str -90 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim);
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw (0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw
(\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim - \l__examzh_symbols_subset_semicircle_radius_dim, 0)
(\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim - \l__examzh_symbols_subset_semicircle_radius_dim, 0);
% 定位斜线的中心点
\coordinate (center) at
(- \l__examzh_symbols_subset_semicircle_line_width_dim / 2 + \l__examzh_symbols_subset_semicircle_radius_dim / 2 , - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim / 2 );
% 画斜线
\draw[overlay]
(center) --++ (\fp_use:N \l__examzh_symbols_supsetneqq_lower_slant_line_angle_fp \c_colon_str \l__examzh_symbols_supsetneqq_lower_slant_line_length_dim / 2)
(center) --++ (\fp_eval:n {\l__examzh_symbols_supsetneqq_lower_slant_line_angle_fp + 180} \c_colon_str \l__examzh_symbols_supsetneqq_lower_slant_line_length_dim / 2);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsupsetneqq:
{
\begin{tikzpicture}[line~cap=round,baseline = (current~bounding~box.south)]
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) arc (90 \c_colon_str -90 \c_colon_str \l__examzh_symbols_subset_semicircle_radius_dim);
\draw (0,\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw (0,-\l__examzh_symbols_subset_semicircle_radius_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim,0);
\draw
(\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim - \l__examzh_symbols_subset_semicircle_radius_dim, 0)
(\l__examzh_symbols_subset_semicircle_radius_dim, - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim) --++ (-\l__examzh_symbols_subset_semicircle_line_width_dim - \l__examzh_symbols_subset_semicircle_radius_dim, 0);
% 定位斜线的中心点
\coordinate (center) at
(- \l__examzh_symbols_subset_semicircle_line_width_dim / 2 + \l__examzh_symbols_subset_semicircle_radius_dim / 2 , - \l__examzh_symbols_subset_semicircle_radius_dim - \l__examzh_symbols_subset_upper_lower_distance_dim - \l__examzh_symbols_subsetneqq_lower_twoline_distance_dim / 2 );
% 画斜线
\draw[overlay]
(center) --++ (\fp_use:N \l__examzh_symbols_supsetneqq_lower_slant_line_angle_fp \c_colon_str \l__examzh_symbols_supsetneqq_lower_slant_line_length_dim / 2)
(center) --++ (\fp_eval:n {\l__examzh_symbols_supsetneqq_lower_slant_line_angle_fp + 180} \c_colon_str \l__examzh_symbols_supsetneqq_lower_slant_line_length_dim / 2);
% 定位斜线的中心
\coordinate (n-center) at (-\l__examzh_symbols_subset_semicircle_line_width_dim / 2 + \l__examzh_symbols_subset_semicircle_radius_dim / 2,0);
% 画斜线
\draw[overlay]
(n-center) --++ (\fp_use:N \l__examzh_symbols_nsubsetneqq_slant_angle_fp \c_colon_str \l__examzh_symbols_nsubsetneqq_slant_length_dim / 8 * 3.2)
(n-center) --++ (\fp_eval:n { \l__examzh_symbols_nsubsetneqq_slant_angle_fp + 180} \c_colon_str \l__examzh_symbols_nsubsetneqq_slant_length_dim / 8 * 4.8);
\end{tikzpicture}
}
\AtBeginDocument
{
\cs_set_eq:NN \__examzh_symbols_old_subset: \subset
\cs_set_eq:NN \__examzh_symbols_old_supset: \supset
\cs_set_eq:NN \__examzh_symbols_old_nsubset: \nsubset
\cs_set_eq:NN \__examzh_symbols_old_nsupset: \nsupset
\cs_set_eq:NN \__examzh_symbols_old_subseteq: \subseteq
\cs_set_eq:NN \__examzh_symbols_old_supseteq: \supseteq
\cs_set_eq:NN \__examzh_symbols_old_nsubseteq: \nsubseteq
\cs_set_eq:NN \__examzh_symbols_old_nsupseteq: \nsupseteq
\cs_set_eq:NN \__examzh_symbols_old_subsetneqq: \subsetneqq
\cs_set_eq:NN \__examzh_symbols_old_supsetneqq: \supsetneqq
% \cs_set_eq:NN \__examzh_symbols_old_nsubsetneqq: \nsubsetneqq
% \cs_set_eq:NN \__examzh_symbols_old_nsupsetneqq: \nsupsetneqq
\RenewDocumentCommand { \subset } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_subset: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_subset: }
}
}
\group_end:
}
\RenewDocumentCommand { \nsubset } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
nsubset-n-slant-angle = 65,
nsubset-n-slant-length = 1em,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_nsubset: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nsubset: }
}
}
\group_end:
}
\RenewDocumentCommand { \subseteq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-upper-lower-distance = 0.12em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
}
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_subseteq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_subseteq: }
}
}
\group_end:
}
\RenewDocumentCommand { \nsubseteq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
nsubseteq-n-slant-angle = 68,
nsubseteq-n-slant-length = 1em,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_nsubseteq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nsubseteq: }
}
}
\group_end:
}
\RenewDocumentCommand { \subsetneqq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
subsetneqq-lower-twoline-distance = 0.14em,
subsetneqq-lower-slant-length = 0.42em,
subsetneqq-lower-slant-angle = 55,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_subsetneqq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_subsetneqq: }
}
}
\group_end:
}
\NewDocumentCommand { \nsubsetneqq } { }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
subsetneqq-lower-twoline-distance = 0.14em,
subsetneqq-lower-slant-length = 0.42em,
subsetneqq-lower-slant-angle = 55,
nsubsetneqq-n-slant-angle = 70,
nsubsetneqq-n-slant-length = 1.2em,
}
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nsubsetneqq: }
}
\group_end:
}
\RenewDocumentCommand { \supset } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_supset: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_supset: }
}
}
\group_end:
}
\RenewDocumentCommand { \nsupset } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
nsubset-n-slant-angle = 65,
nsubset-n-slant-length = 1em,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_nsupset: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nsupset: }
}
}
\group_end:
}
\RenewDocumentCommand { \supseteq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-upper-lower-distance = 0.12em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
}
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_supseteq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_supseteq: }
}
}
\group_end:
}
\RenewDocumentCommand { \nsupseteq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
nsubseteq-n-slant-angle = 68,
nsubseteq-n-slant-length = 1em,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_nsupseteq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nsupseteq: }
}
}
\group_end:
}
\RenewDocumentCommand { \supsetneqq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
subsetneqq-lower-twoline-distance = 0.14em,
supsetneqq-lower-slant-length = 0.4em,
supsetneqq-lower-slant-angle = 60,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_supsetneqq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_supsetneqq: }
}
}
\group_end:
}
\NewDocumentCommand { \nsupsetneqq } { }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
subsetneqq-lower-twoline-distance = 0.14em,
supsetneqq-lower-slant-length = 0.4em,
supsetneqq-lower-slant-angle = 60,
nsubsetneqq-n-slant-angle = 70,
nsubsetneqq-n-slant-length = 1.2em,
}
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_nsupsetneqq: }
}
\group_end:
}
% \RenewDocumentCommand { \subset } { s }
% {
% \group_begin:
% \keys_set:nn { exam-zh / symbols }
% {
% subset-radius = 0.2em,
% subset-upper-linewidth = 0.6em,
% subset-lower-linewidth =
% {
% \l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
% },
% subset-upper-lower-distance = 0.12em,
% subsetneqq-lower-twoline-distance = 0.14em,
% subsetneqq-lower-slant-length = 0.42em,
% supsetneqq-lower-slant-length = 0.4em,
% subsetneqq-lower-slant-angle = 55,
% supsetneqq-lower-slant-angle = 60,
% nsubset-n-slant-angle = 65,
% nsubseteq-n-slant-angle = 68,
% nsubsetneqq-n-slant-angle = 70,
% nsubset-n-slant-length = 1em,
% nsubseteq-n-slant-length = 1em,
% nsubsetneqq-n-slant-length = 1.2em,
% }
% \IfBooleanTF {#1}
% { \__examzh_symbols_old_subset: }
% {
% \mathrel
% {
% \__examzh_symbols_symbol_four_size:n
% { \__examzh_symbols_subset: }
% }
% }
% \group_end:
% }
\RenewDocumentCommand { \subseteq } { s }
{
\group_begin:
\keys_set:nn { exam-zh / symbols }
{
subset-radius = 0.2em,
subset-upper-linewidth = 0.6em,
subset-lower-linewidth =
{
\l__examzh_symbols_subset_semicircle_radius_dim + \l__examzh_symbols_subset_semicircle_line_width_dim
},
subset-upper-lower-distance = 0.12em,
}
\IfBooleanTF {#1}
{ \__examzh_symbols_old_subseteq: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_subseteq: }
}
}
\group_end:
}
}
% 并集 交集 cap cup
% 直线长度
\dim_new:N \l__examzh_symbols_cap_line_length_dim
\dim_new:N \l__examzh_symbols_cup_line_length_dim
% 半径大小
\dim_new:N \l__examzh_symbols_cap_radius_dim
\dim_new:N \l__examzh_symbols_cup_radius_dim
\cs_new:Npn \__examzh_symbols_cap:
{
\begin{tikzpicture}[line~cap=round, line~width = 0.6pt,baseline = {([yshift = 1.2pt]current~bounding~box.south)}]
\draw (\l__examzh_symbols_cap_radius_dim,0) arc (0 \c_colon_str 180 \c_colon_str \l__examzh_symbols_cap_radius_dim);
\draw
(\l__examzh_symbols_cap_radius_dim,0) --++ (0,-\l__examzh_symbols_cap_line_length_dim)
(-\l__examzh_symbols_cap_radius_dim,0) --++ (0,-\l__examzh_symbols_cap_line_length_dim);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_cup:
{
\begin{tikzpicture}[line~cap=round, line~width = 0.6pt,baseline = {([yshift = 1.8pt]current~bounding~box.south)}]
\draw (-\l__examzh_symbols_cup_radius_dim,0) arc (180 \c_colon_str 360 \c_colon_str \l__examzh_symbols_cup_radius_dim);
\draw
(\l__examzh_symbols_cup_radius_dim,0) --++ (0,\l__examzh_symbols_cup_line_length_dim)
(-\l__examzh_symbols_cup_radius_dim,0) --++ (0,\l__examzh_symbols_cup_line_length_dim);
\end{tikzpicture}
}
\AtBeginDocument
{
\cs_set_eq:NN \__examzh_symbols_old_cap: \cap
\cs_set_eq:NN \__examzh_symbols_old_cup: \cup
\RenewDocumentCommand { \cap } { s }
{
\group_begin:
\dim_set:Nn \l__examzh_symbols_cap_line_length_dim { 0.56em }
\dim_set:Nn \l__examzh_symbols_cap_radius_dim { 0.28em }
\IfBooleanTF {#1}
{ \__examzh_symbols_old_cap: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_cap: }
}
}
\group_end:
}
\RenewDocumentCommand { \cup } { s }
{
\group_begin:
\dim_set:Nn \l__examzh_symbols_cup_line_length_dim { 0.53em }
\dim_set:Nn \l__examzh_symbols_cup_radius_dim { 0.28em }
\IfBooleanTF {#1}
{ \__examzh_symbols_old_cup: }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \__examzh_symbols_cup: }
}
}
\group_end:
}
}
% 相似
\cs_new:Npn \__examzh_symbols_sim:
{
\begin{tikzpicture}[line~cap=round, line~width = 0.6pt,baseline = {([yshift = -1pt]current~bounding~box.south)}]
\draw
(-.25em,1.15ex)
.. controls (-.55em,1.15ex) and (-.51em,.23ex) .. (-.275em,.23ex)
.. controls (0,.23ex) and (0,1.15ex) .. (.275em,1.15ex)
.. controls (.51em,1.15ex) and (.55em,.23ex) .. (.25em,.23ex);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_nsim:
{
\begin{tikzpicture}[line~width = 0.6pt,line~cap=round, baseline = {([yshift = 1pt]current~bounding~box.south)}]
\draw
(-.25em,1.15ex)
.. controls (-.55em,1.15ex) and (-.51em,.23ex) .. (-.275em,.23ex)
.. controls (0,.23ex) and (0,1.15ex) .. (.275em,1.15ex)
.. controls (.51em,1.15ex) and (.55em,.23ex) .. (.25em,.23ex);
\draw (-0.15em,-0.2ex) --++ (70 \c_colon_str 0.8em);
\end{tikzpicture}
}
\AtBeginDocument
{
\cs_set_eq:NN \__examzh_symbols_old_sim: \sim
\RenewDocumentCommand { \sim } { s }
{
\IfBooleanTF {#1}
{ \__examzh_symbols_old_sim: }
{
\mathrel { \__examzh_symbols_symbol_four_size:n { \__examzh_symbols_sim: } }
}
}
\RenewDocumentCommand { \nsim } { }
{
\mathrel { \__examzh_symbols_symbol_four_size:n { \__examzh_symbols_nsim: } }
}
}
% 全等
\cs_new:Npn \__examzh_symbols_cong:
{
\begin{tikzpicture}[line~cap=round, baseline]
\draw
(-.2em,1.35ex)
.. controls (-.46em,1.6ex) and (-.54em,.65ex) .. (-.25em,.65ex)
.. controls (-.06em,.65ex) and (.06em,1.35ex) .. (.25em,1.35ex)
.. controls (.54em,1.35ex) and (.46em,.4ex) .. (.2em,.65ex)
(-.46em,.4ex) -- (.46em,.4ex)
(-.46em,0ex) -- (.46em,0ex);
\end{tikzpicture}
}
\cs_new:Npn \__examzh_symbols_ncong:
{
\begin{tikzpicture}[line~cap=round, baseline]
\draw
(-.2em,1.35ex)
.. controls (-.46em,1.6ex) and (-.54em,.65ex) .. (-.25em,.65ex)
.. controls (-.06em,.65ex) and (.06em,1.35ex) .. (.25em,1.35ex)
.. controls (.54em,1.35ex) and (.46em,.4ex) .. (.2em,.65ex)
(-.46em,.4ex) -- (.46em,.4ex)
(-.46em,0ex) -- (.46em,0ex);
\draw (-0.22em,-0.4ex) --++ (66 \c_colon_str 1em);
\end{tikzpicture}
}
\AtBeginDocument
{
\cs_set_eq:NN \__examzh_symbols_old_cong: \backcong
\RenewDocumentCommand { \cong } { s }
{
\IfBooleanTF {#1}
{ \__examzh_symbols_old_cong: }
{
\mathrel { \__examzh_symbols_symbol_four_size:n { \__examzh_symbols_cong: } }
}
}
\RenewDocumentCommand { \ncong } { }
{
\mathrel { \__examzh_symbols_symbol_four_size:n { \__examzh_symbols_ncong: } }
}
}
% 处理符号的不同情况的大小
\cs_set_eq:NN \NewDocumentCommand:Nnn \NewDocumentCommand
\cs_set_eq:NN \RenewDocumentCommand:Nnn \RenewDocumentCommand
\cs_generate_variant:Nn \NewDocumentCommand:Nnn { cnn }
\cs_generate_variant:Nn \RenewDocumentCommand:Nnn { cnn }
\cs_new:Npn \__examzh_symbols_new_command_without_star_or_old_version:n #1
{
\NewDocumentCommand:cnn { #1 } { }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \use:c { __examzh_symbols_ #1 : } }
}
}
}
\cs_new:Npn \__examzh_symbols_new_command_with_star_and_old_version:n #1
{
\RenewDocumentCommand:cnn { #1 } { s }
{
\IfBooleanTF {##1}
{ \use:c { __examzh_symbols_old_ #1 : } }
{
\mathrel
{
\__examzh_symbols_symbol_four_size:n
{ \use:c { __examzh_symbols_ #1 : } }
}
}
}
}
\cs_new:Npn \__examzh_symbols_symbol_four_size:n #1
{
\mathchoice
{
\hbox:n
{
\fontsize{\tf@size}{\tf@size}\selectfont #1
}
}
{
\hbox:n
{
\fontsize{\tf@size}{\tf@size}\selectfont #1
}
}
{
\hbox:n
{
\fontsize{\sf@size}{\sf@size}\selectfont #1
}
}
{
\hbox:n
{
\fontsize{\ssf@size}{\ssf@size}\selectfont #1
}
}
}
\endinput
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TeX/LaTeX
1
https://gitee.com/fattyhg/exam-zh.git
[email protected]:fattyhg/exam-zh.git
fattyhg
exam-zh
exam-zh
main

搜索帮助