From f853d14edaf7b35865289ce85961df9790cf91e9 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Wed, 3 Aug 2011 13:06:34 +0000 Subject: ionumbers 2011/06/15 v0.3.1-alpha git-svn-id: svn://tug.org/texlive/trunk@23380 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ionumbers/Makefile | 82 ++++++++ Master/texmf-dist/doc/latex/ionumbers/README | 27 ++- .../texmf-dist/doc/latex/ionumbers/ionumbers.pdf | Bin 221782 -> 380424 bytes .../doc/latex/ionumbers/ionumbers_test.pdf | Bin 62211 -> 120411 bytes .../doc/latex/ionumbers/ionumbers_test.tex | 209 ++++++++++++++++++++- Master/texmf-dist/source/latex/ionumbers/Makefile | 66 ------- .../source/latex/ionumbers/ionumbers.dtx | 120 ++++++++++-- .../texmf-dist/tex/latex/ionumbers/ionumbers.sty | 77 +++++++- 8 files changed, 484 insertions(+), 97 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/ionumbers/Makefile delete mode 100644 Master/texmf-dist/source/latex/ionumbers/Makefile (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/ionumbers/Makefile b/Master/texmf-dist/doc/latex/ionumbers/Makefile new file mode 100644 index 00000000000..caef2d61f8d --- /dev/null +++ b/Master/texmf-dist/doc/latex/ionumbers/Makefile @@ -0,0 +1,82 @@ +# +# Makefile for ionumbers package +# +# Copyright 2008,2011 Christian Schneider +# +# This file is part of ionumbers. +# +# ionumbers is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation, not any later version. +# +# ionumbers is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with ionumbers. If not, see . +# +# WARNING: THIS IS ALPHA SOFTWARE AND MAY CONTAIN SERIOUS BUGS! +# + +PACKAGE := ionumbers +TESTFILE := ionumbers_test + +PDFLATEX := pdflatex +MAKEINDEX := makeindex + +# installation directories +DESTDIR := $(HOME)/.texmf +DOCDIR := $(DESTDIR)/doc/latex/$(PACKAGE) +SRCDIR := $(DESTDIR)/source/latex/$(PACKAGE) +TEXDIR := $(DESTDIR)/tex/latex/$(PACKAGE) + +.PHONY: all pkg doc test install clean distclean force + +all: pkg doc test + +%.sty: %.ins %.dtx + $(RM) $@ + $(PDFLATEX) -interaction=nonstopmode $< + +%.idx %.glo: %.dtx %.sty + $(PDFLATEX) -interaction=nonstopmode $< + +%.ind: %.idx + $(MAKEINDEX) -s gind.ist -o $@ $< + +%.gls: %.glo + $(MAKEINDEX) -s gglo.ist -o $@ $< + +$(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 + +install: force + mkdir -p $(DOCDIR) $(SRCDIR) $(TEXDIR) + install -m 644 README COPYING $(PACKAGE).pdf $(TESTFILE).pdf $(DOCDIR) + install -m 644 $(PACKAGE).ins $(PACKAGE).dtx $(TESTFILE).tex Makefile \ + $(SRCDIR) + install -m 644 $(PACKAGE).sty $(TEXDIR) + mktexlsr $(DESTDIR) + +clean: force + $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *~ + +distclean: clean force + $(RM) $(PACKAGE).sty $(PACKAGE).pdf $(TESTFILE).pdf + +force: ; diff --git a/Master/texmf-dist/doc/latex/ionumbers/README b/Master/texmf-dist/doc/latex/ionumbers/README index 9cff6047b65..e393af7fc79 100644 --- a/Master/texmf-dist/doc/latex/ionumbers/README +++ b/Master/texmf-dist/doc/latex/ionumbers/README @@ -14,9 +14,11 @@ conventions without the need of changing the table. Furthermore this package can automatically group digits left to the decimal separator (\emph{thousands}) and right to the decimal separator -(\emph{thousandths}) in triplets without the need of specifing commas -(English) or points (German) as separators. E.g., the input |$1234.567890$| -can be output as `$1\,234.\,567\,890$'. +(\emph{thousandths}) without the need of specifing commas (English) or +points (German) as separators. E.g., the input |$1234.567890$| can be +output as `$1\,234.\,567\,890$'. By default, thousands/thousandths are +grouped in triplets, but the grouping length is configurable, which is +useful for numerical data. Finally, an |e| starts the exponent of the number. For example, |$21e6$| may be output as `$26\times10\,^{6}$'. @@ -67,12 +69,27 @@ Optionally you can compile the test file: INSTALLATION ============ -Copy the file `ionumbers.sty' to a directory, where LaTeX will find it. +1) Installing with make +----------------------- + +To install the package into a TDS (= TeX directory structure; typically its base +directory is named `texmf' or something similar), run the following command: + $ make DESTDIR= install + +Note: `$(DESTDIR)' defaults to `$(HOME)/.texmf'. + +2) Installing manually +---------------------- + +In principle, you will only habe to copy the file `ionumbers.sty' into a +directory, where LaTeX can find it. If you copy it into a TDS (TeX directory +structure), you will most probably have to run the following command afterwards: + $ mktexlsr LICENSE ======= -Copyright 2007-2009 Christian Schneider +Copyright 2007--2009,2011 Christian Schneider idea and parts of this package based on: ziffer.sty v2.1 Copyright Martin Vaeth diff --git a/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf b/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf index c8cd38adccd..6f25e5a1684 100644 Binary files a/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf and b/Master/texmf-dist/doc/latex/ionumbers/ionumbers.pdf differ diff --git a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf index 3aab6e8cb9f..42518288bb3 100644 Binary files a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf and b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.pdf differ diff --git a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex index 304a7992023..277e4e7e3d9 100644 --- a/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex +++ b/Master/texmf-dist/doc/latex/ionumbers/ionumbers_test.tex @@ -2,7 +2,7 @@ % % test file for ionumbers package % -% Copyright 2008 Christian Schneider +% Copyright 2008,2011 Christian Schneider % % This file is part of ionumbers. % @@ -53,10 +53,10 @@ 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. + Note that a lot of input is nonsense and serves for testing purposes only. \vspace{2ex}\noindent } @@ -260,6 +260,108 @@ \end{tabular} \end{center} + \clearpage + \section*{Options \texttt{autothousands=true,autothousandths=true,}\\ + \texttt{grplenthousands=2,grplenthousandths=4}} + \enlargethispage{3ex} + \fileinfo + \ionumbersresetstyle + \ionumbersstyle{autothousands,autothousandths,grplenthousands=2,% + grplenthousandths=4} + + \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}{1,23} + \abc{1234}{12,34} + \abc{12345}{1,23,45} + \abc{123456}{12,34,56} + \abc{1234567}{1,23,45,67} + \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.2345\,6} + \abc{12345.6}{1,23,45.6} + \abc{1.23.456}{1.23.45\,6} + \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}{1e12,34} + \abc{1e+1234}{1e+12,34} + \abc{1e.}{1e.} + \abc{1e,}{1e,} + \abc{1e.1234}{1e.1234} + \abc{1e,1234}{1e,1234} + \abc{1e++1234}{1e++12,34} + \abc{1e 1,234}{1e 1,234} + \abc{1e +1234}{1e +12,34} + \abc{1 e1,234}{1 e1,234} + \header{mixed numbers} + \abc{1.234,890}{1.234,8\,90} + \abc{1,234.890}{1,234.890} + \abc{1234e5678}{12,34e56,78} + \abc{+1234e5678}{+12,34e56,78} + \abc{1234e+5678}{12,34e+56,78} + \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 12,34} + \abc{\sqrt +}{\sqrt +} + \abc{\sqrt ++}{\sqrt ++} + \abc{\sqrt +1234}{\sqrt +12,34} + \abc{1e\sqrt +1234}{1e\sqrt +12,34} + \abc{1\sqrt +1234e0}{1\sqrt +12,34e0} + \hline\hline + \end{tabular} + \end{center} + \clearpage \section*{Options \texttt{exponent=rmE}} \fileinfo @@ -557,4 +659,107 @@ \end{tabular} \end{center} + \clearpage + \section*{Options \texttt{comma=decimal,point=thousands,}\\ + \texttt{autothousands,autothousandths,thousands=apostrophe}\\ + \texttt{thousandths=phantom}} + \enlargethispage{6ex} + \fileinfo + \ionumbersresetstyle + \ionumbersstyle{comma=decimal,point=thousands,autothousands,autothousandths,% + thousands=apostrophe,thousandths=phantom} + + \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'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.234\phantom{.}56} + \abc{12345,6}{12'345.6} + \abc{1,23,456}{1.23.4\phantom{.}56} + \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'1234} + \abc{1e,1234}{1e.123\phantom{.}4} + \abc{1e++1234}{1e++1'234} + \abc{1e 1234}{1e 1'234} + \abc{1e +1234}{1e +1'234} + \abc{1 e1234}{1 e1'234} + \header{mixed numbers} + \abc{1.234,890}{1'234.890} + \abc{1,234.890}{1.234'\phantom{.}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} + \end{document} diff --git a/Master/texmf-dist/source/latex/ionumbers/Makefile b/Master/texmf-dist/source/latex/ionumbers/Makefile deleted file mode 100644 index a0f196f3c16..00000000000 --- a/Master/texmf-dist/source/latex/ionumbers/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# -# Makefile for ionumbers package -# -# Copyright 2008 Christian Schneider -# -# This file is part of ionumbers. -# -# ionumbers is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation, not any later version. -# -# ionumbers is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with ionumbers. If not, see . -# -# WARNING: THIS IS ALPHA SOFTWARE AND MAY CONTAIN SERIOUS BUGS! -# - -PACKAGE := ionumbers -TESTFILE := ionumbers_test - -PDFLATEX := pdflatex -MAKEINDEX := makeindex - -.PHONY: all pkg doc test clean distclean - -all: pkg doc test - -%.sty: %.ins %.dtx - $(RM) $@ - $(PDFLATEX) -interaction=nonstopmode $< - -%.idx %.glo: %.dtx %.sty - $(PDFLATEX) -interaction=nonstopmode $< - -%.ind: %.idx - $(MAKEINDEX) -s gind.ist -o $@ $< - -%.gls: %.glo - $(MAKEINDEX) -s gglo.ist -o $@ $< - -$(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 *~ - -distclean: clean - $(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 9fbe7d8ac89..69982d19fec 100644 --- a/Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx +++ b/Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx @@ -3,7 +3,7 @@ % % DocStrip file for ionumbers package % -% Copyright 2007-2009 Christian Schneider +% Copyright 2007-2009,2011 Christian Schneider % % idea and parts of this package based on: ziffer.sty v2.1 % Copyright Martin Vaeth @@ -38,7 +38,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ionumbers} -% [2009/07/18 v0.2.4-alpha restyle numbers in math mode] +% [2011/06/15 v0.3.1-alpha restyle numbers in math mode] %<*driver> \documentclass[a4paper]{ltxdoc} \usepackage{ionumbers} @@ -81,11 +81,13 @@ % \changes{v0.2.4-alpha}{2009/07/18}{fixed bug with curly braces in % \texttt{\textbackslash ion@problem@package} macro; thanks to Lars for % reporting this problem} +% \changes{v0.3.0-alpha}{2011/06/09}{added options for variable grouping +% lengths; extended \LaTeX{} test file} +% \changes{v0.3.1-alpha}{2011/06/15}{fix in Makefile of package} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% %\CheckSum{0} -% \CheckSum{1192} +% \CheckSum{1303} % % \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 @@ -116,7 +118,8 @@ % % \title{The \textsf{ionumbers} package\thanks{This document corresponds % to \textsf{ionumbers}~\fileversion, dated~\filedate. Copyright -% 2007-2009 Christian Schneider \texttt{}.}} +% 2007--2009,2011 Christian Schneider +% \texttt{}.}} % \author{Christian Schneider\\ \texttt{}} % % \maketitle @@ -141,9 +144,11 @@ % % Furthermore this package can automatically group digits left to the decimal % separator (\emph{thousands}) and right to the decimal separator -% (\emph{thousandths}) in triplets without the need of specifing commas -% (English) or points (German) as separators. E.g., the input |$1234.567890$| -% can be output as `$1\,234.\,567\,890$'. +% (\emph{thousandths}) without the need of specifing commas (English) or +% points (German) as separators. E.g., the input |$1234.567890$| can be +% output as `$1\,234.\,567\,890$'. By default, thousands/thousandths are +% grouped in triplets, but the grouping length is configurable, which is +% useful for numerical data. % % Finally, an |e| starts the exponent of the number. For example, |$21e6$| % may be output as `$26\times10\,^{6}$'. @@ -339,8 +344,9 @@ % \label{sec:auto} % % Automatic grouping is a feature that automatically adds the thousands and -% thousandths separator, respectively. The separator will be added after each -% triplet of digits. Automatic grouping can be enable or disabled with the +% thousandths separator, respectively. The separator will by default be added +% after each triplet of digits, but this may be changed (see below). Automatic +% grouping can be enable or disabled with the % following options: % \begin{mydescription} % \item[\texttt{autothousands}=\meta{value}] automatic grouping of thousands @@ -349,6 +355,15 @@ % thousandths (digits right to decimal separator) % \end{mydescription} % +% The grouping length for the thousands and thousandths, respectively, can be +% changed be the following options: +% \begin{mydescription} +% \item[\texttt{grplenthousands}=\meta{number}] group lengths for thousands +% (\meta{number} must be smaller than |10|; defaults to |3|) +% \item[\texttt{grplenthousandths}=\meta{number}] group lengths for thousandths +% (\meta{number} must be smaller than |10|; defaults to |3|) +% \end{mydescription} +% % The available \meta{value}s are |true| and |false| (default). % % Notes on automatic grouping: @@ -484,10 +499,23 @@ % |\ion@|\meta{key}|@reset| to be |\ion@|\meta{key}|@|\meta{value}. % % The following |if|s will be required to remember, if automatic grouping is -% enabled. +% enabled. The counts will be required for the grouping lengths. % \begin{macrocode} \newif\ifion@autothousands \newif\ifion@autothousandths +\newcount\ion@grplenthousands +\newcount\ion@grplenthousandths +% \end{macrocode} +% +% The next macro will be used for syntax checks of numerical arguments. +% \begin{macrocode} +\newcommand*{\ion@grplencheck}[1]{% + \ifnum#1>9% + \PackageError{ionumbers}% + {Group length argument too large (#1).\MessageBreak% + Grouping lengths must be smaller than 10.}{}% + \fi% +} % \end{macrocode} % % These shorthands are used to define the \meta{key}s for package options @@ -517,6 +545,12 @@ \csname ion@autothousands#1\endcsname}\ion@autothousandsreset} \ion@defpackopts{autothousandths}[true]{\def\ion@autothousandthsreset{% \csname ion@autothousandths#1\endcsname}\ion@autothousandthsreset} +\ion@defpackopts{grplenthousands}{\ion@grplencheck{#1}% + \def\ion@grplenthousandsreset{\ion@grplenthousands=#1}% + \ion@grplenthousandsreset} +\ion@defpackopts{grplenthousandths}{\ion@grplencheck{#1}% + \def\ion@grplenthousandthsreset{\ion@grplenthousandths=#1}% + \ion@grplenthousandthsreset} % \end{macrocode} % % Finally, the default \meta{value}s are set and---if specified by the user as @@ -524,7 +558,7 @@ % \begin{macrocode} \ion@setpackopts{comma=default,point=default,thousands=default,% decimal=default,thousandths=default,exponent=default,autothousands=false,% - autothousandths=false} + autothousandths=false,grplenthousands=3,grplenthousandths=3} \DeclareOption*{\expandafter\ion@setpackopts\expandafter{\CurrentOption}} \ProcessOptions\relax % \end{macrocode} @@ -568,6 +602,26 @@ \csname ion@exponent@#1\endcsname}} \ion@deflocopts{autothousands}[true]{\csname ion@autothousands#1\endcsname} \ion@deflocopts{autothousandths}[true]{\csname ion@autothousandths#1\endcsname} +\ion@deflocopts{grplenthousands}{% + \def\@tempa{#1}% + \def\@tempb{reset}% + \ifx\@tempa\@tempb% + \ion@grplenthousandsreset% + \else% + \ion@grplencheck{#1}% + \ion@grplenthousands=#1% + \fi% +} +\ion@deflocopts{grplenthousandths}{% + \def\@tempa{#1}% + \def\@tempb{reset}% + \ifx\@tempa\@tempb% + \ion@grplenthousandthsreset% + \else% + \ion@grplencheck{#1}% + \ion@grplenthousandths=#1% + \fi% +} % \end{macrocode} % % Finally, the command for resetting all \meta{key}s is defined. @@ -576,7 +630,7 @@ \newcommand*\ionumbersresetstyle{% \ionumbersstyle{comma=reset,point=reset,thousands=reset,% decimal=reset,thousandths=reset,exponent=reset,autothousands=reset,% - autothousandths=reset}} + autothousandths=reset,grplenthousands=reset,grplenthousandths=reset}} % \end{macrocode} % \end{macro} % This command is issued at the end of the package to make the configuration @@ -1359,8 +1413,8 @@ % current part and % \begin{itemize} % \item for the thousands part: add |\ion@thousands@sepa| for 1, -% |\ion@thousands@sepb| for 2, and |\ion@thousands@sepc| for 3 after -% a digit +% |\ion@thousands@sepb| for 2, |\ion@thousands@sepc| for 3, \ldots{} +% after a digit % \item for the thousandths part: add |\ion@thousandths@sep| after each % third digit % \end{itemize} @@ -1383,6 +1437,12 @@ \def\ion@thousands@sepa{} \def\ion@thousands@sepb{} \def\ion@thousands@sepc{} +\def\ion@thousands@sepd{} +\def\ion@thousands@sepe{} +\def\ion@thousands@sepf{} +\def\ion@thousands@sepg{} +\def\ion@thousands@seph{} +\def\ion@thousands@sepi{} \def\ion@thousandths@sep{} % \end{macrocode} % @@ -1408,22 +1468,34 @@ \ion@addto@macro{\ion@currnum}{\ion@thousands@sepb#1}% \or% \ion@addto@macro{\ion@currnum}{\ion@thousands@sepc#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepd#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepe#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepf#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepg#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@seph#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepi#1}% \fi% %% advance thousands counter \advance\ion@thousands@currpos by1\relax% - \ifnum\ion@thousands@currpos>3% + \ifnum\ion@thousands@currpos>\ion@grplenthousands% \ion@thousands@currpos=1% \fi% \else% %% push back (empty) separator and character - \ifnum\ion@thousandths@currpos=3% + \ifnum\ion@thousandths@currpos=\ion@grplenthousandths% \ion@addto@macro{\ion@currnum}{\ion@thousandths@sep#1}% \else% \ion@addto@macro{\ion@currnum}{#1}% \fi% %% advance thousandths counter \advance\ion@thousandths@currpos by1\relax% - \ifnum\ion@thousandths@currpos>3% + \ifnum\ion@thousandths@currpos>\ion@grplenthousandths% \ion@thousandths@currpos=1% \fi% \fi% @@ -1447,6 +1519,18 @@ \def\ion@thousands@sepb{\ion@thousands@curr}% \or% \def\ion@thousands@sepc{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepd{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepe{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepf{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepg{\ion@thousands@curr}% + \or% + \def\ion@thousands@seph{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepi{\ion@thousands@curr}% \fi% \fi% \fi% diff --git a/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty b/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty index 9aff9a3e856..90242c8c834 100644 --- a/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty +++ b/Master/texmf-dist/tex/latex/ionumbers/ionumbers.sty @@ -39,10 +39,19 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{ionumbers} - [2009/07/18 v0.2.4-alpha restyle numbers in math mode] + [2011/06/15 v0.3.1-alpha restyle numbers in math mode] \RequirePackage{keyval} \newif\ifion@autothousands \newif\ifion@autothousandths +\newcount\ion@grplenthousands +\newcount\ion@grplenthousandths +\newcommand*{\ion@grplencheck}[1]{% + \ifnum#1>9% + \PackageError{ionumbers}% + {Group length argument too large (#1).\MessageBreak% + Grouping lengths must be smaller than 10.}{}% + \fi% +} \newcommand*\ion@defpackopts{\define@key{ion@packopts}} \newcommand*\ion@setpackopts{\setkeys{ion@packopts}} \ion@defpackopts{comma}{% @@ -63,9 +72,15 @@ \csname ion@autothousands#1\endcsname}\ion@autothousandsreset} \ion@defpackopts{autothousandths}[true]{\def\ion@autothousandthsreset{% \csname ion@autothousandths#1\endcsname}\ion@autothousandthsreset} +\ion@defpackopts{grplenthousands}{\ion@grplencheck{#1}% + \def\ion@grplenthousandsreset{\ion@grplenthousands=#1}% + \ion@grplenthousandsreset} +\ion@defpackopts{grplenthousandths}{\ion@grplencheck{#1}% + \def\ion@grplenthousandthsreset{\ion@grplenthousandths=#1}% + \ion@grplenthousandthsreset} \ion@setpackopts{comma=default,point=default,thousands=default,% decimal=default,thousandths=default,exponent=default,autothousands=false,% - autothousandths=false} + autothousandths=false,grplenthousands=3,grplenthousandths=3} \DeclareOption*{\expandafter\ion@setpackopts\expandafter{\CurrentOption}} \ProcessOptions\relax \newcommand*\ion@deflocopts{\define@key{ion@locopts}} @@ -86,10 +101,30 @@ \csname ion@exponent@#1\endcsname}} \ion@deflocopts{autothousands}[true]{\csname ion@autothousands#1\endcsname} \ion@deflocopts{autothousandths}[true]{\csname ion@autothousandths#1\endcsname} +\ion@deflocopts{grplenthousands}{% + \def\@tempa{#1}% + \def\@tempb{reset}% + \ifx\@tempa\@tempb% + \ion@grplenthousandsreset% + \else% + \ion@grplencheck{#1}% + \ion@grplenthousands=#1% + \fi% +} +\ion@deflocopts{grplenthousandths}{% + \def\@tempa{#1}% + \def\@tempb{reset}% + \ifx\@tempa\@tempb% + \ion@grplenthousandthsreset% + \else% + \ion@grplencheck{#1}% + \ion@grplenthousandths=#1% + \fi% +} \newcommand*\ionumbersresetstyle{% \ionumbersstyle{comma=reset,point=reset,thousands=reset,% decimal=reset,thousandths=reset,exponent=reset,autothousands=reset,% - autothousandths=reset}} + autothousandths=reset,grplenthousands=reset,grplenthousandths=reset}} \AtEndOfPackage{\ionumbersresetstyle} \newcommand*\newionumbersthousands[2]{\expandafter\newcommand% \expandafter*\csname ion@thousands@#1\endcsname{\ionumbersoff{#2}}} @@ -655,6 +690,12 @@ \def\ion@thousands@sepa{} \def\ion@thousands@sepb{} \def\ion@thousands@sepc{} +\def\ion@thousands@sepd{} +\def\ion@thousands@sepe{} +\def\ion@thousands@sepf{} +\def\ion@thousands@sepg{} +\def\ion@thousands@seph{} +\def\ion@thousands@sepi{} \def\ion@thousandths@sep{} \newcommand{\ion@currnum@append}{% \ion@currnum@firstcharfalse% @@ -674,22 +715,34 @@ \ion@addto@macro{\ion@currnum}{\ion@thousands@sepb#1}% \or% \ion@addto@macro{\ion@currnum}{\ion@thousands@sepc#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepd#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepe#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepf#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepg#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@seph#1}% + \or% + \ion@addto@macro{\ion@currnum}{\ion@thousands@sepi#1}% \fi% %% advance thousands counter \advance\ion@thousands@currpos by1\relax% - \ifnum\ion@thousands@currpos>3% + \ifnum\ion@thousands@currpos>\ion@grplenthousands% \ion@thousands@currpos=1% \fi% \else% %% push back (empty) separator and character - \ifnum\ion@thousandths@currpos=3% + \ifnum\ion@thousandths@currpos=\ion@grplenthousandths% \ion@addto@macro{\ion@currnum}{\ion@thousandths@sep#1}% \else% \ion@addto@macro{\ion@currnum}{#1}% \fi% %% advance thousandths counter \advance\ion@thousandths@currpos by1\relax% - \ifnum\ion@thousandths@currpos>3% + \ifnum\ion@thousandths@currpos>\ion@grplenthousandths% \ion@thousandths@currpos=1% \fi% \fi% @@ -707,6 +760,18 @@ \def\ion@thousands@sepb{\ion@thousands@curr}% \or% \def\ion@thousands@sepc{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepd{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepe{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepf{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepg{\ion@thousands@curr}% + \or% + \def\ion@thousands@seph{\ion@thousands@curr}% + \or% + \def\ion@thousands@sepi{\ion@thousands@curr}% \fi% \fi% \fi% -- cgit v1.2.3