texlive[46754] Master/texmf-dist: mathpunctspace (27feb18)
commits+karl at tug.org
commits+karl at tug.org
Tue Feb 27 21:35:44 CET 2018
Revision: 46754
http://tug.org/svn/texlive?view=revision&revision=46754
Author: karl
Date: 2018-02-27 21:35:44 +0100 (Tue, 27 Feb 2018)
Log Message:
-----------
mathpunctspace (27feb18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/mathpunctspace/README.md
trunk/Master/texmf-dist/doc/latex/mathpunctspace/latexorg.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/mathpunctspace.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/mathpunctspace.tex
trunk/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat-colonnat.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu-colon30mu.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt-colon5pt.pdf
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt.pdf
trunk/Master/texmf-dist/doc/latex/mathpunctspace/ordinary-comma.pdf
Modified: trunk/Master/texmf-dist/doc/latex/mathpunctspace/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathpunctspace/README.md 2018-02-27 13:24:28 UTC (rev 46753)
+++ trunk/Master/texmf-dist/doc/latex/mathpunctspace/README.md 2018-02-27 20:35:44 UTC (rev 46754)
@@ -6,7 +6,7 @@
## Version
-1.0
+1.1
## Usage
@@ -13,7 +13,7 @@
### Sample of Preamble
```
-\usepackage[comma= N mu, semicolon= M mu]{mathpunctspace}% N, M = as you like
+\usepackage[comma= L mu, semicolon= M mu, colon= N mu]{mathpunctspace}% L, M, N = as you like
```
### Options
@@ -21,6 +21,7 @@
* unit: mt or other (default: mu)
* comma: substitute keyword natural or skip (default: natural)
* semicolon: substitute keyword natural or skip (default: natural)
+ * colon: substitute keyword natural or skip (default: natural)
* latexorg: original behavior of LaTeX
Remark: keyword ``natural'' mean the spacing of the in-line.
Added: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat-colonnat.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat-colonnat.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat-colonnat.pdf 2018-02-27 13:24:28 UTC (rev 46753)
+++ trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat-colonnat.pdf 2018-02-27 20:35:44 UTC (rev 46754)
Property changes on: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat-colonnat.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma0mu-semicolonnat.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu-colon30mu.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu-colon30mu.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu-colon30mu.pdf 2018-02-27 13:24:28 UTC (rev 46753)
+++ trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu-colon30mu.pdf 2018-02-27 20:35:44 UTC (rev 46754)
Property changes on: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu-colon30mu.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma10mu-semicolon20mu.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt-colon5pt.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt-colon5pt.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt-colon5pt.pdf 2018-02-27 13:24:28 UTC (rev 46753)
+++ trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt-colon5pt.pdf 2018-02-27 20:35:44 UTC (rev 46754)
Property changes on: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt-colon5pt.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/mathpunctspace/comma5pt-semicolon5pt.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/mathpunctspace/latexorg.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/mathpunctspace/mathpunctspace.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/mathpunctspace/mathpunctspace.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathpunctspace/mathpunctspace.tex 2018-02-27 13:24:28 UTC (rev 46753)
+++ trunk/Master/texmf-dist/doc/latex/mathpunctspace/mathpunctspace.tex 2018-02-27 20:35:44 UTC (rev 46754)
@@ -7,7 +7,7 @@
\title{Control the Space After Punctuation in Expressions}
\author{Yuwsuke Kieda}
-\date{2017/04/03 v1.0}
+\date{2018/02/27 v1.1}
\begin{document}
\maketitle
@@ -30,6 +30,7 @@
\item unit: mu or other (default: mu)
\item comma: substitute keyword ``natural'' or skip (default: natural)
\item semicolon: substitute keyword ``natural'' or skip (default: natural)
+ \item colon: substitute keyword ``natural'' or skip (default: natural)
\item latexorg: original behavior of LaTeX
\end{itemize}
@@ -45,31 +46,53 @@
\section{Samples}
+
+\subsection{Sources}
+
\begin{verbatim}
+Lorem ipsum $(x, y)$, dolor sit amet.
+
+Lorem ipsum $\{x; x \in A\}$; dolor sit amet.
+
+Lorem ipsum $f\colon g \to h$: dolor sit amet.
+\end{verbatim}
+
+\subsection{Sample of Options and Results}
+
+\begin{verbatim}
+\usepackage[latexorg]{mathpunctspace}
+\end{verbatim}
+
+\includegraphics{latexorg.pdf}
+
+\begin{verbatim}
\usepackage{mathpunctspace}
+% same: comma=natural,semicolon=natural,colon=natural
\end{verbatim}
-Lorem ipsum dolor sit amet $(x, y)$, consectetuer adipiscing elit.
+Lorem ipsum $(x, y)$, dolor sit amet.
-Lorem ipsum dolor sit amet $\{x; x \in A\}$; consectetuer adipiscing elit.
+Lorem ipsum $\{x; x \in A\}$; dolor sit amet.
+Lorem ipsum $f\colon g \to h$: dolor sit amet.
+
\begin{verbatim}
-\usepackage[comma=10mu,semicolon=20mu]{mathpunctspace}
+\usepackage[comma=10mu,semicolon=20mu,colon=30mu]{mathpunctspace}
\end{verbatim}
-\includegraphics{comma10mu-semicolon20mu.pdf}
+\includegraphics{comma10mu-semicolon20mu-colon30mu.pdf}
\begin{verbatim}
-\usepackage[unit=pt,comma=5pt,semicolon=5pt]{mathpunctspace}
+\usepackage[unit=pt,comma=5pt,semicolon=5pt,colon=5pt]{mathpunctspace}
\end{verbatim}
-\includegraphics{comma5pt-semicolon5pt.pdf}
+\includegraphics{comma5pt-semicolon5pt-colon5pt.pdf}
\begin{verbatim}
-\usepackage[comma=0mu,semicolon=natural]{mathpunctspace}
+\usepackage[comma=0mu,semicolon=natural,colon=natural]{mathpunctspace}
\end{verbatim}
-\includegraphics{comma0mu-semicolonnat.pdf}
+\includegraphics{comma0mu-semicolonnat-colonnat.pdf}
\section{Risks}
@@ -80,9 +103,18 @@
\end{verbatim}
\begin{center}
+ \makeatletter
+ \begingroup
+ \catcode`\,=\active
+ \def\@x@{\def,{\thinmuskip20mu\normalcomma}}%
+ \expandafter\endgroup\@x@%
+% \catcode`\,=\active
+% \def\@x@{\def,{\normalcomma\mskip10mu}}%
+% \expandafter\endgroup\@x@%
+ \makeatother
\setbox9\hbox{,}%
Input: \verb!$1{,}000$!\qquad
- Output: \raisebox{-\dp9}{\includegraphics{ordinary-comma.pdf}}
+ Output: $1{,}000$\quad $1,000$
\end{center}
\end{document}
Deleted: trunk/Master/texmf-dist/doc/latex/mathpunctspace/ordinary-comma.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty 2018-02-27 13:24:28 UTC (rev 46753)
+++ trunk/Master/texmf-dist/tex/latex/mathpunctspace/mathpunctspace.sty 2018-02-27 20:35:44 UTC (rev 46754)
@@ -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 at postspace@comma at natural \@postspace at comma@naturaltrue
-\newif\if at postspace@semicolon at natural \@postspace at semicolon@naturaltrue
-\newif\if at unit@mu \@unit at mutrue
-\DeclareOptionX{comma}[natural]{\def\@temp at comma@postskip{#1}}
-\DeclareOptionX{semicolon}[natural]{\def\@temp at semicolon@postskip{#1}}
-\DeclareOptionX{unit}[mu]{\def\@unit at space{#1}}
+\newif\ifm at th@p at s@postspace at comma@natural \m at th@p at s@postspace at comma@naturaltrue
+\newif\ifm at th@p at s@postspace at colon@natural \m at th@p at s@postspace at colon@naturaltrue
+\newif\ifm at th@p at s@postspace at semicolon@natural \m at th@p at s@postspace at semicolon@naturaltrue
+\newif\ifm at th@p at s@unit at mu \m at th@p at s@unit at mutrue
+\DeclareOptionX{comma}[natural]{\def\m at th@p at s@comma at postskip{#1}}
+\DeclareOptionX{colon}[natural]{\def\m at th@p at s@colon at postskip{#1}}
+\DeclareOptionX{semicolon}[natural]{\def\m at th@p at s@semicolon at postskip{#1}}
+\DeclareOptionX{unit}[mu]{\def\m at th@p at s@unit at space{#1}}
\DeclareOptionX{latexorg}{\endinput}
\ProcessOptionsX
-\@ifundefined{@temp at comma@postskip}{\def\@temp at comma@postskip{natural}}{}
-\@ifundefined{@temp at semicolon@postskip}{\def\@temp at semicolon@postskip{natural}}{}
-\@ifundefined{@unit at space}{\def\@unit at space{mu}}{}
+\@ifundefined{m at th@p at s@comma at postskip}{\def\m at th@p at s@comma at postskip{natural}}{}
+\@ifundefined{m at th@p at s@colon at postskip}{\def\m at th@p at s@colon at postskip{natural}}{}
+\@ifundefined{m at th@p at s@semicolon at postskip}{\def\m at th@p at s@semicolon at postskip{natural}}{}
+\@ifundefined{m at th@p at s@unit at space}{\def\m at th@p at s@unit at space{mu}}{}
-\def\@tmp at unit@mu{mu}
-\ifx\@unit at space\@tmp at unit@mu\@unit at mutrue\else\@unit at mufalse\fi
+\def\@tmpm at th@p at s@unit at mu{mu}
+\ifx\m at th@p at s@unit at space\@tmpm at th@p at s@unit at mu\m at th@p at s@unit at mutrue\else\m at th@p at s@unit at mufalse\fi
\setbox\@tempboxa\hbox{$\mskip\thinmuskip$}%
-\def\@temp at comma@postskip at natural{natural}
-\ifx\@temp at comma@postskip\@temp at comma@postskip at natural
- \newskip\postspace at comma
- \def\@temp at comma@postskip{%
+\def\m at th@p at s@comma at postskip@natural{natural}
+\ifx\m at th@p at s@comma at postskip\m at th@p at s@comma at postskip@natural
+ \newskip\m at th@p at s@postspace at comma
+ \def\m at th@p at s@comma at postskip{%
\dimexpr\fontdimen2\the\font-\wd\@tempboxa\relax
plus \fontdimen3\the\font
minus \fontdimen4\the\font}
\else
- \@postspace at comma@naturalfalse
- \if at unit@mu
- \newmuskip\postspace at comma
+ \m at th@p at s@postspace at comma@naturalfalse
+ \ifm at th@p at s@unit at mu
+ \newmuskip\m at th@p at s@postspace at comma
\else
- \newskip\postspace at comma
+ \newskip\m at th@p at s@postspace at comma
\fi
\fi
+\setbox\@tempboxa\hbox{$\mskip\thinmuskip$}%
+\def\@colon at postskip@natural{natural}
+\ifx\m at th@p at s@colon at postskip\@colon at postskip@natural
+ \newskip\m at th@p at s@postspace at colon
+ \def\m at th@p at s@colon at postskip{%
+ \dimexpr\fontdimen2\the\font-\wd\@tempboxa\relax
+ plus \fontdimen3\the\font
+ minus \fontdimen4\the\font}
+\else
+ \m at th@p at s@postspace at colon@naturalfalse
+ \ifm at th@p at s@unit at mu
+ \newmuskip\m at th@p at s@postspace at colon
+ \else
+ \newskip\m at th@p at s@postspace at colon
+ \fi
+\fi
+
+\setbox\@tempboxa\hbox{$\mskip\thinmuskip$}%
\def\@semicolon at postskip@natural{natural}
-\ifx\@temp at semicolon@postskip\@semicolon at postskip@natural
- \newskip\postspace at semicolon
- \def\@temp at semicolon@postskip{%
+\ifx\m at th@p at s@semicolon at postskip\@semicolon at postskip@natural
+ \newskip\m at th@p at s@postspace at semicolon
+ \def\m at th@p at s@semicolon at postskip{%
\dimexpr\fontdimen2\the\font-\wd\@tempboxa\relax
plus \fontdimen3\the\font
minus \fontdimen4\the\font}
\else
- \@postspace at semicolon@naturalfalse
- \if at unit@mu
- \newmuskip\postspace at semicolon
+ \m at th@p at s@postspace at semicolon@naturalfalse
+ \ifm at th@p at s@unit at mu
+ \newmuskip\m at th@p at s@postspace at semicolon
\else
- \newskip\postspace at semicolon
+ \newskip\m at th@p at s@postspace at semicolon
\fi
\fi
-\postspace at comma\@temp at comma@postskip\relax
-\postspace at semicolon\@temp at semicolon@postskip\relax
+\m at th@p at s@postspace at comma\m at th@p at s@comma at postskip\relax
+\m at th@p at s@postspace at colon\m at th@p at s@colon at postskip\relax
+\m at th@p at s@postspace at semicolon\m at th@p at s@semicolon at postskip\relax
\begingroup
\catcode`\,=\active
-\if at postspace@comma at natural
- \def\@x@{\def,{\normalcomma\hskip\postspace at comma}}
+\ifm at th@p at s@postspace at comma@natural
+ \def\@x@{\def,{\normalcomma\hskip\m at th@p at s@postspace at comma}}
\else
- \if at unit@mu
- \def\@x@{\def,{\normalcomma\mskip\postspace at comma}}
+ \ifm at th@p at s@unit at mu
+ \def\@x@{\def,{\thinmuskip\m at th@p at s@postspace at comma\normalcomma}}
\else
- \def\@x@{\def,{\normalcomma\hskip\postspace at comma}}
+ \def\@x@{\def,{\normalcomma\hskip\m at th@p at s@postspace at comma}}
\fi
\fi
\expandafter\endgroup\@x@%
@@ -77,13 +99,13 @@
\begingroup
\catcode`\;=\active
-\if at postspace@semicolon at natural
- \def\@x@{\def;{\normalsemicolon\hskip\postspace at semicolon}}
+\ifm at th@p at s@postspace at semicolon@natural
+ \def\@x@{\def;{\normalsemicolon\hskip\m at th@p at s@postspace at semicolon}}
\else
- \if at unit@mu
- \def\@x@{\def;{\normalsemicolon\mskip\postspace at semicolon}}
+ \ifm at th@p at s@unit at mu
+ \def\@x@{\def;{\normalsemicolon\mskip\m at th@p at s@postspace at semicolon}}
\else
- \def\@x@{\def;{\normalsemicolon\hskip\postspace at semicolon}}
+ \def\@x@{\def;{\normalsemicolon\hskip\m at th@p at s@postspace at semicolon}}
\fi
\fi
\expandafter\endgroup\@x@%
@@ -92,4 +114,23 @@
% last space is *necessary*
\def\normalsemicolon{\mathchar"603B }
+\begingroup
+\catcode`\:=\active
+\ifm at th@p at s@postspace at colon@natural
+ \def\@x@{\def:{\normalcolon\hskip\m at th@p at s@postspace at colon}}
+\else
+ \ifm at th@p at s@unit at mu
+ \def\@x@{\def:{\normalcolon\mskip\m at th@p at s@postspace at colon}}
+ \else
+ \def\@x@{\def:{\normalcolon\hskip\m at th@p at s@postspace at 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
More information about the tex-live-commits
mailing list