summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/ionumbers
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/ionumbers')
-rw-r--r--Master/texmf-dist/source/latex/ionumbers/Makefile66
-rw-r--r--Master/texmf-dist/source/latex/ionumbers/ionumbers.dtx120
2 files changed, 102 insertions, 84 deletions
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 <software(at)chschneider(dot)eu>
-#
-# 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 <http://www.gnu.org/licenses/>.
-#
-# 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 <software(at)chschneider(dot)eu>
+% Copyright 2007-2009,2011 Christian Schneider <software(at)chschneider(dot)eu>
%
% idea and parts of this package based on: ziffer.sty v2.1
% Copyright Martin Vaeth <vaeth@mathematik.uni-wuerzburg.de>
@@ -38,7 +38,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{ionumbers}
-%<package> [2009/07/18 v0.2.4-alpha restyle numbers in math mode]
+%<package> [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{<software(at)chschneider(dot)eu>}.}}
+% 2007--2009,2011 Christian Schneider
+% \texttt{<software(at)chschneider(dot)eu>}.}}
% \author{Christian Schneider\\ \texttt{<software(at)chschneider(dot)eu>}}
%
% \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%