-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspaces.tex
76 lines (76 loc) · 2.9 KB
/
spaces.tex
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
%
% This is file `spaces.tex'.
%
% The standard usage is:
%
% \newcommand*\mathscalefractioninverse{25/26}
% \input{spaces}
% % Note:
% % If not specified, then \mathscalefractioninverse
% % will be set to 1.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\expandafter\edef\csname current@catcode\endcsname{\the\catcode`\@}
\catcode`\@=11 %
% Math scale fraction inverse
\ifx\mathscalefractioninverse\@undefined
\def\mathscalefractioninverse{1}
\fi
% Math spaces
\thinmuskip =\muexpr\thinmuskip *\mathscalefractioninverse\relax
\medmuskip =\muexpr\medmuskip *\mathscalefractioninverse\relax
\thickmuskip=\muexpr\thickmuskip*\mathscalefractioninverse\relax
% Text spaces
\def\enspace{\kern\dimexpr\unexpanded{\f@size}\p@/2\relax}
\def\enskip{\hskip\dimexpr\unexpanded{\f@size}\p@/2\relax\relax}
\def\quad{\hskip\dimexpr\unexpanded{\f@size}\p@\relax\relax}
\def\qquad{\hskip\dimexpr\unexpanded{\f@size}\p@*2\relax\relax}
% \, and friends need extra care
\AtBeginDocument{%
\@ifpackageloaded{amsmath}{%
\renewcommand\,%
{\tmspace+\thinmuskip{\dimexpr\unexpanded{\f@size}\p@/6}}%
\let\thinspace\,%
\renewcommand\!%
{\tmspace-\thinmuskip{\dimexpr\unexpanded{\f@size}\p@/6}}%
\let\negthinspace\!%
\renewcommand\:%
{\tmspace+\medmuskip{\dimexpr\unexpanded{\f@size}\p@*2/9}}%
\let\medspace\:%
\renewcommand\negmedspace
{\tmspace-\medmuskip{\dimexpr\unexpanded{\f@size}\p@*2/9}}%
\renewcommand\;%
{\tmspace+\thickmuskip{\dimexpr\unexpanded{\f@size}\p@*5/18}}%
\let\thickspace\;%
\renewcommand\negthickspace
{\tmspace-\thickmuskip{\dimexpr\unexpanded{\f@size}\p@*5/18}}%
\renewcommand\bmod{\nonscript\mskip-\medmuskip\mkern\thickmuskip\mathbin
{\operator@font mod}\penalty900
\mkern\thickmuskip\nonscript\mskip-\medmuskip}%
\renewcommand\pod[1]{\allowbreak
\if@display\mkern\muexpr18mu*\mathscalefractioninverse\relax
\else\mkern\muexpr8mu*\mathscalefractioninverse\relax\fi(#1)}%
\renewcommand\pmod[1]{\pod{{\operator@font mod}\,\,#1}}%
\renewcommand\mod[1]{\allowbreak
\if@display\mkern\muexpr18mu*\mathscalefractioninverse\relax
\else\mkern\muexpr12mu*\mathscalefractioninverse\relax\fi
{\operator@font mod}\,\,#1}%
\renewcommand\minalignsep{\dimexpr\unexpanded{\f@size}\p@\relax}%
\renewcommand\mintagsep{0.5\dimexpr\unexpanded{\f@size}\p@\relax}%
\multlinegap\f@size\p@\relax
\multlinetaggap\f@size\p@\relax
}{%
\def\thinspace{\kern\dimexpr\unexpanded{\f@size}\p@/6\relax}%
\def\negthinspace{\kern-\dimexpr\unexpanded{\f@size}\p@/6\relax}%
\def\bmod{%
\nonscript\mskip-\medmuskip\mkern\thickmuskip
\mathbin{\operator@font mod}\penalty900\mkern\thickmuskip
\nonscript\mskip-\medmuskip}%
\def\pmod#1{%
\allowbreak\mkern\muexpr18mu*\mathscalefractioninverse\relax
({\operator@font mod}\,\,#1)}%
}%
}
\catcode`\@=\current@catcode\relax
\endinput