Debian Codegraph @

texmf-dist/doc/latex/exam-n/examndefs.sty

raw
1 % Generated file : DO NOT EDIT
2 \@ifundefined{@psfontsfalse}{\newif\if@psfonts \@psfontsfalse}{}
3 \@ifundefined{examn@uprightpifalse}{\newif\ifexamn@uprightpi \examn@uprightpifalse}{}
4 \@ifundefined{examn@mtselect}{\newcount\examn@mtselect \examn@mtselect=0}{}
5 \if@psfonts
6 \ifcase\examn@mtselect
7 % mathptm fonts
8 % This is a very clumsy version, but it appears to be our only option
9 \def\vec#1{\mathchoice{\mbox{\boldmath $\displaystyle #1$}}
10 {\mbox{\boldmath $ #1$}}
11 {\mbox{\boldmath $\scriptstyle #1$}}
12 {\mbox{\boldmath $\scriptscriptstyle #1$}}}
13 \ifexamn@uprightpi
14 \ClassWarning{exam-n}{Can't do uprightpi in [mathptm] -- sorry}
15 \let\italicpi\pi
16 \examn@uprightpifalse
17 \fi
18 \or % mathtime (should this be the same for mathtime as for mtpro2?
19 \let\vec\mathbf
20 \ifexamn@uprightpi
21 \ClassWarning{exam-n}{Can't do uprightpi in [mathtime] -- sorry}
22 \let\italicpi\pi
23 \examn@uprightpifalse
24 \fi
25 \or % mtpro2
26 \let\vec\mathbold
27 % \uppi is predefined in mtpro2
28 \ifexamn@uprightpi
29 \let\italicpi\pi
30 \let\pi\uppi
31 \fi
32 \else
33 % STIX2: the unicode-math package provides a \symbf for bold math symbols,
34 \ifnum\examn@engine<2 % pdflatex
35 \let\vec\mathbf
36 % pdftex (or original tex)
37 % The following should, I think, create an upright pi, but doesn't
38 \def\uppi{\mathrm{\pi}}
39 \let\italicpi\pi %for consistency
40 \let\symup\mathrm %not fully the right thing, but avoid errors below
41 \else % xelatex or lualatex
42 % This is where the dependence on a recent LaTeX enters.
43 \let\vec\symbf
44 \typeout{stix2: upright=\ifexamn@uprightpi true\else false\fi}
45 \AddToHook{begindocument/end}{\gdef\uppi{\symup{𝜋}}}
46 \ifexamn@uprightpi
47 \AddToHook{begindocument/end}{\gdef\italicpi{\symit{𝜋}}\global\let\pi\uppi}
48 \fi
49 \fi
50 \fi
51 \else
52 % CM fonts: \mathbf doesn't work with greek in CM
53 \let\vec\mathbf
54 \ifexamn@uprightpi
55 % upright greek is hard to do portably, so give up
56 % See eg https://tex.stackexchange.com/questions/145926/ for discussion
57 \ClassWarning{exam-n}{Can't do uprightpi in [cmfonts] -- sorry}
58 \let\italicpi\pi
59 \let\uppi\pi %but avoid errors
60 \examn@uprightpifalse
61 \fi
62 \fi
63 \newcommand\BSc{B.Sc.{}}
64 \newcommand\MSci{M.Sci.{}}
65 \newcommand\MSc{M.Sc.{}}
66 \newcommand\MA{M.A.{}}
67 \newcommand\MEng{M.Eng.{}}
68 \newcommand\BEng{B.Eng.{}}
69 \ifnum\examn@mtselect>2
70 % ie, STIX2, and thus using the unicode-math package (see above)
71 \def\e{\symup{e}}
72 \newcommand{\dd}{\symup{d}}
73 \newcommand{\ddd}{\,\symup{d}}
74 \else
75 \def\e{\mathrm{e}}
76 \newcommand{\dd}{\mathrm{d}}
77 \newcommand{\ddd}{\,\mathrm{d}}
78 \fi
79
80 \def\Diffl{\@ifstar\@Difflflat\@Diffl}
81 \def\Partial{\@ifstar\@Partialflat\@Partial}
82 \def\@Partial{\@ifnextchar[{\@@Diffl\partial}{\@@Diffl\partial[]}}
83 \def\@Partialflat{\@ifnextchar[{\@@Difflflat\partial}{\@@Difflflat\partial[]}}
84 \def\@Diffl{\@ifnextchar[{\@@Diffl\dd}{\@@Diffl\dd[]}}
85 \def\@Difflflat{\@ifnextchar[{\@@Difflflat\dd}{\@@Difflflat\dd[]}}
86 \def\@@Diffl#1[#2]#3#4{%
87 \def\@tempa{#2}%
88 \ifx\@tempa\empty
89 \frac{#1#3}{#1#4}%
90 \else
91 \frac{{#1}^{#2}#3}{#1{#4}^{#2}}%
92 \fi}
93 \def\@@Difflflat#1[#2]#3#4{%
94 \def\@tempa{#2}%
95 \ifx\@tempa\empty
96 #1#3\mskip-0.8mu/\mskip-1.2mu #1#4%
97 \else
98 {#1}^{#2}#3\mskip-0.8mu /\mskip-1.2mu #1{#4}^{#2}%
99 \fi}
100 \def\units{\examn@unitswarning
101 \begingroup
102 \catcode`\.=\active
103 \@ifstar{\let\un@tsspace\relax \un@ts}%
104 {\let\un@tsspace\thinspace\un@ts}}
105 \begingroup
106 \catcode`\.=\active
107 \gdef\un@ts#1{\let~\thinspace\let.\thinspace
108 \ifmmode
109 \un@tsspace\mathrm{#1}%
110 \else
111 \nobreak$\un@tsspace\mathrm{#1}$%
112 \fi
113 \endgroup}
114 \endgroup
115 \newif\ifexamn@warnunits \examn@warnunitstrue
116 \def\examn@unitswarning{\ifexamn@warnunits
117 \ClassWarning{exam-n}{The units macro will be removed in the next
118 version; the [siunitx] option is now on by default, so you can use
119 the macros in the siunits package}%
120 \global\examn@warnunitsfalse
121 \fi}