diff options
author | Karl Berry <karl@freefriends.org> | 2008-12-24 23:27:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-12-24 23:27:00 +0000 |
commit | b32f575da15f39882f8c3e83c838ef841cba2304 (patch) | |
tree | bcc66dba59bb83b0586b115e26142664077217d9 /Master | |
parent | 4d5b0d9afc48f2d8e9ae1e3198a4b9adf142deae (diff) |
ionumbers update (24dec08)
git-svn-id: svn://tug.org/texlive/trunk@11706 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/ionumbers/README | 30 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf | bin | 215383 -> 228027 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf | bin | 0 -> 64720 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex | 594 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/ionumbers/Makefile | 18 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx | 346 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty | 195 |
7 files changed, 960 insertions, 223 deletions
diff --git a/Master/texmf-dist/doc/latex/ionumbers/README b/Master/texmf-dist/doc/latex/ionumbers/README index adc28bf23da..66bf1a38f71 100644 --- a/Master/texmf-dist/doc/latex/ionumbers/README +++ b/Master/texmf-dist/doc/latex/ionumbers/README @@ -26,15 +26,16 @@ See `ionumbers.pdf' for detailed information on usage. BUILDING ======== -If you do not want to use the pre-build `ionumber.sty' and `ionumber.pdf' +If you do not want to use any pre-build `ionumber.sty' and `ionumber.pdf' files, you will have to choose one of the following two ways for building them. Otherwise you can skip this section. 1) Building with make --------------------- -Running `make' will create the LaTeX package and documentation: - # make +Running `make' will create the LaTeX package, the documentation and the test +file: + $ make 2) Building manually -------------------- @@ -42,21 +43,26 @@ Running `make' will create the LaTeX package and documentation: a) Generation of package (.sty file): Run `ionumbers.ins' through LaTeX: - # pdflatex -interaction=nonstopmode ionumbers.ins + $ pdflatex -interaction=nonstopmode ionumbers.ins b) Generation of documentation: Run `ionumbers.dtx' through LaTeX: - # pdflatex -interaction=nonstopmode ionumbers.dtx + $ pdflatex -interaction=nonstopmode ionumbers.dtx Then create the index and change history: - # makeindex -s gind.ist -o ionumbers.ind ionumbers.idx - # makeindex -s gglo.ist -o ionumbers.gls ionumbers.glo - -Finally, run `ionumbers.dtx' three time through LaTeX. - # pdflatex -interaction=nonstopmode ionumbers.dtx - # pdflatex -interaction=nonstopmode ionumbers.dtx - # pdflatex -interaction=nonstopmode ionumbers.dtx + $ makeindex -s gind.ist -o ionumbers.ind ionumbers.idx + $ makeindex -s gglo.ist -o ionumbers.gls ionumbers.glo + +Finally, run `ionumbers.dtx' three time through LaTeX: + $ pdflatex -interaction=nonstopmode ionumbers.dtx + $ pdflatex -interaction=nonstopmode ionumbers.dtx + $ pdflatex -interaction=nonstopmode ionumbers.dtx + +Optionally you can compile the test file: + $ pdflatex -interaction=nonstopmode ionumbers_test.tex + $ pdflatex -interaction=nonstopmode ionumbers_text.tex + $ pdflatex -interaction=nonstopmode ionumbers_text.tex INSTALLATION ============ diff --git a/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf b/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf Binary files differindex 9b38bcbd7df..2d0b5f40a10 100644 --- a/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf +++ b/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf diff --git a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf Binary files differnew file mode 100644 index 00000000000..fa26422d129 --- /dev/null +++ b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf diff --git a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex index f13cd53e947..304a7992023 100644 --- a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex +++ b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex @@ -22,79 +22,539 @@ % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass{article} +\documentclass[12pt]{article} + +%% a bit more space (this is only a test file, not a typographically perfect +%% book ;-)) +\setlength{\textwidth}{0.75\paperwidth} +\setlength{\marginparsep}{0pt} +\setlength{\marginparwidth}{0pt} +\setlength{\oddsidemargin}{0pt} +\setlength{\evensidemargin}{0pt} +\setlength{\hoffset}{0.125\paperwidth} +\addtolength{\hoffset}{-1in} +\setlength{\topmargin}{0pt} +\setlength{\headheight}{0pt} +\setlength{\headsep}{0pt} +\setlength{\footskip}{0.1\paperheight} +\setlength{\textheight}{0.8\paperheight} \usepackage{ionumbers} +\newcommand*{\header}[1]{% + \hline + \multicolumn{4}{c}{#1}\\ + \hline} +\def\textsqrt{\def\sqrt##1{\textbackslash sqrt ##1}} +\newcommand*{\abc}[2]% + {\texttt{{\textsqrt\$#1\$}} & % + \ionumbersoff{$#1$} & $#1$ & \ionumbersoff{$#2$} \\} +\newcommand{\fileinfo}{% + This is test output of the \textsf{ionumbers} \LaTeX{} package. The default + \LaTeX{} output, the output with \textsf{ionumbers} package and the expected + output with \textsf{ionumbers} package is given for different inputs. + + If the package \textsf{ionumbers} works correctly, the contents in the + `\textsf{ionumbers}' columns and the respective contents in the `expected' + columns must be identical. + + \vspace{2ex}\noindent +} + +\frenchspacing + \begin{document} - \noindent - \begin{minipage}{0.5\textwidth} - \centering - \begin{tabular}{r@{\hspace{1em}}r@{\hspace{1em}}r} - \hline\hline - Input & Output \\ - \hline\hline - \verb!1234567890! & $1234567890$ \\ - \verb!.123456789! & $.123456789$ \\ - \verb!123.456789! & $123.456789$ \\ - \verb!123456.789! & $123456.789$ \\ - \verb!123456789.! & $123456789.$ \\ - \verb!,123456789! & $,123456789$ \\ - \verb!123,456789! & $123,456789$ \\ - \verb!123456,789! & $123456,789$ \\ - \verb!123456789,! & $123456789,$ \\ - \hline\hline - \verb!1234567890! & $1234567890$ \\ - \verb!.123.456.789! & $.123.456.789$ \\ - \verb!1.234.567.89! & $1.234.567.89$ \\ - \verb!12.345.678.9! & $12.345.678.9$ \\ - \verb!123.456.789.! & $123.456.789.$ \\ - \verb!,123,456,789! & $,123,456,789$ \\ - \verb!1,234,567,89! & $1,234,567,89$ \\ - \verb!12,345,678,9! & $12,345,678,9$ \\ - \verb!123,456,789,! & $123,456,789,$ \\ - \hline\hline - \verb!1234567890! & $1234567890$ \\ - \verb!1.23.456.789! & $1.23.456.789$ \\ - \verb!.1234.56789! & $.1234.56789$ \\ - \verb!1,23,456,789! & $1,23,456,789$ \\ - \verb!,1234,56789! & $,1234,56789$ \\ + + \section*{Default options} + \fileinfo + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{simple digits} + \abc{1}{1} + \abc{12}{12} + \abc{123}{123} + \abc{1234}{1234} + \abc{12345}{12345} + \abc{123456}{123456} + \abc{1234567}{1234567} + \header{point} + \abc{.1}{.1} + \abc{1.}{1.} + \abc{1.1}{1.1} + \abc{1. 2}{1. 2} + \abc{1 .2}{1 .2} + \abc{1.23456}{1.23456} + \abc{12345.6}{12345.6} + \abc{1.23.456}{1.23.456} + \abc{a.b}{a.b} + \abc{a.1}{a.1} + \abc{1.a}{1.a} + \header{comma} + \abc{,1}{,1} + \abc{1,}{1,} + \abc{1,1}{1,1} + \abc{1, 2}{1, 2} + \abc{1 ,2}{1 ,2} + \abc{1,23456}{1,23456} + \abc{12345,6}{12345,6} + \abc{1,23,456}{1,23,456} + \abc{a,b}{a,b} + \abc{a,1}{a,1} + \abc{1,a}{1,a} + \hline\hline + \end{tabular} + \end{center} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{plus and minus} + \abc{+1}{+1} + \abc{-1}{-1} + \abc{++1}{++1} + \abc{+ +1}{+ +1} + \abc{+ + 1}{+ + 1} + \abc{1+2}{1+2} + \abc{1+ 2}{1+ 2} + \abc{1 +2}{1 +2} + \abc{1 + 2}{1 + 2} + \abc{1++2}{1++2} + \abc{x+1}{x+1} + \abc{1+x}{1+x} + \abc{x+y}{x+y} + \header{letter `e'} + \abc{1e1234}{1e1234} + \abc{1e+1234}{1e+1234} + \abc{1e.}{1e.} + \abc{1e,}{1e,} + \abc{1e.1234}{1e.1234} + \abc{1e,1234}{1e,1234} + \abc{1e++1234}{1e++1234} + \abc{1e 1234}{1e 1234} + \abc{1e +1234}{1e +1234} + \abc{1 e1234}{1 e1234} + \header{mixed numbers} + \abc{1.234,890}{1.234,890} + \abc{1,234.890}{1,234.890} + \abc{1234e5678}{1234e5678} + \abc{+1234e5678}{+1234e5678} + \abc{1234e+5678}{1234e+5678} + \abc{1.234e5.678}{1.234e5.678} + \abc{1,234e5,678}{1,234e5,678} + \header{single characters} + \abc{\sqrt 1}{\sqrt 1} + \abc{\sqrt 1234}{\sqrt 1234} + \abc{\sqrt +}{\sqrt +} + \abc{\sqrt ++}{\sqrt ++} + \abc{\sqrt +1234}{\sqrt +1234} + \abc{1e\sqrt +1234}{1e\sqrt +1234} + \abc{1\sqrt +1234e0}{1\sqrt +1234e0} \hline\hline \end{tabular} - \end{minipage}% - \begin{minipage}{0.5\textwidth} - \centering - \begin{tabular}{r@{\hspace{1em}}r@{\hspace{1em}}r} - \hline\hline - Input & Output \\ - \hline\hline - \verb!1.23.456.789! & $1.23.456.789$ \\ - \verb!.1234.56789! & $.1234.56789$ \\ - \verb!1,23,456,789! & $1,23,456,789$ \\ - \verb!,1234,56789! & $,1234,56789$ \\ - \hline\hline - \verb!1234567890! & $1234567890$ \\ - \verb!1,234,567.89! & $1,234,567.89$ \\ - \verb!12,345,678.9! & $12,345,678.9$ \\ - \verb!123,456,789.! & $123,456,789.$ \\ - \verb!1.234.567,89! & $1.234.567,89$ \\ - \verb!12.345.678,9! & $12.345.678,9$ \\ - \verb!123.456.789,! & $123.456.789,$ \\ - \hline\hline - \verb!+123456789! & $+1234567890$ \\ - \verb!-123456789! & $-1234567890$ \\ - \verb!+-123456789! & $+-1234567890$ \\ - \verb!-+123456789! & $-+1234567890$ \\ - \verb!+ -123456789! & $+ -1234567890$ \\ - \hline\hline - \verb!1e123456789! & $1e123456789$ \\ - \verb!1e+123456789! & $1e+123456789$ \\ - \verb!1e-123456789! & $1e-123456789$ \\ - \verb!1e.123456789! & $1e.123456789$ \\ - \verb!1e,123456789! & $1e,123456789$ \\ - \verb!1e123e123! & $1e123e123$ \\ - \verb!1ee123456! & $1ee123456$ \\ + \end{center} + + \clearpage + \section*{Options \texttt{autothousands=true,autothousandths=true}} + \fileinfo + \ionumbersresetstyle + \ionumbersstyle{autothousands,autothousandths} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{simple digits} + \abc{1}{1} + \abc{12}{12} + \abc{123}{123} + \abc{1234}{1,234} + \abc{12345}{12,345} + \abc{123456}{123,456} + \abc{1234567}{1,234,567} + \header{point} + \abc{.1}{.1} + \abc{1.}{1.} + \abc{1.1}{1.1} + \abc{1. 2}{1. 2} + \abc{1 .2}{1 .2} + \abc{1.23456}{1.234\,56} + \abc{12345.6}{12,345.6} + \abc{1.23.456}{1.23.4\,56} + \abc{a.b}{a.b} + \abc{a.1}{a.1} + \abc{1.a}{1.a} + \header{comma} + \abc{,1}{,1} + \abc{1,}{1,} + \abc{1,1}{1,1} + \abc{1, 2}{1, 2} + \abc{1 ,2}{1 ,2} + \abc{1,23456}{1,23456} + \abc{12345,6}{12345,6} + \abc{1,23,456}{1,23,456} + \abc{a,b}{a,b} + \abc{a,1}{a,1} + \abc{1,a}{1,a} + \hline\hline + \end{tabular} + \end{center} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{plus and minus} + \abc{+1}{+1} + \abc{-1}{-1} + \abc{++1}{++1} + \abc{+ +1}{+ +1} + \abc{+ + 1}{+ + 1} + \abc{1+2}{1+2} + \abc{1+ 2}{1+ 2} + \abc{1 +2}{1 +2} + \abc{1 + 2}{1 + 2} + \abc{1++2}{1++2} + \abc{x+1}{x+1} + \abc{1+x}{1+x} + \abc{x+y}{x+y} + \header{letter `e'} + \abc{1e1234}{1e1,234} + \abc{1e+1234}{1e+1,234} + \abc{1e.}{1e.} + \abc{1e,}{1e,} + \abc{1e.1234}{1e.123\,4} + \abc{1e,1234}{1e,1234} + \abc{1e++1234}{1e++1,234} + \abc{1e 1,234}{1e 1,234} + \abc{1e +1234}{1e +1,234} + \abc{1 e1,234}{1 e1,234} + \header{mixed numbers} + \abc{1.234,890}{1.234, {}\,890} + \abc{1,234.890}{1,234.890} + \abc{1234e5678}{1,234e5,678} + \abc{+1234e5678}{+1,234e5,678} + \abc{1234e+5678}{1,234e+5,678} + \abc{1.234e5.678}{1.234e5.678} + \abc{1,234e5,678}{1,234e5,678} + \header{single characters} + \abc{\sqrt 1}{\sqrt 1} + \abc{\sqrt 1234}{\sqrt 1,234} + \abc{\sqrt +}{\sqrt +} + \abc{\sqrt ++}{\sqrt ++} + \abc{\sqrt +1234}{\sqrt +1,234} + \abc{1e\sqrt +1234}{1e\sqrt +1,234} + \abc{1\sqrt +1234e0}{1\sqrt +1,234e0} + \hline\hline + \end{tabular} + \end{center} + + \clearpage + \section*{Options \texttt{exponent=rmE}} + \fileinfo + \ionumbersresetstyle + \ionumbersstyle{exponent=rmE} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{simple digits} + \abc{1}{1} + \abc{12}{12} + \abc{123}{123} + \abc{1234}{1234} + \abc{12345}{12345} + \abc{123456}{123456} + \abc{1234567}{1234567} + \header{point} + \abc{.1}{.1} + \abc{1.}{1.} + \abc{1.1}{1.1} + \abc{1. 2}{1. 2} + \abc{1 .2}{1 .2} + \abc{1.23456}{1.23456} + \abc{12345.6}{12345.6} + \abc{1.23.456}{1.23.456} + \abc{a.b}{a.b} + \abc{a.1}{a.1} + \abc{1.a}{1.a} + \header{comma} + \abc{,1}{,1} + \abc{1,}{1,} + \abc{1,1}{1,1} + \abc{1, 2}{1, 2} + \abc{1 ,2}{1 ,2} + \abc{1,23456}{1,23456} + \abc{12345,6}{12345,6} + \abc{1,23,456}{1,23,456} + \abc{a,b}{a,b} + \abc{a,1}{a,1} + \abc{1,a}{1,a} \hline\hline \end{tabular} - \end{minipage} + \end{center} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{plus and minus} + \abc{+1}{+1} + \abc{-1}{-1} + \abc{++1}{++1} + \abc{+ +1}{+ +1} + \abc{+ + 1}{+ + 1} + \abc{1+2}{1+2} + \abc{1+ 2}{1+ 2} + \abc{1 +2}{1 +2} + \abc{1 + 2}{1 + 2} + \abc{1++2}{1++2} + \abc{x+1}{x+1} + \abc{1+x}{1+x} + \abc{x+y}{x+y} + \header{letter `e'} + \abc{1e1234}{1\mathrm{E}{1234}} + \abc{1e+1234}{1\mathrm{E}{+1234}} + \abc{1e.}{1\mathrm{E}.} + \abc{1e,}{1\mathrm{E},} + \abc{1e.1234}{1\mathrm{E}{.1234}} + \abc{1e,1234}{1\mathrm{E}{,1234}} + \abc{1e++1234}{1\mathrm{E}{++1234}} + \abc{1e 1234}{1\mathrm{E} {1234}} + \abc{1e +1234}{1\mathrm{E} {+1234}} + \abc{1 e1234}{1 e1234} + \header{mixed numbers} + \abc{1.234,890}{1.234,890} + \abc{1,234.890}{1,234.890} + \abc{1234e5678}{1234\mathrm{E}{5678}} + \abc{+1234e5678}{+1234\mathrm{E}{5678}} + \abc{1234e+5678}{1234\mathrm{E}{+5678}} + \abc{1.234e5.678}{1.234\mathrm{E}{5.678}} + \abc{1,234e5,678}{1,234\mathrm{E}{5,678}} + \header{single characters} + \abc{\sqrt 1}{\sqrt 1} + \abc{\sqrt 1234}{\sqrt 1234} + \abc{\sqrt +}{\sqrt +} + \abc{\sqrt ++}{\sqrt ++} + \abc{\sqrt +1234}{\sqrt +1234} + \abc{\mbox{fails}}{\mbox{fails}} + \abc{1\sqrt +1234e0}{1\sqrt +1234\mathrm{E}{0}} + \hline\hline + \end{tabular} + \end{center} + + \clearpage + \section*{Options \texttt{exponent=timestento}} + \fileinfo + \ionumbersresetstyle + \ionumbersstyle{exponent=timestento} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{simple digits} + \abc{1}{1} + \abc{12}{12} + \abc{123}{123} + \abc{1234}{1234} + \abc{12345}{12345} + \abc{123456}{123456} + \abc{1234567}{1234567} + \header{point} + \abc{.1}{.1} + \abc{1.}{1.} + \abc{1.1}{1.1} + \abc{1. 2}{1. 2} + \abc{1 .2}{1 .2} + \abc{1.23456}{1.23456} + \abc{12345.6}{12345.6} + \abc{1.23.456}{1.23.456} + \abc{a.b}{a.b} + \abc{a.1}{a.1} + \abc{1.a}{1.a} + \header{comma} + \abc{,1}{,1} + \abc{1,}{1,} + \abc{1,1}{1,1} + \abc{1, 2}{1, 2} + \abc{1 ,2}{1 ,2} + \abc{1,23456}{1,23456} + \abc{12345,6}{12345,6} + \abc{1,23,456}{1,23,456} + \abc{a,b}{a,b} + \abc{a,1}{a,1} + \abc{1,a}{1,a} + \hline\hline + \end{tabular} + \end{center} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{plus and minus} + \abc{+1}{+1} + \abc{-1}{-1} + \abc{++1}{++1} + \abc{+ +1}{+ +1} + \abc{+ + 1}{+ + 1} + \abc{1+2}{1+2} + \abc{1+ 2}{1+ 2} + \abc{1 +2}{1 +2} + \abc{1 + 2}{1 + 2} + \abc{1++2}{1++2} + \abc{x+1}{x+1} + \abc{1+x}{1+x} + \abc{x+y}{x+y} + \header{letter `e'} + \abc{1e1234}{1\times 10\,^{1234}} + \abc{1e+1234}{1\times 10\,^{+1234}} + \abc{1e.}{1\times 10\,.} + \abc{1e,}{1\times 10\,,} + \abc{1e.1234}{1\times 10\,^{.1234}} + \abc{1e,1234}{1\times 10\,^{,1234}} + \abc{1e++1234}{1\times 10\,^{++1234}} + \abc{1e 1234}{1\times 10\,^ {1234}} + \abc{1e +1234}{1\times 10\,^ {+1234}} + \abc{1 e1234}{1 e1234} + \header{mixed numbers} + \abc{1.234,890}{1.234,890} + \abc{1,234.890}{1,234.890} + \abc{1234e5678}{1234\times 10\,^{5678}} + \abc{+1234e5678}{+1234\times 10\,^{5678}} + \abc{1234e+5678}{1234\times 10\,^{+5678}} + \abc{1.234e5.678}{1.234\times 10\,^{5.678}} + \abc{1,234e5,678}{1,234\times 10\,^{5,678}} + \header{single characters} + \abc{\sqrt 1}{\sqrt 1} + \abc{\sqrt 1234}{\sqrt 1234} + \abc{\sqrt +}{\sqrt +} + \abc{\sqrt ++}{\sqrt ++} + \abc{\sqrt +1234}{\sqrt +1234} + \abc{\mbox{fails}}{\mbox{fails}} + \abc{1\sqrt +1234e0}{1\sqrt +1234\times 10\,^{0}} + \hline\hline + \end{tabular} + \end{center} + + \clearpage + \section*{Options \texttt{comma=decimal,point=thousands}} + \fileinfo + \ionumbersresetstyle + \ionumbersstyle{comma=decimal,point=thousands} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{simple digits} + \abc{1}{1} + \abc{12}{12} + \abc{123}{123} + \abc{1234}{1234} + \abc{12345}{12345} + \abc{123456}{123456} + \abc{1234567}{1234567} + \header{point} + \abc{.1}{,1} + \abc{1.}{1.} + \abc{1.1}{1,1} + \abc{1. 2}{1. 2} + \abc{1 .2}{1 ,2} + \abc{1.23456}{1,23456} + \abc{12345.6}{12345,6} + \abc{1.23.456}{1,23,456} + \abc{a.b}{a.b} + \abc{a.1}{a,1} + \abc{1.a}{1.a} + \header{comma} + \abc{,1}{.1} + \abc{1,}{1,} + \abc{1,1}{1.1} + \abc{1, 2}{1, 2} + \abc{1 ,2}{1 .2} + \abc{1,23456}{1.23456} + \abc{12345,6}{12345.6} + \abc{1,23,456}{1.23.456} + \abc{a,b}{a,b} + \abc{a,1}{a.1} + \abc{1,a}{1,a} + \hline\hline + \end{tabular} + \end{center} + + \begin{center} + \begin{tabular}% + {r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r@{\hspace{1em}}r} + \hline\hline + input & \LaTeX{} & \textsf{ionumbers} & expected\\ + \hline\hline\\[-1ex] + \header{plus and minus} + \abc{+1}{+1} + \abc{-1}{-1} + \abc{++1}{++1} + \abc{+ +1}{+ +1} + \abc{+ + 1}{+ + 1} + \abc{1+2}{1+2} + \abc{1+ 2}{1+ 2} + \abc{1 +2}{1 +2} + \abc{1 + 2}{1 + 2} + \abc{1++2}{1++2} + \abc{x+1}{x+1} + \abc{1+x}{1+x} + \abc{x+y}{x+y} + \header{letter `e'} + \abc{1e1234}{1e1234} + \abc{1e+1234}{1e+1234} + \abc{1e.}{1e.} + \abc{1e,}{1e,} + \abc{1e.1234}{1e,1234} + \abc{1e,1234}{1e.1234} + \abc{1e++1234}{1e++1234} + \abc{1e 1234}{1e 1234} + \abc{1e +1234}{1e +1234} + \abc{1 e1234}{1 e1234} + \header{mixed numbers} + \abc{1.234,890}{1,234.890} + \abc{1,234.890}{1.234,890} + \abc{1234e5678}{1234e5678} + \abc{+1234e5678}{+1234e5678} + \abc{1234e+5678}{1234e+5678} + \abc{1.234e5.678}{1,234e5,678} + \abc{1,234e5,678}{1.234e5.678} + \header{single characters} + \abc{\sqrt 1}{\sqrt 1} + \abc{\sqrt 1234}{\sqrt 1234} + \abc{\sqrt +}{\sqrt +} + \abc{\sqrt ++}{\sqrt ++} + \abc{\sqrt +1234}{\sqrt +1234} + \abc{1e\sqrt +1234}{1e\sqrt +1234} + \abc{1\sqrt +1234e0}{1\sqrt +1234e0} + \hline\hline + \end{tabular} + \end{center} + \end{document} diff --git a/Master/texmf-dist/source/latex/ionumbers/Makefile b/Master/texmf-dist/source/latex/ionumbers/Makefile index 7f8740747b9..a0f196f3c16 100644 --- a/Master/texmf-dist/source/latex/ionumbers/Makefile +++ b/Master/texmf-dist/source/latex/ionumbers/Makefile @@ -21,13 +21,14 @@ # PACKAGE := ionumbers +TESTFILE := ionumbers_test PDFLATEX := pdflatex MAKEINDEX := makeindex -.PHONY: all pkg doc clean distclean +.PHONY: all pkg doc test clean distclean -all: pkg doc +all: pkg doc test %.sty: %.ins %.dtx $(RM) $@ @@ -42,17 +43,24 @@ all: pkg doc %.gls: %.glo $(MAKEINDEX) -s gglo.ist -o $@ $< -%.pdf: %.dtx %.sty %.ind %.gls +$(PACKAGE).pdf: %.pdf: %.dtx %.sty %.ind %.gls + $(PDFLATEX) -interaction=nonstopmode $< + $(PDFLATEX) -interaction=nonstopmode $< + $(PDFLATEX) -interaction=nonstopmode $< + +$(TESTFILE).pdf: %.pdf: %.tex $(PACKAGE).sty $(PDFLATEX) -interaction=nonstopmode $< $(PDFLATEX) -interaction=nonstopmode $< $(PDFLATEX) -interaction=nonstopmode $< pkg: $(PACKAGE).sty +test: $(TESTFILE).pdf + doc: $(PACKAGE).pdf clean: - $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc + $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *~ distclean: clean - $(RM) $(PACKAGE).sty $(PACKAGE).pdf + $(RM) $(PACKAGE).sty $(PACKAGE).pdf $(TESTFILE).pdf diff --git a/Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx b/Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx index 211237e341a..5f8717378ba 100644 --- a/Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx +++ b/Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx @@ -38,7 +38,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{ionumbers} -%<package> [2008/11/02 v0.2.1-alpha restyle numbers in math mode] +%<package> [2008/12/21 v0.2.3-alpha restyle numbers in math mode] %<*driver> \documentclass[a4paper]{ltxdoc} \usepackage{ionumbers} @@ -69,13 +69,20 @@ % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% \changes{v0.2.0-alpha}{2008/10/27}{Initial .dtx version} -% \changes{v0.2.1-alpha}{2008/11/02}{Replaced website by e-mail address in -% all fields containing contact information} +% \changes{v0.2.0-alpha}{2008/10/27}{initial .dtx version} +% \changes{v0.2.1-alpha}{2008/11/02}{replaced website by e-mail address in all +% fields containing contact information} +% \changes{v0.2.2-alpha}{2008/12/21}{fixed problem with single digit numbers +% without \{\}-grouping; conflict with \textsf{amsmath}/\textsf{amsopn} +% documented and handled with warning messages; thanks to Robert N\"{u}rnberg +% for reporting these two problems} +% \changes{v0.2.3-alpha}{2008/12/21}{saved one \texttt{\textbackslash if} and +% made sign/digit macros a bit clearer} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% \CheckSum{1096} +% %\CheckSum{1096} +% \CheckSum{0} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -113,7 +120,7 @@ % % \begin{center} % \large\textbf{\textsf{Warning: This is alpha software and may -% contain serious bugs!}} +% contain serious bugs! Use with caution and on your own risk! Check output!}} % \end{center} % % \tableofcontents @@ -139,17 +146,6 @@ % may be output as `$26\times10\,^{6}$'. % \end{abstract} % -% \section{Conflicts with other packages} -% -% This package potentially conflicts with any other package that defines a -% macro for any of the following characters: |.,+-0123456789| -% -% There are tests for these cases and warning or error messages may be output. -% Please load \textsf{ionumbers} as last package to be able to detect as -% many conflicts as possible. As there is no way to detect conflicts in all -% cases, please report any package known to conflict with -% \textsf{ionumbers} to the author. -% % \section{Details of number handling} % % \subsection{General rules} @@ -174,10 +170,12 @@ % % The lower case letter |e| plays a special role. An |e| following immediatly a % number (without any white space or other input in between) can be configured -% as begining of the exponential part of a number. The letter is eaten from the +% as begining of the exponential part. The letter |e| will be eaten from the % input in this case and substituted by some configurable output. (It is % virtually impossible to handle it the same way as the other and assigning a -% macro definition to |e|.) +% macro definition to |e|.) In this case the number following an |e| in the +% same group will be grouped with curly braces |{}|. This is important to +% understand, e.\,g., the spacing in cases when that number begins with a sign. % % \subsection{Caveats} % @@ -185,24 +183,61 @@ % begining of the thousandths part of a number; every part of a number % appearing left to the first decimal separator is the thousands part. That is % why, the input |$1.234.567$| with (only) the package option -% |autothousandths=true| (|.| is the thousands separator; option will be +% |autothousandths=true| (|.| is the decimal separator; option will be % explained later) will lead to `$1.234.\,567$' in the output. Note the small % space after the second point as a result of |234.567| being treated as % thousandths part. The thousandths separator---by default a small space---will % be output between the third and fourth digit of the thousandths part; the % additional point from the input will not be omitted. The input is % syntactically incorrect (there must not be two decimal separators in one -% number) and the output is \emph{not} a bug of this package. +% number) and the output is \emph{not} a bug. % % A number following an |e| treated as exponential part of a number may be % typeset as superscript (depending on the configuration). In the case of an % exponential part there \emph{may} be arbitrary input between |e| and the % number in the exponent. Especially, the input |$1e \Pi 2| with package option % |exponent=timestento| (will be explained later) leads to a superscript -% |2| in the output: `$1\times10\,\Pi^{2}$'. Again, the input is -% syntactically incorrect and there is no easy way to circumvent |e| from being -% treated as begining of the exponential part in this case (at least, I did not -% find it). +% |2| in the output. In some cases, e.\,g., |$1e \sqrt 2$| or |$1e^2$| with +% |e| configured as begining of the exponential part, even an error occurs. +% Again, the input is syntactically incorrect and there is no easy way to +% circumvent |e| from being treated as begining of the exponential part in these +% cases (at least, I did not find it). +% +% In some rare cases, e.\,g., |$\sqrt ,$| or |$a^.$|, the usage of point and +% comma without curly braces |{}| around them will lead to an error. In these +% cases please add curly braces |{}| around the point or comma. (The +% \textsf{ziffer} package has the same problem.) +% +% If you use, e.\,g., indexes consisting of four or more digits together with +% automatic grouping of thousands, the grouping will also apply to the +% indexes. So |a_{1234}| might be output as $a_{1,234}$. Possibilities to +% prevent undesired automatic grouping are on the one hand input as +% |a_{1 2 3 4}| (with a space after at least every third digit) or on the other +% hand selectively switching of automatic grouping (see below). +% +% \section{Conflicts with other packages} +% +% This package potentially conflicts with any other package that defines a +% macro for any of the following characters: |.,+-0123456789| +% +% There are tests for these cases and warning or error messages may be output. +% Please load \textsf{ionumbers} as \emph{last package} to be able to detect as +% many conflicts as possible. As there is no way to detect conflicts in any +% case, please report any package known to conflict with \textsf{ionumbers} to +% the author. +% +% Packages known to conflict with \textsf{ionumbers} are: +% \begin{mydescription} +% \item[\textsf{ziffer}] this package can be replaced by \textsf{ionumbers} +% except for \textsf{ziffer}'s special handling of |--| enabled by +% |\ZifferStrichAn| +% \item[\textsf{dcolumn}] workaround: disable \textsf{ionumbers} for tabulars +% (e.\,g., put them inside |\ionumbersoff|\marg{\ldots}) +% \item[\textsf{amsmath}/\textsf{amsopn}] load \textsf{ionumbers} as last +% package and disable \textsf{ionumbers} for |\operatorname|\marg{\ldots} +% (e.\,g., put it inside\\ +% |\ionumbersoff|\marg{\ldots}) +% \end{mydescription} % % \section{Usage} % @@ -218,8 +253,10 @@ % The following options configure the meaning of separators in the \LaTeX{} % input file: % \begin{mydescription} -% \item[\texttt{comma}=\meta{value}] comma `|,|' will be treated as \meta{value} -% \item[\texttt{point}=\meta{value}] point `|.|' will be treated as \meta{value} +% \item[\texttt{comma}=\meta{value}] comma `|,|' will be treated as +% \meta{value} +% \item[\texttt{point}=\meta{value}] point `|.|' will be treated as +% \meta{value} % \end{mydescription} % % The following \meta{value}s can be chosen for both of them: @@ -245,21 +282,26 @@ % the input file. The \emph{output} of the \emph{meanings} is configured via % the following options: % \begin{mydescription} -% \item[\texttt{thousands}=\meta{value}] thousands separator will be output as \meta{value} -% \item[\texttt{decimal}=\meta{value}] decimal separator will be output as \meta{value} -% \item[\texttt{thousandths}=\meta{value}] thousandths separator will be \meta{value} -% \item[\texttt{exponent}=\meta{value}] exponent separator will be output as \meta{value} +% \item[\texttt{thousands}=\meta{value}] thousands separator will be output as +% \meta{value} +% \item[\texttt{decimal}=\meta{value}] decimal separator will be output as +% \meta{value} +% \item[\texttt{thousandths}=\meta{value}] thousandths separator will be +% \meta{value} +% \item[\texttt{exponent}=\meta{value}] exponent separator will be output as +% \meta{value} % \end{mydescription} % -% The list of valid \meta{value}s for |thousands|, |decimal|, and |thousandths| is: +% The list of valid \meta{value}s for |thousands|, |decimal|, and |thousandths| +% is: % \begin{mydescription} % \item[\texttt{none}] will be ignored (no output) % \item[\texttt{point}] normal point; this is the default point without % \textsf{ionumbers} % \item[\texttt{comma}] normal comma % \item[\texttt{punctpoint}] punctuation point (point followed by small space) -% \item[\texttt{punctcomma}] punctuation comma (point followed by small space); -% this is the default comma without \textsf{ionumbers} +% \item[\texttt{punctcomma}] punctuation comma (point followed by small +% space); this is the default comma without \textsf{ionumbers} % \item[\texttt{apostrophe}] apostrophe (actually |$^\prime$|; \emph{not} for % |decimal|) % \item[\texttt{phantom}] space with width of a point (|$\phantom{.}$|; @@ -270,9 +312,16 @@ % |thousandths|) % \end{mydescription} % -% The list of valid \meta{value}s for |exponent| is: +% If a number is handled as exponent, it will be put into curly braces |{}| +% for correct output of, e.\,g., signs without spacing around them (mathord). +% In the following list of valid \meta{value}s for |exponent| a number +% immediatly following an |e| will be handled as exponent, unless specified +% otherwise: % \begin{mydescription} -% \item[\texttt{none}] will be ignored (no output) +% \item[\texttt{none}] will be ignored (not output; following number +% \emph{not} handled as exponent) +% \item[\texttt{original}] a simple character `e' (following number +% \emph{not} handled as exponent) % \item[\texttt{ite/itE}] italic lower/upper case letter `e' % \item[\texttt{rme/rmE}] roman lower/upper case letter `e' % \item[\texttt{timestento}] |$\times10\,$| with following number output as @@ -280,7 +329,7 @@ % \item[\texttt{cdottento}] |$\cdot10\,$| with following number output as % superscript % \item[\texttt{wedge}] |$^\wedge$| -% \item[\texttt{default}] default behaviour of \textsf{ionumbers} (|ite|) +% \item[\texttt{default}] default behaviour of \textsf{ionumbers} (|original|) % \end{mydescription} % % \subsection{Package options concerning automatic grouping} @@ -594,10 +643,11 @@ \newcommand*\renewionumbersexponent{% \@ifstar{\renewionumbersexponent@@}{\renewionumbersexponent@}} \newcommand*\renewionumbersexponent@[2]{\expandafter\renewcommand% - \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}}} + \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}% + \ion@currnum@exponent}} \newcommand*\renewionumbersexponent@@[2]{\expandafter\renewcommand% \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}% - \ion@exponent@superscripttrue}} + \ion@currnum@exponent\ion@exponent@superscripttrue}} % \end{macrocode} % \end{macro} % @@ -606,13 +656,23 @@ % \subsection{Internal macros holding definitions for \meta{key}=\meta{value} % pairs} % -% First of all, macros with the original character definitions of |.,+-| are -% defined. +% First of all, macros with the original character definitions are defined. % \begin{macrocode} \mathchardef\ion@point@original="013A \mathchardef\ion@comma@original="613B \mathchardef\ion@plus@original="202B \mathchardef\ion@minus@original="2200 +\mathchardef\ion@zero@original="7030 +\mathchardef\ion@one@original="7031 +\mathchardef\ion@two@original="7032 +\mathchardef\ion@three@original="7033 +\mathchardef\ion@four@original="7034 +\mathchardef\ion@five@original="7035 +\mathchardef\ion@six@original="7036 +\mathchardef\ion@seven@original="7037 +\mathchardef\ion@eight@original="7038 +\mathchardef\ion@nine@original="7039 +\mathchardef\ion@e@original="7165 % \end{macrocode} % % Here the |\ion@|\meta{key}|@|\meta{value} macros are defined, begining with @@ -692,14 +752,17 @@ % \ldots{} and the exponent output separator are given. % \begin{macrocode} \def\ion@exponent@none{} -\mathchardef\ion@exponent@ite="7165 -\mathchardef\ion@exponent@itE="7145 -\mathchardef\ion@exponent@rme="7065 -\mathchardef\ion@exponent@rmE="7045 -\def\ion@exponent@timestento{\times10\,\ion@exponent@superscripttrue} -\def\ion@exponent@cdottento{\cdot10\,\ion@exponent@superscripttrue} -\def\ion@exponent@wedge{^\wedge} -\def\ion@exponent@default{\ion@exponent@ite} +\def\ion@exponent@original{\ion@e@original} +\def\ion@exponent@ite{\mathchar"7165\ion@currnum@exponenttrue} +\def\ion@exponent@itE{\mathchar"7145\ion@currnum@exponenttrue} +\def\ion@exponent@rme{\mathchar"7065\ion@currnum@exponenttrue} +\def\ion@exponent@rmE{\mathchar"7045\ion@currnum@exponenttrue} +\def\ion@exponent@timestento{\times10\,\ion@currnum@exponenttrue% + \ion@exponent@superscripttrue} +\def\ion@exponent@cdottento{\cdot10\,\ion@currnum@exponenttrue% + \ion@exponent@superscripttrue} +\def\ion@exponent@wedge{^\wedge\ion@currnum@exponenttrue} +\def\ion@exponent@default{\ion@exponent@original} % \end{macrocode} % % --------------------------------------------------------------------- @@ -764,11 +827,11 @@ % % The macro definitions for the characters |.,+-0123456789| are hold in the % following macros. Number processing works by looking at the next character -% and performing on or more from the following actions: +% and performing one or more from the following actions: % \begin{itemize} % \item the currently configured output for the character will be added to -% the end of |\ion@comma@curr| by |\ion@currnum@pushback|; -% |\ion@comma@curr| stores the currently processed number +% the end of |\ion@currnum| by |\ion@currnum@append|; +% |\ion@currnum| stores the currently processed number % \item only for comma/point: the corresponding |after...| macro will be % issued % \item the currently processed number will be output via @@ -776,19 +839,20 @@ % \item the |e| will be eaten and replaced by its configured output % \end{itemize} % The conditions in the macro definitions should be self-explanatory for each -% character. -% +% character. The extra |\ion@startnumber| is required to avoid problems with +% input like |$a_0$| or |$\sqrt 2$|, where curly braces around |0| and |2| have +% been omitted. % \begin{macrocode} \def\ion@comma{% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@comma@curr}\ion@aftercomma@curr% + \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr% }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@comma@curr}\ion@aftercomma@curr% + \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr% \@warning{Too many separators}% }{% \ion@ifnextchar e{% - \ion@currnum@pushback*{\ion@comma@curr}\ion@aftercomma@curr% + \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr% \ion@currnum@output\ion@exponent@curr\@gobble% }{% \ion@currnum@output\ion@comma@original% @@ -798,14 +862,14 @@ } \def\ion@point{% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@point@curr}\ion@afterpoint@curr% + \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr% }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@point@curr}\ion@afterpoint@curr% + \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr% \@warning{Too many separators}% }{% \ion@ifnextchar e{% - \ion@currnum@pushback*{\ion@point@curr}\ion@afterpoint@curr% + \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr% \ion@currnum@output\ion@exponent@curr\@gobble% }{% \ion@currnum@output\ion@point@original% @@ -814,36 +878,51 @@ }% } \def\ion@plus{% + \ion@iffirstchar{% + \ion@plus@original% + }{% + \ion@currnum@append*{\ion@plus@original}% + }% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@plus@original}% + %% nothing }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@plus@original}% + %% nothing }{% \ion@ifnextsign{% - \ion@currnum@pushback*{\ion@plus@original}\@warning{Too many signs}% + \@warning{Too many signs}% }{% - \ion@currnum@output\ion@plus@original% + \ion@currnum@output% }% }% }% } \def\ion@minus{% + \ion@iffirstchar{% + \ion@minus@original% + }{% + \ion@currnum@append*{\ion@minus@original}% + }% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@minus@original}% + %% nothing }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@minus@original}% + %% nothing }{% \ion@ifnextsign{% - \ion@currnum@pushback*{\ion@minus@original}\@warning{Too many signs}% + \@warning{Too many signs}% }{% - \ion@currnum@output\ion@minus@original% + \ion@currnum@output% }% }% }% } -\def\ion@zero{\ion@currnum@pushback{\mathchar"7030}% +\def\ion@zero{% + \ion@iffirstchar{% + \ion@zero@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@zero@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -858,7 +937,12 @@ }% }% } -\def\ion@one{\ion@currnum@pushback{\mathchar"7031}% +\def\ion@one{% + \ion@iffirstchar{% + \ion@one@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@one@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -873,7 +957,12 @@ }% }% } -\def\ion@two{\ion@currnum@pushback{\mathchar"7032}% +\def\ion@two{% + \ion@iffirstchar{% + \ion@two@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@two@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -888,7 +977,12 @@ }% }% } -\def\ion@three{\ion@currnum@pushback{\mathchar"7033}% +\def\ion@three{% + \ion@iffirstchar{% + \ion@three@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@three@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -903,7 +997,12 @@ }% }% } -\def\ion@four{\ion@currnum@pushback{\mathchar"7034}% +\def\ion@four{% + \ion@iffirstchar{% + \ion@four@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@four@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -918,7 +1017,12 @@ }% }% } -\def\ion@five{\ion@currnum@pushback{\mathchar"7035}% +\def\ion@five{% + \ion@iffirstchar{% + \ion@five@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@five@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -933,7 +1037,12 @@ }% }% } -\def\ion@six{\ion@currnum@pushback{\mathchar"7036}% +\def\ion@six{% + \ion@iffirstchar{% + \ion@six@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@six@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -948,7 +1057,12 @@ }% }% } -\def\ion@seven{\ion@currnum@pushback{\mathchar"7037}% +\def\ion@seven{% + \ion@iffirstchar{% + \ion@seven@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@seven@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -963,7 +1077,12 @@ }% }% } -\def\ion@eight{\ion@currnum@pushback{\mathchar"7038}% +\def\ion@eight{% + \ion@iffirstchar{% + \ion@eight@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@eight@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -978,7 +1097,12 @@ }% }% } -\def\ion@nine{\ion@currnum@pushback{\mathchar"7039}% +\def\ion@nine{% + \ion@iffirstchar{% + \ion@nine@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@nine@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -1020,6 +1144,26 @@ \endgroup % \end{macrocode} % +% If one of |+-0123456789| is the first character of a number and this number +% not part of an exponent, then argument `1' will be used; otherwise argument +% `2' will be used. This macro is required to handle single characters not +% grouped in curly braces |{}| in expressions like |$a^0$| or |$\sqrt 2$| +% correctly. +% \begin{macrocode} +\def\ion@iffirstchar#1#2{% + \ifion@currnum@exponent% + #2% + \else% + \ifion@currnum@firstchar% + #1% + \else + #2% + \fi% + \fi% + \ion@currnum@firstcharfalse% +} +% \end{macrocode} +% % Now the macros for the conditions in the above definitions follow. There are % tests for a digit |0123456789|, \ldots % \begin{macrocode} @@ -1114,12 +1258,17 @@ Do not load both packages in the same document}{}}{}} \newcommand*{\ion@problem@package}[2]{% \@ifpackageloaded{#1}{\PackageWarning{ionumbers}% - {Loading #1 and ionumbers is\MessageBreak% - problematic!\MessageBreak% + {Loading #1 and ionumbers is problematic!\MessageBreak% #2}{}}} + \AtBeginDocument{% \ion@conflict@package{ziffer}% \ion@problem@package{dcolumn}{Use `tabular's inside \string\ionumbersoff}% + \ion@problem@package{amsmath}{Load ionumbers after amsmath}% + \ion@problem@package{amsmath}{Use \string\operatorname\space inside + \string\ionumbersoff}% + \ion@problem@package{amsopn}{Use \string\operatorname\space inside + \string\ionumbersoff}% } % \end{macrocode} % @@ -1196,8 +1345,8 @@ % internal macro to be able to automatically group digits. The basic idea when % adding single characters is % \begin{itemize} -% \item remember, whether we processing the thousands or the thousandths part -% of a number (|\ifion@beforedecimal|) +% \item remember, whether we are processing the thousands or the thousandths +% part of a number (|\ifion@beforedecimal|) % \item calculate the number of digits processed modulo 3 plus 1 in the % current part and % \begin{itemize} @@ -1215,8 +1364,10 @@ % % First of all, the |if|s, counters and empty separator macros are initialized. % \begin{macrocode} +\newif\ifion@currnum@firstchar\ion@currnum@firstchartrue \newif\ifion@beforedecimal\ion@beforedecimaltrue \newif\ifion@noexplicitthousands\ion@noexplicitthousandstrue +\newif\ifion@currnum@exponent\ion@currnum@exponentfalse \newif\ifion@exponent@superscript\ion@exponent@superscriptfalse \newcount\ion@thousands@currpos\ion@thousands@currpos=0 \newcount\ion@thousandths@currpos\ion@thousandths@currpos=0 @@ -1227,16 +1378,18 @@ \def\ion@thousandths@sep{} % \end{macrocode} % -% The macro |\ion@currnum@pushback| adds the character in its argument to -% the end of |\ion@currnum|. In the starred version adding an empty separator +% The macro |\ion@currnum@append| adds the character in its argument to the +% end of |\ion@currnum|. In the starred version adding of an empty separator % macros is omitted. % \begin{macrocode} -\newcommand{\ion@currnum@pushback}{\@ifstar{\ion@currnum@pushback@@}% - {\ion@currnum@pushback@}} -\newcommand*{\ion@currnum@pushback@@}[1]{% +\newcommand{\ion@currnum@append}{% + \ion@currnum@firstcharfalse% + \@ifstar{\ion@currnum@append@@}{\ion@currnum@append@}% +} +\newcommand*{\ion@currnum@append@@}[1]{% \ion@addto@macro{\ion@currnum}{#1}% } -\newcommand*{\ion@currnum@pushback@}[1]{% +\newcommand*{\ion@currnum@append@}[1]{% \ifion@beforedecimal% %% push back (empty) separator and character \ifcase\ion@thousands@currpos% @@ -1294,19 +1447,26 @@ \def\ion@thousandths@sep{\ion@thousandths@curr}% \fi% %% output number - \ifion@exponent@superscript% - ^{\ion@currnum}% - \else% + \ifion@currnum@exponent% + \ifion@exponent@superscript% + ^{\ion@currnum}% + \else% + {\ion@currnum}% + \fi% + \else \ion@currnum% - \fi% + \fi \endgroup% %% reset stuff for next number \ion@thousands@currpos=0% \ion@thousandths@currpos=0% \def\ion@currnum{}% + \ion@currnum@firstchartrue% \ion@beforedecimaltrue% \ion@noexplicitthousandstrue% - \ion@exponent@superscriptfalse} + \ion@currnum@exponentfalse% + \ion@exponent@superscriptfalse% +} % \end{macrocode} % % This macro is identical to |\l@addto@macro| from \textsf{koma-script bundle}. diff --git a/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty b/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty index 85ede742a19..b1580fdb04f 100644 --- a/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty +++ b/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{ionumbers} - [2008/11/02 v0.2.1-alpha restyle numbers in math mode] + [2008/12/21 v0.2.3-alpha restyle numbers in math mode] \RequirePackage{keyval} \newif\ifion@autothousands \newif\ifion@autothousandths @@ -113,14 +113,26 @@ \newcommand*\renewionumbersexponent{% \@ifstar{\renewionumbersexponent@@}{\renewionumbersexponent@}} \newcommand*\renewionumbersexponent@[2]{\expandafter\renewcommand% - \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}}} + \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}% + \ion@currnum@exponent}} \newcommand*\renewionumbersexponent@@[2]{\expandafter\renewcommand% \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}% - \ion@exponent@superscripttrue}} + \ion@currnum@exponent\ion@exponent@superscripttrue}} \mathchardef\ion@point@original="013A \mathchardef\ion@comma@original="613B \mathchardef\ion@plus@original="202B \mathchardef\ion@minus@original="2200 +\mathchardef\ion@zero@original="7030 +\mathchardef\ion@one@original="7031 +\mathchardef\ion@two@original="7032 +\mathchardef\ion@three@original="7033 +\mathchardef\ion@four@original="7034 +\mathchardef\ion@five@original="7035 +\mathchardef\ion@six@original="7036 +\mathchardef\ion@seven@original="7037 +\mathchardef\ion@eight@original="7038 +\mathchardef\ion@nine@original="7039 +\mathchardef\ion@e@original="7165 \def\ion@comma@ignore{} \def\ion@comma@decimal{\ion@decimal@curr} \def\ion@comma@thousands{\ion@thousands@curr} @@ -161,14 +173,17 @@ \def\ion@thousandths@space{\,} \def\ion@thousandths@default{\ion@thousandths@space} \def\ion@exponent@none{} -\mathchardef\ion@exponent@ite="7165 -\mathchardef\ion@exponent@itE="7145 -\mathchardef\ion@exponent@rme="7065 -\mathchardef\ion@exponent@rmE="7045 -\def\ion@exponent@timestento{\times10\,\ion@exponent@superscripttrue} -\def\ion@exponent@cdottento{\cdot10\,\ion@exponent@superscripttrue} -\def\ion@exponent@wedge{^\wedge} -\def\ion@exponent@default{\ion@exponent@ite} +\def\ion@exponent@original{\ion@e@original} +\def\ion@exponent@ite{\mathchar"7165\ion@currnum@exponenttrue} +\def\ion@exponent@itE{\mathchar"7145\ion@currnum@exponenttrue} +\def\ion@exponent@rme{\mathchar"7065\ion@currnum@exponenttrue} +\def\ion@exponent@rmE{\mathchar"7045\ion@currnum@exponenttrue} +\def\ion@exponent@timestento{\times10\,\ion@currnum@exponenttrue% + \ion@exponent@superscripttrue} +\def\ion@exponent@cdottento{\cdot10\,\ion@currnum@exponenttrue% + \ion@exponent@superscripttrue} +\def\ion@exponent@wedge{^\wedge\ion@currnum@exponenttrue} +\def\ion@exponent@default{\ion@exponent@original} \def\ion@separators@active{\catcode`\,=\active\catcode`\.=\active\relax} \def\ion@signs@active{\catcode`\+=\active\catcode`\-=\active\relax} \def\ion@digits@active{\catcode`\,=\active\catcode`\.=\active% @@ -194,14 +209,14 @@ \AtBeginDocument{\ionumbers} \def\ion@comma{% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@comma@curr}\ion@aftercomma@curr% + \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr% }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@comma@curr}\ion@aftercomma@curr% + \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr% \@warning{Too many separators}% }{% \ion@ifnextchar e{% - \ion@currnum@pushback*{\ion@comma@curr}\ion@aftercomma@curr% + \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr% \ion@currnum@output\ion@exponent@curr\@gobble% }{% \ion@currnum@output\ion@comma@original% @@ -211,14 +226,14 @@ } \def\ion@point{% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@point@curr}\ion@afterpoint@curr% + \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr% }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@point@curr}\ion@afterpoint@curr% + \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr% \@warning{Too many separators}% }{% \ion@ifnextchar e{% - \ion@currnum@pushback*{\ion@point@curr}\ion@afterpoint@curr% + \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr% \ion@currnum@output\ion@exponent@curr\@gobble% }{% \ion@currnum@output\ion@point@original% @@ -227,36 +242,51 @@ }% } \def\ion@plus{% + \ion@iffirstchar{% + \ion@plus@original% + }{% + \ion@currnum@append*{\ion@plus@original}% + }% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@plus@original}% + %% nothing }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@plus@original}% + %% nothing }{% \ion@ifnextsign{% - \ion@currnum@pushback*{\ion@plus@original}\@warning{Too many signs}% + \@warning{Too many signs}% }{% - \ion@currnum@output\ion@plus@original% + \ion@currnum@output% }% }% }% } \def\ion@minus{% + \ion@iffirstchar{% + \ion@minus@original% + }{% + \ion@currnum@append*{\ion@minus@original}% + }% \ion@ifnextdigit{% - \ion@currnum@pushback*{\ion@minus@original}% + %% nothing }{% \ion@ifnextseparator{% - \ion@currnum@pushback*{\ion@minus@original}% + %% nothing }{% \ion@ifnextsign{% - \ion@currnum@pushback*{\ion@minus@original}\@warning{Too many signs}% + \@warning{Too many signs}% }{% - \ion@currnum@output\ion@minus@original% + \ion@currnum@output% }% }% }% } -\def\ion@zero{\ion@currnum@pushback{\mathchar"7030}% +\def\ion@zero{% + \ion@iffirstchar{% + \ion@zero@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@zero@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -271,7 +301,12 @@ }% }% } -\def\ion@one{\ion@currnum@pushback{\mathchar"7031}% +\def\ion@one{% + \ion@iffirstchar{% + \ion@one@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@one@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -286,7 +321,12 @@ }% }% } -\def\ion@two{\ion@currnum@pushback{\mathchar"7032}% +\def\ion@two{% + \ion@iffirstchar{% + \ion@two@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@two@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -301,7 +341,12 @@ }% }% } -\def\ion@three{\ion@currnum@pushback{\mathchar"7033}% +\def\ion@three{% + \ion@iffirstchar{% + \ion@three@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@three@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -316,7 +361,12 @@ }% }% } -\def\ion@four{\ion@currnum@pushback{\mathchar"7034}% +\def\ion@four{% + \ion@iffirstchar{% + \ion@four@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@four@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -331,7 +381,12 @@ }% }% } -\def\ion@five{\ion@currnum@pushback{\mathchar"7035}% +\def\ion@five{% + \ion@iffirstchar{% + \ion@five@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@five@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -346,7 +401,12 @@ }% }% } -\def\ion@six{\ion@currnum@pushback{\mathchar"7036}% +\def\ion@six{% + \ion@iffirstchar{% + \ion@six@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@six@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -361,7 +421,12 @@ }% }% } -\def\ion@seven{\ion@currnum@pushback{\mathchar"7037}% +\def\ion@seven{% + \ion@iffirstchar{% + \ion@seven@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@seven@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -376,7 +441,12 @@ }% }% } -\def\ion@eight{\ion@currnum@pushback{\mathchar"7038}% +\def\ion@eight{% + \ion@iffirstchar{% + \ion@eight@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@eight@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -391,7 +461,12 @@ }% }% } -\def\ion@nine{\ion@currnum@pushback{\mathchar"7039}% +\def\ion@nine{% + \ion@iffirstchar{% + \ion@nine@original\ion@currnum@append{}% + }{% + \ion@currnum@append{\ion@nine@original}% + }% \ion@ifnextdigit{% %% nothing }{% @@ -425,6 +500,18 @@ \global\let9=\ion@nine% } \endgroup +\def\ion@iffirstchar#1#2{% + \ifion@currnum@exponent% + #2% + \else% + \ifion@currnum@firstchar% + #1% + \else + #2% + \fi% + \fi% + \ion@currnum@firstcharfalse% +} \long\def\ion@ifnextdigit#1#2{% \def\reserved@a{#1}% \def\reserved@b{#2}% @@ -492,12 +579,17 @@ Do not load both packages in the same document}{}}{}} \newcommand*{\ion@problem@package}[2]{% \@ifpackageloaded{#1}{\PackageWarning{ionumbers}% - {Loading #1 and ionumbers is\MessageBreak% - problematic!\MessageBreak% + {Loading #1 and ionumbers is problematic!\MessageBreak% #2}{}}} + \AtBeginDocument{% \ion@conflict@package{ziffer}% \ion@problem@package{dcolumn}{Use `tabular's inside \string\ionumbersoff}% + \ion@problem@package{amsmath}{Load ionumbers after amsmath}% + \ion@problem@package{amsmath}{Use \string\operatorname\space inside + \string\ionumbersoff}% + \ion@problem@package{amsopn}{Use \string\operatorname\space inside + \string\ionumbersoff}% } \newcommand*\ion@conflict@definedtest[1]{% \ifx#1\@undefined\else\PackageWarning{ionumbers}% @@ -547,8 +639,10 @@ } \endgroup \AtBeginDocument{\ion@conflict@redefinedtest@macro} +\newif\ifion@currnum@firstchar\ion@currnum@firstchartrue \newif\ifion@beforedecimal\ion@beforedecimaltrue \newif\ifion@noexplicitthousands\ion@noexplicitthousandstrue +\newif\ifion@currnum@exponent\ion@currnum@exponentfalse \newif\ifion@exponent@superscript\ion@exponent@superscriptfalse \newcount\ion@thousands@currpos\ion@thousands@currpos=0 \newcount\ion@thousandths@currpos\ion@thousandths@currpos=0 @@ -557,12 +651,14 @@ \def\ion@thousands@sepb{} \def\ion@thousands@sepc{} \def\ion@thousandths@sep{} -\newcommand{\ion@currnum@pushback}{\@ifstar{\ion@currnum@pushback@@}% - {\ion@currnum@pushback@}} -\newcommand*{\ion@currnum@pushback@@}[1]{% +\newcommand{\ion@currnum@append}{% + \ion@currnum@firstcharfalse% + \@ifstar{\ion@currnum@append@@}{\ion@currnum@append@}% +} +\newcommand*{\ion@currnum@append@@}[1]{% \ion@addto@macro{\ion@currnum}{#1}% } -\newcommand*{\ion@currnum@pushback@}[1]{% +\newcommand*{\ion@currnum@append@}[1]{% \ifion@beforedecimal% %% push back (empty) separator and character \ifcase\ion@thousands@currpos% @@ -614,19 +710,26 @@ \def\ion@thousandths@sep{\ion@thousandths@curr}% \fi% %% output number - \ifion@exponent@superscript% - ^{\ion@currnum}% - \else% + \ifion@currnum@exponent% + \ifion@exponent@superscript% + ^{\ion@currnum}% + \else% + {\ion@currnum}% + \fi% + \else \ion@currnum% - \fi% + \fi \endgroup% %% reset stuff for next number \ion@thousands@currpos=0% \ion@thousandths@currpos=0% \def\ion@currnum{}% + \ion@currnum@firstchartrue% \ion@beforedecimaltrue% \ion@noexplicitthousandstrue% - \ion@exponent@superscriptfalse} + \ion@currnum@exponentfalse% + \ion@exponent@superscriptfalse% +} \newcommand{\ion@addto@macro}[2]{% \begingroup\toks@\expandafter{#1#2}% \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}% |