summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mathpunctspace
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-27 20:35:44 +0000
committerKarl Berry <karl@freefriends.org>2018-02-27 20:35:44 +0000
commitec566b80f9bf87eb30846339dc51a66024bf5c18 (patch)
treec45a22254ea342d375789392cca87c814771f03d /Master/texmf-dist/tex/latex/mathpunctspace
parent4b3ad15e4aeda32d2b413dbe9f8d3e3557f88cc5 (diff)
mathpunctspace (27feb18)
git-svn-id: svn://tug.org/texlive/trunk@46754 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mathpunctspace')
-rw-r--r--Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty119
1 files changed, 80 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty b/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty
index 2c9a1bc2d78..c7da8a4b575 100644
--- a/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty
+++ b/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty
@@ -1,72 +1,94 @@
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{mathpunctspace}
- [2017/04/03 v1.0 style file ``mathpunctspace.sty''^^J
+ [2018/02/27 v1.1 style file ``mathpunctspace.sty''^^J
by Yuwsuke Kieda]
\RequirePackage{xkeyval}
-\newif\if@postspace@comma@natural \@postspace@comma@naturaltrue
-\newif\if@postspace@semicolon@natural \@postspace@semicolon@naturaltrue
-\newif\if@unit@mu \@unit@mutrue
-\DeclareOptionX{comma}[natural]{\def\@temp@comma@postskip{#1}}
-\DeclareOptionX{semicolon}[natural]{\def\@temp@semicolon@postskip{#1}}
-\DeclareOptionX{unit}[mu]{\def\@unit@space{#1}}
+\newif\ifm@th@p@s@postspace@comma@natural \m@th@p@s@postspace@comma@naturaltrue
+\newif\ifm@th@p@s@postspace@colon@natural \m@th@p@s@postspace@colon@naturaltrue
+\newif\ifm@th@p@s@postspace@semicolon@natural \m@th@p@s@postspace@semicolon@naturaltrue
+\newif\ifm@th@p@s@unit@mu \m@th@p@s@unit@mutrue
+\DeclareOptionX{comma}[natural]{\def\m@th@p@s@comma@postskip{#1}}
+\DeclareOptionX{colon}[natural]{\def\m@th@p@s@colon@postskip{#1}}
+\DeclareOptionX{semicolon}[natural]{\def\m@th@p@s@semicolon@postskip{#1}}
+\DeclareOptionX{unit}[mu]{\def\m@th@p@s@unit@space{#1}}
\DeclareOptionX{latexorg}{\endinput}
\ProcessOptionsX
-\@ifundefined{@temp@comma@postskip}{\def\@temp@comma@postskip{natural}}{}
-\@ifundefined{@temp@semicolon@postskip}{\def\@temp@semicolon@postskip{natural}}{}
-\@ifundefined{@unit@space}{\def\@unit@space{mu}}{}
+\@ifundefined{m@th@p@s@comma@postskip}{\def\m@th@p@s@comma@postskip{natural}}{}
+\@ifundefined{m@th@p@s@colon@postskip}{\def\m@th@p@s@colon@postskip{natural}}{}
+\@ifundefined{m@th@p@s@semicolon@postskip}{\def\m@th@p@s@semicolon@postskip{natural}}{}
+\@ifundefined{m@th@p@s@unit@space}{\def\m@th@p@s@unit@space{mu}}{}
-\def\@tmp@unit@mu{mu}
-\ifx\@unit@space\@tmp@unit@mu\@unit@mutrue\else\@unit@mufalse\fi
+\def\@tmpm@th@p@s@unit@mu{mu}
+\ifx\m@th@p@s@unit@space\@tmpm@th@p@s@unit@mu\m@th@p@s@unit@mutrue\else\m@th@p@s@unit@mufalse\fi
\setbox\@tempboxa\hbox{$\mskip\thinmuskip$}%
-\def\@temp@comma@postskip@natural{natural}
-\ifx\@temp@comma@postskip\@temp@comma@postskip@natural
- \newskip\postspace@comma
- \def\@temp@comma@postskip{%
+\def\m@th@p@s@comma@postskip@natural{natural}
+\ifx\m@th@p@s@comma@postskip\m@th@p@s@comma@postskip@natural
+ \newskip\m@th@p@s@postspace@comma
+ \def\m@th@p@s@comma@postskip{%
\dimexpr\fontdimen2\the\font-\wd\@tempboxa\relax
plus \fontdimen3\the\font
minus \fontdimen4\the\font}
\else
- \@postspace@comma@naturalfalse
- \if@unit@mu
- \newmuskip\postspace@comma
+ \m@th@p@s@postspace@comma@naturalfalse
+ \ifm@th@p@s@unit@mu
+ \newmuskip\m@th@p@s@postspace@comma
\else
- \newskip\postspace@comma
+ \newskip\m@th@p@s@postspace@comma
\fi
\fi
+\setbox\@tempboxa\hbox{$\mskip\thinmuskip$}%
+\def\@colon@postskip@natural{natural}
+\ifx\m@th@p@s@colon@postskip\@colon@postskip@natural
+ \newskip\m@th@p@s@postspace@colon
+ \def\m@th@p@s@colon@postskip{%
+ \dimexpr\fontdimen2\the\font-\wd\@tempboxa\relax
+ plus \fontdimen3\the\font
+ minus \fontdimen4\the\font}
+\else
+ \m@th@p@s@postspace@colon@naturalfalse
+ \ifm@th@p@s@unit@mu
+ \newmuskip\m@th@p@s@postspace@colon
+ \else
+ \newskip\m@th@p@s@postspace@colon
+ \fi
+\fi
+
+\setbox\@tempboxa\hbox{$\mskip\thinmuskip$}%
\def\@semicolon@postskip@natural{natural}
-\ifx\@temp@semicolon@postskip\@semicolon@postskip@natural
- \newskip\postspace@semicolon
- \def\@temp@semicolon@postskip{%
+\ifx\m@th@p@s@semicolon@postskip\@semicolon@postskip@natural
+ \newskip\m@th@p@s@postspace@semicolon
+ \def\m@th@p@s@semicolon@postskip{%
\dimexpr\fontdimen2\the\font-\wd\@tempboxa\relax
plus \fontdimen3\the\font
minus \fontdimen4\the\font}
\else
- \@postspace@semicolon@naturalfalse
- \if@unit@mu
- \newmuskip\postspace@semicolon
+ \m@th@p@s@postspace@semicolon@naturalfalse
+ \ifm@th@p@s@unit@mu
+ \newmuskip\m@th@p@s@postspace@semicolon
\else
- \newskip\postspace@semicolon
+ \newskip\m@th@p@s@postspace@semicolon
\fi
\fi
-\postspace@comma\@temp@comma@postskip\relax
-\postspace@semicolon\@temp@semicolon@postskip\relax
+\m@th@p@s@postspace@comma\m@th@p@s@comma@postskip\relax
+\m@th@p@s@postspace@colon\m@th@p@s@colon@postskip\relax
+\m@th@p@s@postspace@semicolon\m@th@p@s@semicolon@postskip\relax
\begingroup
\catcode`\,=\active
-\if@postspace@comma@natural
- \def\@x@{\def,{\normalcomma\hskip\postspace@comma}}
+\ifm@th@p@s@postspace@comma@natural
+ \def\@x@{\def,{\normalcomma\hskip\m@th@p@s@postspace@comma}}
\else
- \if@unit@mu
- \def\@x@{\def,{\normalcomma\mskip\postspace@comma}}
+ \ifm@th@p@s@unit@mu
+ \def\@x@{\def,{\thinmuskip\m@th@p@s@postspace@comma\normalcomma}}
\else
- \def\@x@{\def,{\normalcomma\hskip\postspace@comma}}
+ \def\@x@{\def,{\normalcomma\hskip\m@th@p@s@postspace@comma}}
\fi
\fi
\expandafter\endgroup\@x@%
@@ -77,13 +99,13 @@
\begingroup
\catcode`\;=\active
-\if@postspace@semicolon@natural
- \def\@x@{\def;{\normalsemicolon\hskip\postspace@semicolon}}
+\ifm@th@p@s@postspace@semicolon@natural
+ \def\@x@{\def;{\normalsemicolon\hskip\m@th@p@s@postspace@semicolon}}
\else
- \if@unit@mu
- \def\@x@{\def;{\normalsemicolon\mskip\postspace@semicolon}}
+ \ifm@th@p@s@unit@mu
+ \def\@x@{\def;{\normalsemicolon\mskip\m@th@p@s@postspace@semicolon}}
\else
- \def\@x@{\def;{\normalsemicolon\hskip\postspace@semicolon}}
+ \def\@x@{\def;{\normalsemicolon\hskip\m@th@p@s@postspace@semicolon}}
\fi
\fi
\expandafter\endgroup\@x@%
@@ -92,4 +114,23 @@
% last space is *necessary*
\def\normalsemicolon{\mathchar"603B }
+\begingroup
+\catcode`\:=\active
+\ifm@th@p@s@postspace@colon@natural
+ \def\@x@{\def:{\normalcolon\hskip\m@th@p@s@postspace@colon}}
+\else
+ \ifm@th@p@s@unit@mu
+ \def\@x@{\def:{\normalcolon\mskip\m@th@p@s@postspace@colon}}
+ \else
+ \def\@x@{\def:{\normalcolon\hskip\m@th@p@s@postspace@colon}}
+ \fi
+\fi
+\expandafter\endgroup\@x@%
+% *only* in math-mode are made active...
+\mathcode`\:="8000
+% last space is *necessary*
+\def\normalcolon{\mathchar"603A }
+
+\renewcommand\colon{\mathpunct{:}}
+
\endinput