-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphysics2-code.src.misc.dtx
96 lines (96 loc) · 2.51 KB
/
physics2-code.src.misc.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
% \DeclareSourceFile{misc}
%
%
%
% \section{The \modu{qtext.legacy} module}
% This module is written for the compatibility with the bad commands provided by
% \pkg{physics} only. The commands in this module should NEVER be used!
% \begin{macrocode}
%<*qtext.legacy>
\ProvidesFile{phy-qtext.legacy.sty}
[2023/10/24 `qtext.legacy' module of physics2.sty]
\RequirePackage{amstext}
\def\phy@qtext@#1#2{#1\text{#2}\quad}
\DeclareRobustCommand\qqtext{\@ifstar{\phy@qtext@{}}{\phy@qtext@\quad}}
\DeclareRobustCommand\qq{\qqtext}
\DeclareRobustCommand\qcomma{,\quad}
\DeclareRobustCommand\qc{\qcomma}
\DeclareRobustCommand\qcc{\@ifstar{\phy@qtext@{}{c.c}}{\phy@qtext@\quad{c.c}}}
\def\phy@qtext@lega@gen@#1{%
\expandafter\DeclareRobustCommand\csname q#1\endcsname%
{\@ifstar{\phy@qtext@{}{#1}}{\phy@qtext@\quad{#1}}}}
\phy@qtext@lega@gen@{if}
\phy@qtext@lega@gen@{then}
\phy@qtext@lega@gen@{else}
\phy@qtext@lega@gen@{otherwise}
\phy@qtext@lega@gen@{unless}
\phy@qtext@lega@gen@{give}
\phy@qtext@lega@gen@{using}
\phy@qtext@lega@gen@{unless}
\phy@qtext@lega@gen@{assume}
\phy@qtext@lega@gen@{since}
\phy@qtext@lega@gen@{let}
\phy@qtext@lega@gen@{for}
\phy@qtext@lega@gen@{all}
\phy@qtext@lega@gen@{even}
\phy@qtext@lega@gen@{odd}
\phy@qtext@lega@gen@{integer}
\phy@qtext@lega@gen@{and}
\phy@qtext@lega@gen@{or}
\phy@qtext@lega@gen@{as}
\phy@qtext@lega@gen@{in}
%</qtext.legacy>
% \end{macrocode}
%
%
%
% \section{The \modu{bm-um.legacy} module}
% \begin{macrocode}
%<@@=phy>
%<*bm-um.legacy>
\ProvidesExplFile{phy-bm-um.legacy.sty}{2023/10/24}{}
{`bm-um.legacy' module of physics2}
\AtBeginDocument
{
\cs_if_exist:cF { symbf }
{
\PackageError { physics2 }
{
The ~ `bm-um.legacy' ~ module ~ requires ~
`unicode-math' ~ package
}
{
Have ~ you ~ used ~ `unicode-math' ~
in ~ the ~ preamble?
}
}
}
\DeclareDocumentCommand \bm { m }
{
\mode_if_math:TF
{
\tl_if_head_eq_catcode:nNTF { #1 } A
{
\symbfit { #1 }
}
{
\symbf { #1 }
}
}
{
\PackageError { physics2 }
{
The ~ \string\bm\space command ~ should ~ be ~
used ~ in ~ math ~ mode ~ only. \MessageBreak
This ~ is ~ an ~ error ~ from ~ `bm-um.legacy' ~ module
}
{
Check ~ if ~ any ~ `\string\bm' ~ is ~ out ~
of ~ math ~ mode.
}
}
}
%</bm-um.legacy>
%<@@=>
% \end{macrocode}
\endinput