summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ionumbers
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/ionumbers')
-rw-r--r--macros/latex/contrib/ionumbers/COPYING674
-rw-r--r--macros/latex/contrib/ionumbers/Makefile83
-rw-r--r--macros/latex/contrib/ionumbers/README119
-rw-r--r--macros/latex/contrib/ionumbers/ionumbers.dtx1609
-rw-r--r--macros/latex/contrib/ionumbers/ionumbers.ins82
-rw-r--r--macros/latex/contrib/ionumbers/ionumbers.pdfbin0 -> 359743 bytes
-rw-r--r--macros/latex/contrib/ionumbers/ionumbers_test.pdfbin0 -> 111026 bytes
-rw-r--r--macros/latex/contrib/ionumbers/ionumbers_test.tex765
8 files changed, 3332 insertions, 0 deletions
diff --git a/macros/latex/contrib/ionumbers/COPYING b/macros/latex/contrib/ionumbers/COPYING
new file mode 100644
index 0000000000..94a9ed024d
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/macros/latex/contrib/ionumbers/Makefile b/macros/latex/contrib/ionumbers/Makefile
new file mode 100644
index 0000000000..125de5f6b7
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/Makefile
@@ -0,0 +1,83 @@
+#
+# Makefile for ionumbers package
+#
+# Copyright 2008,2011,2012 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
+
+# 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 mrproper 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:
+ 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:
+ $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *.out *~
+
+distclean: clean
+ $(RM) $(PACKAGE).sty
+
+mrproper: distclean
+ $(RM) $(PACKAGE).pdf $(TESTFILE).pdf
diff --git a/macros/latex/contrib/ionumbers/README b/macros/latex/contrib/ionumbers/README
new file mode 100644
index 0000000000..e393af7fc7
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/README
@@ -0,0 +1,119 @@
+SHORT DESCRIPTION
+=================
+
+(This is a copy of the LaTeX code of the documentation's abstract.)
+
+\textsf{ionumbers} stands for `input/output numbers'.
+
+This package restyles numbers in math mode. If a number in the input file
+is written, e.g., as |$3,231.44$| as commonly used in English texts, this
+package is able to restyle it to be output as `$3\,231{,}44$' as commonly
+used in German texts (and vice versa). This may be very useful, if you have
+a large table and want to include it in texts with different output
+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}) 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}$'.
+
+See `ionumbers.pdf' for detailed information on usage.
+
+BUILDING
+========
+
+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, the documentation and the test
+file:
+ $ make
+
+2) Building manually
+--------------------
+
+a) Generation of package (.sty file):
+
+Run `ionumbers.ins' through LaTeX:
+ $ pdflatex -interaction=nonstopmode ionumbers.ins
+
+b) Generation of documentation:
+
+Run `ionumbers.dtx' through LaTeX:
+ $ 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
+
+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
+============
+
+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=<your TDS> 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 <your TDS>
+
+LICENSE
+=======
+
+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>
+
+ion@addto@macro: identical to l@addto@macro from koma-script
+ bundle v2.9t
+Copyright 1994-2004 Markus Kohm and Frank Neukam
+
+Thanks to Martin Vaeth and Markus Kohm for permitting to use their
+code in this package. Please do not bother Martin, Markus, or Frank
+with questions or bugs concering this package!
+
+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!
diff --git a/macros/latex/contrib/ionumbers/ionumbers.dtx b/macros/latex/contrib/ionumbers/ionumbers.dtx
new file mode 100644
index 0000000000..485d5b4fa9
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/ionumbers.dtx
@@ -0,0 +1,1609 @@
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \iffalse meta-comment
+%
+% DocStrip file for ionumbers package
+%
+% Copyright 2007-2009,2011,2012,2014
+% 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>
+%
+% ion@addto@macro: identical to l@addto@macro from koma-script
+% bundle v2.9t
+% Copyright 1994-2004 Markus Kohm and Frank Neukam
+%
+% Thanks to Martin Vaeth and Markus Kohm for permitting to use their
+% code in this package. Please do not bother Martin, Markus, or Frank
+% with questions or bugs concering this package!
+%
+% 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!
+%
+% \fi
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{ionumbers}
+%<package> [2014/04/06 v0.3.3 restyle numbers in math mode]
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage{ionumbers}
+\usepackage{hyperref}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%
+% modified description environment
+\newcommand{\listmark}{$\bullet$}
+\newcommand{\listlengths}{%
+ \setlength{\parsep}{0pt}%
+ \setlength{\itemsep}{0pt}%
+ \setlength{\leftmargin}{10.5em}%
+ \setlength{\rightmargin}{0pt}%
+ \setlength{\labelsep}{1em}%
+ \setlength{\labelwidth}{9.5em}}
+\newenvironment{mydescription}{%
+ \begin{list}{\listmark}{\listlengths}%
+}{%
+ \end{list}%
+}
+%
+\begin{document}
+ \DocInput{ionumbers.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \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}
+% \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}
+% \changes{v0.3.2-alpha}{2012/08/20}{added examples of usage}
+% \changes{v0.3.3}{2014/04/06}{fixed problem when changing the font,
+% e.\,g., when loading the \textsf{MnSymbol} package; the original character
+% definitions are not hard-coded anymore, but copied
+% from the definitions at the beginning of the document; thanks to Michael
+% Sebastian Hitziger for his bug report}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \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
+% Lower-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
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \GetFileInfo{ionumbers.sty}
+%
+% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
+% \DoNotIndex{\@ne}
+% \DoNotIndex{\advance,\begingroup,\catcode,\closein}
+% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \title{The \textsf{ionumbers} package\thanks{This document corresponds
+% to \textsf{ionumbers}~\fileversion, dated~\filedate. Copyright
+% 2007--2009,2011,2012,2014 Christian Schneider
+% \texttt{<software(at)chschneider(dot)eu>}, \url{http://chschneider.eu}.}}
+% \author{Christian Schneider\\ \texttt{<software(at)chschneider(dot)eu>}}
+%
+% \maketitle
+%
+% \begin{center}
+% \large\textbf{\textsf{Warning: Use with caution and on your own risk!
+% Check output!}}
+% \end{center}
+%
+% \tableofcontents
+% \clearpage
+%
+% \begin{abstract}
+% \textsf{ionumbers} stands for `input/output numbers'.
+%
+% This package restyles numbers in math mode. If a number in the input file
+% is written, e.g., as |$3,231.44$| as commonly used in English texts, this
+% package is able to restyle it to be output as `$3\,231{,}44$' as commonly
+% used in German texts (and vice versa). This may be very useful, if you have
+% a large table and want to include it in texts with different output
+% 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}) 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}$'.
+% \end{abstract}
+%
+% \section{Details of number handling}
+%
+% \subsection{General rules}
+%
+% Every input \emph{in math mode} consisting of the following characters is
+% treated by this package: |.,+-0123456789|. These characters get macro
+% definitions. A number is any combination of these characters without
+% anything---not even white spaces---in between them. There are two
+% exceptions/special cases:
+%
+% \begin{enumerate}
+% \item The separator characters |.| and |,| are not treated as part of the
+% number at its end. This avoids problems with comma-separated lists
+% (see below).
+% \item The sign characters |+| and |-| will only be considered as part of
+% the number, if they appear at the begining of a number.
+% \end{enumerate}
+%
+% The lower case letter |e| plays a special role. An |e| immediatly following a
+% number (as defined above) can be configured as begining of the exponential
+% part. The letter |e| will be eaten from the input in this case and
+% substituted by some configurable output. The next number following this |e|
+% in the same group (even with other characters inbetween the |e| and the
+% number) will be treated as exponential part and grouped with curly braces
+% |{}|.
+%
+% It is a good practice to always add a space before/after each number such that
+% \textsf{ionumbers} knows the beginning/end of a number and does not
+% misinterpret other input as part of it.
+% Below, you will find a couple of examples that might lead to surprising
+% output, if this rule is not followed.
+%
+% \subsection{Caveats}
+%
+% \emph{Comma-separated lists} of numbers must be input with a space after
+% each comma to prevent |,| to be treated as part of the number. An example is
+% the list |1, 2, 3, \ldots|, where the commas are not part of in the numbers.
+% Note, however, that the commas are treated as part of the numbers in the first
+% two appearances in |1,2,3,\ldots|, as the commas are immediately followed
+% by a digit. Depending on the configuration, this may lead to strange spaces
+% between the numbers, disappearing commas etc.
+%
+% If you use \emph{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}$. The simplest way to
+% prevent undesired automatic grouping is to insert a space after each digit,
+% e.\,g., as in |a_{1 2 3 4}|.
+%
+% Please be aware that the first decimal separator of a number marks the
+% 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 decimal separator; options 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
+% \emph{syntactically incorrect} (there must not be two decimal separators in
+% one number!) and the output is \emph{not} a bug.
+%
+% The number following an |e| which has started the exponential part is treated
+% as exponential part, \emph{even if there is arbitrary input inbetween}.
+% Hence, the input |$1e \Pi 2| with package option |exponent=timestento| (will
+% be explained later) leads to a superscript |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 \emph{syntactically incorrect} and you might want to
+% prevent |e| from being treated as start of the exponential part by adding
+% a space: |$1 e \sqrt 2$| or |$1 e^2$|.
+%
+% 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, by the way.)
+%
+% \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}
+%
+% Package options are used to globally configure a default behaviour of
+% \textsf{ionumbers} for the whole document. These options usually consist
+% of a \meta{key}|=|\meta{value} pair. Local changes from this global
+% configuration for arbitrary parts of the document can be applied with special
+% commands.
+%
+% \subsection{Package options concerning the separators in the input}
+% \label{sec:in}
+%
+% 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}
+% \end{mydescription}
+%
+% The following \meta{value}s can be chosen for both of them:
+% \begin{mydescription}
+% \item[\texttt{ignore}] the separator will be ignored (no output)
+% \item[\texttt{decimal}] decimal separator (separating the thousands from
+% the thousandths part of a number)
+% \item[\texttt{thousands}] thousands separator (used for grouping of
+% thousands part)
+% \item[\texttt{default}] default behaviour of \textsf{ionumbers}
+% (|decimal| for |point|; |thousands| for |comma|)
+% \end{mydescription}
+%
+% The separator for exponents is always the lowercase letter |e|. A
+% thousandths separator does not exist in input files; such a separator will
+% only be output, if automatic grouping of the thousandths part is enabled (see
+% below).
+%
+% \subsection{Package options concerning the separators in the output}
+% \label{sec:out}
+%
+% The previously described options assign a \emph{meaning} to separators in
+% 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}
+% \end{mydescription}
+%
+% 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{apostrophe}] apostrophe (actually |$^\prime$|; \emph{not} for
+% |decimal|)
+% \item[\texttt{phantom}] space with width of a point (|$\phantom{.}$|;
+% \emph{not} for |decimal|)
+% \item[\texttt{space}] small space (|$\,$|; \emph{not} for |decimal|)
+% \item[\texttt{default}] default behaviour of \textsf{ionumbers}
+% (|punctcomma| for |thousands|; |point| for |decimal|; |space| for
+% |thousandths|)
+% \end{mydescription}
+%
+% 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 (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
+% superscript
+% \item[\texttt{cdottento}] |$\cdot10\,$| with following number output as
+% superscript
+% \item[\texttt{wedge}] |$^\wedge$|
+% \item[\texttt{default}] default behaviour of \textsf{ionumbers} (|original|)
+% \end{mydescription}
+%
+% \subsection{Package options concerning automatic grouping}
+% \label{sec:auto}
+%
+% Automatic grouping is a feature that automatically adds the thousands and
+% 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
+% (digits left to decimal separator)
+% \item[\texttt{autothousandths}=\meta{value}] automatic grouping of
+% 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:
+% \begin{enumerate}
+% \item Grouping of thousandths requires |autothousandths=true| in any case,
+% as there is no thousandths separator for explicitly specifing separations
+% in the input.
+% \item Automatic grouping of thousands will be skipped in a number, if it
+% contains a thousands separator in the input.
+% \end{enumerate}
+%
+% \subsection{Local style changes}
+%
+% \DescribeMacro{\ionumbersstyle}
+% The command |\ionumbersstyle|\marg{option list} changes the global style
+% definitions as specified as package options for the rest of the group.
+% The \meta{option list} may contain any of the package options described in
+% sections~\ref{sec:in}--\ref{sec:auto}. An additional \meta{value} for all
+% \meta{key}s is available inside |\ionumbersstyle| to switch back to the
+% configuration specified as package options: |reset|.
+%
+% \DescribeMacro{\ionumbersresetstyle}
+% The command |\ionumbersresetstyle| resets all \meta{value}s to the
+% configuration specified as package options. Actually, it is only a shorthand
+% for\\
+% |\ionumbersstyle{comma=reset,point=reset,decimal=reset,...}|.
+%
+% \subsection{User-defined values for output separators}
+% \label{sec:defs}
+%
+% A user may specify further output separators. Any user-defined \meta{value}s
+% for |thousands|, |decimal|, |thousandths|, and |exponent| can be used like
+% the built-in options in section~\ref{sec:out}.
+%
+% \DescribeMacro{\newionumbersthousands}
+% \DescribeMacro{\newionumbersdecimal}
+% \DescribeMacro{\newionumbersthousandths}
+% \DescribeMacro{\newionumbersexponent}
+% The command |\newionumbersthousands|\marg{value}\marg{definition} has two
+% mandatory arguments. The first one is the name of the newly defined
+% \meta{value} for the |thousands| \meta{key} and the second one its
+% definition. The commands |\newionumbersdecimal|, |\newionumbersthousandths|,
+% and |\newionumbersexponent| work the same way for the |decimal|,
+% |thousandths|, and |exponent| \meta{key}, respectively. There is a starred
+% version of |\newionumbersexponent| (called |\newionumbersexponent*|) that
+% typesets the following number as superscript.
+%
+% \DescribeMacro{\renewionumbersthousands}
+% \DescribeMacro{\renewionumbersdecimal}
+% \DescribeMacro{\renewionumbersthousandths}
+% \DescribeMacro{\renewionumbersexponent}
+% To redefine an existing \meta{key} definition there are |\renew...| versions
+% of the previously described commands.
+%
+% Notes on definitions:
+% \begin{enumerate}
+% \item All \meta{definition}s are set inside |\ionumbersoff| (see
+% section~\ref{sec:feat}). This means that numbers appearing in the
+% \meta{definition}s are not treated by this package.
+% \item The value |curr| has an internal meaning and should \emph{not} be
+% defined/redefined by the user.
+% \end{enumerate}
+%
+% \subsection{Enabling and disabling features}
+% \label{sec:feat}
+%
+% \DescribeMacro{\ionumbers}
+% The command |\ionumbers| makes comma, point, signs, and digits active in math
+% mode. This is equivalent to enabling the features of this package. This
+% command applies to the end of the current group.
+%
+% \DescribeMacro{\endionumbers}
+% To disable the features by making comma, point, signs, and digits inactive
+% again the command |\endionumbers| can be used. This command applies to the
+% end of the current group.
+%
+% \DescribeMacro{\ionumbersoff}
+% The command |\ionumbersoff|\marg{stuff} disables the features only for
+% \meta{stuff}.
+%
+% \section{License}
+%
+% \textsf{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.
+%
+% \textsf{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 \texttt{<http://www.gnu.org/licenses/>}.
+%
+% \section{Acknowledgements}
+%
+% The idea and parts of this package are based on \textsf{ziffer.sty}~v2.1 by
+% Martin V\"ath \texttt{<vaeth@mathematik.uni-wuerzburg.de>}.
+%
+% Furthermore the |\l@addto@macro| (with changed name) from
+% \textsf{koma-script bundle}~v2.9t by Markus Kohm and Frank Neukam is
+% used in this package.
+%
+% Thanks to Martin V\"ath and Markus Kohm for permitting to use their code in
+% this package.
+%
+% \section{Bugs, problems, and suggestions}
+%
+% Please report bugs and problems or send suggestions for this package to
+% Christian Schneider. Check for updates before reporting bugs at the website
+% mentioned above. Do \emph{not} bother Martin V\"ath, Markus Kohm, or Frank
+% Neukam with bugs, problems or suggestions concerning this package!
+%
+% \StopEventually{\PrintChanges\PrintIndex}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Implementation}
+%
+% The implementation is briefly described in this section. First of all, we
+% need the \textsf{keyval} package for \meta{key}|=|\meta{value} options:
+% \begin{macrocode}
+\RequirePackage{keyval}
+% \end{macrocode}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Default/global configuration}
+%
+% In principle the definitions of all available \meta{key'}|=|\meta{value'}
+% pairs is contained in the internal macros |\ion@|\meta{key'}|@|\meta{value'}.
+% Setting a package option \meta{key}|=|\meta{value} defines
+% |\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. 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
+% and set their \meta{value}s using \textsf{keyval}, respectively.
+% \begin{macrocode}
+\newcommand*\ion@defpackopts{\define@key{ion@packopts}}
+\newcommand*\ion@setpackopts{\setkeys{ion@packopts}}
+% \end{macrocode}
+%
+% Next the \meta{key}s are defined.
+% \begin{macrocode}
+\ion@defpackopts{comma}{%
+ \def\ion@comma@reset{\csname ion@comma@#1\endcsname}%
+ \def\ion@aftercomma@reset{\csname ion@aftercomma@#1\endcsname}}
+\ion@defpackopts{point}{%
+ \def\ion@point@reset{\csname ion@point@#1\endcsname}%
+ \def\ion@afterpoint@reset{\csname ion@afterpoint@#1\endcsname}}
+\ion@defpackopts{decimal}{\def\ion@decimal@reset{%
+ \csname ion@decimal@#1\endcsname}}
+\ion@defpackopts{thousands}{\def\ion@thousands@reset{%
+ \csname ion@thousands@#1\endcsname}}
+\ion@defpackopts{thousandths}{\def\ion@thousandths@reset{%
+ \csname ion@thousandths@#1\endcsname}}
+\ion@defpackopts{exponent}{\def\ion@exponent@reset{%
+ \csname ion@exponent@#1\endcsname}}
+\ion@defpackopts{autothousands}[true]{\def\ion@autothousandsreset{%
+ \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
+% package option---overwritten with the user's configuration.
+% \begin{macrocode}
+\ion@setpackopts{comma=default,point=default,thousands=default,%
+ decimal=default,thousandths=default,exponent=default,autothousands=false,%
+ autothousandths=false,grplenthousands=3,grplenthousandths=3}
+\DeclareOption*{\expandafter\ion@setpackopts\expandafter{\CurrentOption}}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Local style changes}
+%
+% The currently active configuration of a \meta{key} is stored in the macro
+% |\ion@|\meta{key}|@curr|. The |\ion@|\meta{key}|@curr| macros for all
+% \meta{key}s are defined using the mechanism for local configuration changes.
+%
+% The local options are defined and set---analogous to the package option
+% case---with two shorthands using \textsf{keyval}. The latter is
+% publically available to the user.
+% \begin{macrocode}
+\newcommand*\ion@deflocopts{\define@key{ion@locopts}}
+% \end{macrocode}
+% \begin{macro}{\ionumberstyle}
+% \begin{macrocode}
+\newcommand*\ionumbersstyle[1]{\setkeys{ion@locopts}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% Now the \meta{key}s for the local options are defined (just as in the case of
+% the package options):
+% \begin{macrocode}
+\ion@deflocopts{comma}{%
+ \def\ion@comma@curr{\csname ion@comma@#1\endcsname}%
+ \def\ion@aftercomma@curr{\csname ion@aftercomma@#1\endcsname}}
+\ion@deflocopts{point}{%
+ \def\ion@point@curr{\csname ion@point@#1\endcsname}%
+ \def\ion@afterpoint@curr{\csname ion@afterpoint@#1\endcsname}}
+\ion@deflocopts{decimal}{\def\ion@decimal@curr{%
+ \csname ion@decimal@#1\endcsname}}
+\ion@deflocopts{thousands}{\def\ion@thousands@curr{%
+ \csname ion@thousands@#1\endcsname}}
+\ion@deflocopts{thousandths}{\def\ion@thousandths@curr{%
+ \csname ion@thousandths@#1\endcsname}}
+\ion@deflocopts{exponent}{\def\ion@exponent@curr{%
+ \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.
+% \begin{macro}{\ionumbersresetstyle}
+% \begin{macrocode}
+\newcommand*\ionumbersresetstyle{%
+ \ionumbersstyle{comma=reset,point=reset,thousands=reset,%
+ decimal=reset,thousandths=reset,exponent=reset,autothousands=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
+% of the package options active (and have no undefined |\ion@|\meta{key}|@curr|
+% macros).
+% \begin{macrocode}
+\AtEndOfPackage{\ionumbersresetstyle}
+% \end{macrocode}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{User-defined values for output separators}
+%
+% The commands for user-defined \meta{value}s for output separators just
+% (re)define the internal macro |\ion@|\meta{key}|@|\meta{value} storing
+% the definition for the \meta{key}|=|\meta{value} pair.
+%
+% \begin{macro}{\newionumbersthousands}
+% \begin{macrocode}
+\newcommand*\newionumbersthousands[2]{\expandafter\newcommand%
+ \expandafter*\csname ion@thousands@#1\endcsname{\ionumbersoff{#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newionumbersdecimal}
+% \begin{macrocode}
+\newcommand*\newionumbersdecimal[2]{\expandafter\newcommand%
+ \expandafter*\csname ion@decimal@#1\endcsname{\ionumbersoff{#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newionumbersthousandths}
+% \begin{macrocode}
+\newcommand*\newionumbersthousandths[2]{\expandafter\newcommand%
+ \expandafter*\csname ion@thousandths@#1\endcsname{\ionumbersoff{#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newionumbersexponent}
+% \begin{macrocode}
+\newcommand*\newionumbersexponent{%
+ \@ifstar{\newionumbersexponent@@}{\newionumbersexponent@}}
+\newcommand*\newionumbersexponent@[2]{\expandafter\newcommand%
+ \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}}}
+\newcommand*\newionumbersexponent@@[2]{\expandafter\newcommand%
+ \expandafter*\csname ion@exponent@#1\endcsname{\ionumbersoff{#2}%
+ \ion@exponent@superscripttrue}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\renewionumbersthousands}
+% \begin{macrocode}
+\newcommand*\renewionumbersthousands[2]{\expandafter\renewcommand%
+ \expandafter*\csname ion@thousands@#1\endcsname{\ionumbersoff{#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\renewionumbersdecimal}
+% \begin{macrocode}
+\newcommand*\renewionumbersdecimal[2]{\expandafter\renewcommand%
+ \expandafter*\csname ion@decimal@#1\endcsname{\ionumbersoff{#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\renewionumbersthousandths}
+% \begin{macrocode}
+\newcommand*\renewionumbersthousandths[2]{\expandafter\renewcommand%
+ \expandafter*\csname ion@thousandths@#1\endcsname{\ionumbersoff{#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\renewionumbersexponent}
+% \begin{macrocode}
+\newcommand*\renewionumbersexponent{%
+ \@ifstar{\renewionumbersexponent@@}{\renewionumbersexponent@}}
+\newcommand*\renewionumbersexponent@[2]{\expandafter\renewcommand%
+ \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@currnum@exponent\ion@exponent@superscripttrue}}
+% \end{macrocode}
+% \end{macro}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Internal macros holding definitions for \meta{key}=\meta{value}
+% pairs}
+%
+% First of all, macros with the original character definitions are defined.
+% \begin{macrocode}
+\AtBeginDocument{
+ \mathchardef\ion@point@original=\the\mathcode`.
+ \mathchardef\ion@comma@original=\the\mathcode`,
+ \mathchardef\ion@plus@original=\the\mathcode`+
+ \mathchardef\ion@minus@original=\the\mathcode`-
+ \mathchardef\ion@zero@original=\the\mathcode`0
+ \mathchardef\ion@one@original=\the\mathcode`1
+ \mathchardef\ion@two@original=\the\mathcode`2
+ \mathchardef\ion@three@original=\the\mathcode`3
+ \mathchardef\ion@four@original=\the\mathcode`4
+ \mathchardef\ion@five@original=\the\mathcode`5
+ \mathchardef\ion@six@original=\the\mathcode`6
+ \mathchardef\ion@seven@original=\the\mathcode`7
+ \mathchardef\ion@eight@original=\the\mathcode`8
+ \mathchardef\ion@nine@original=\the\mathcode`9
+ \mathchardef\ion@e@original=\the\mathcode`e
+ \mathchardef\ion@E@original=\the\mathcode`E
+}
+% \end{macrocode}
+%
+% Here the |\ion@|\meta{key}|@|\meta{value} macros are defined, begining with
+% the definitions for the comma as input separator.
+% \begin{macrocode}
+\def\ion@comma@ignore{}
+\def\ion@comma@decimal{\ion@decimal@curr}
+\def\ion@comma@thousands{\ion@thousands@curr}
+\def\ion@comma@default{\ion@comma@thousands}
+% \end{macrocode}
+% The macros |\ion@comma@|\meta{value} contain the output for a comma appearing
+% in the input. Actually, a second set of |\ion@|aftercomma|@|\meta{value}
+% macros is required containing commands to be issued whenever a comma appears.
+% If comma is the decimal separator, the appearance of comma in the input will
+% mean that input of the thousands part is complete and the thousandths
+% thousandths part starts (|\ion@beforedecimalfalse| must be issued). If comma
+% is the thousands separator, the automatic grouping of thousands will be
+% switched of for that number (|\ion@noexplicitthousandsfalse| must be issued).
+% \begin{macrocode}
+\def\ion@aftercomma@ignore{}
+\def\ion@aftercomma@decimal{\ion@beforedecimalfalse}
+\def\ion@aftercomma@thousands{\ion@noexplicitthousandsfalse}
+\def\ion@aftercomma@default{\ion@aftercomma@thousands}
+% \end{macrocode}
+%
+% An analogous set of macros is defined for the point as input separator.
+% \begin{macrocode}
+\def\ion@point@ignore{}
+\def\ion@point@decimal{\ion@decimal@curr}
+\def\ion@point@thousands{\ion@thousands@curr}
+\def\ion@point@default{\ion@point@decimal}
+% \end{macrocode}
+% For the same reasons as mentioned before a set of
+% |\ion@|afterpoint|@|\meta{value} macros is required.
+% \begin{macrocode}
+\def\ion@afterpoint@ignore{}
+\def\ion@afterpoint@decimal{\ion@beforedecimalfalse}
+\def\ion@afterpoint@thousands{\ion@noexplicitthousandsfalse}
+\def\ion@afterpoint@default{\ion@afterpoint@decimal}
+% \end{macrocode}
+%
+% Next the definitions for the decimal output separator, \ldots
+% \begin{macrocode}
+\def\ion@decimal@point{\mathord{\ion@point@original}}
+\def\ion@decimal@comma{\mathord{\ion@comma@original}}
+\def\ion@decimal@punctpoint{\mathpunct{\ion@decimal@point}}
+\def\ion@decimal@punctcomma{\mathpunct{\ion@decimal@comma}}
+\def\ion@decimal@default{\ion@decimal@point}
+% \end{macrocode}
+%
+% \ldots{} the thousands output separator, \ldots
+% \begin{macrocode}
+\def\ion@thousands@none{}
+\def\ion@thousands@point{\mathord{\ion@point@original}}
+\def\ion@thousands@comma{\mathord{\ion@comma@original}}
+\def\ion@thousands@punctpoint{\mathpunct{\ion@decimal@point}}
+\def\ion@thousands@punctcomma{\mathpunct{\ion@decimal@comma}}
+\def\ion@thousands@apostrophe{^\prime}
+\def\ion@thousands@phantom{\phantom{\ion@point@original}}
+\def\ion@thousands@space{\,}
+\def\ion@thousands@default{\ion@thousands@punctcomma}
+% \end{macrocode}
+%
+% \ldots{} the thousandths output separator, \ldots
+% \begin{macrocode}
+\def\ion@thousandths@none{}
+\def\ion@thousandths@point{\mathord{\ion@point@original}}
+\def\ion@thousandths@comma{\mathord{\ion@comma@original}}
+\def\ion@thousandths@punctpoint{\mathpunct{\ion@decimal@point}}
+\def\ion@thousandths@punctcomma{\mathpunct{\ion@decimal@comma}}
+\def\ion@thousandths@apostrophe{^\prime}
+\def\ion@thousandths@phantom{\phantom{\ion@point@original}}
+\def\ion@thousandths@space{\,}
+\def\ion@thousandths@default{\ion@thousandths@space}
+% \end{macrocode}
+%
+% \ldots{} and the exponent output separator are given.
+% \begin{macrocode}
+\def\ion@exponent@none{}
+\def\ion@exponent@original{\ion@e@original}
+\def\ion@exponent@ite{\mathit{\ion@e@original}\ion@currnum@exponenttrue}
+\def\ion@exponent@itE{\mathit{\ion@E@original}\ion@currnum@exponenttrue}
+\def\ion@exponent@rme{\mathrm{\ion@e@original}\ion@currnum@exponenttrue}
+\def\ion@exponent@rmE{\mathrm{\ion@E@original}\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}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Enabling and disabling features}
+%
+% The following helper macros make different subsets of |.,+-0123456789|
+% active.
+% \begin{macrocode}
+\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%
+ \catcode`\0=\active\catcode`\1=\active\catcode`\2=\active%
+ \catcode`\3=\active\catcode`\4=\active\catcode`\5=\active%
+ \catcode`\6=\active\catcode`\7=\active\catcode`\8=\active%
+ \catcode`\9=\active\relax}
+% \end{macrocode}
+%
+% An analogous set of macros makes subsets of these characters active/inactive
+% in math mode.
+% \begin{macrocode}
+\def\ion@separators@math@active{\mathcode`,="8000\mathcode`.="8000\relax}
+\def\ion@signs@math@active{\mathcode`+="8000\mathcode`-="8000\relax}
+\def\ion@digits@math@active{\mathcode`0="8000\mathcode`1="8000\mathcode`2="8000%
+ \mathcode`3="8000\mathcode`4="8000\mathcode`5="8000\mathcode`6="8000%
+ \mathcode`7="8000\mathcode`8="8000\mathcode`9="8000\relax}
+\def\ion@separators@math@inactive{%
+ \mathcode`,=\the\ion@comma@original%
+ \mathcode`.=\the\ion@point@original%
+ \relax}
+\def\ion@signs@math@inactive{%
+ \mathcode`+=\the\ion@plus@original%
+ \mathcode`-=\the\ion@minus@original%
+ \relax}
+\def\ion@digits@math@inactive{%
+ \mathcode`0=\the\ion@zero@original%
+ \mathcode`1=\the\ion@one@original%
+ \mathcode`2=\the\ion@two@original%
+ \mathcode`3=\the\ion@three@original%
+ \mathcode`4=\the\ion@four@original%
+ \mathcode`5=\the\ion@five@original%
+ \mathcode`6=\the\ion@six@original%
+ \mathcode`7=\the\ion@seven@original%
+ \mathcode`8=\the\ion@eight@original%
+ \mathcode`9=\the\ion@nine@original%
+ \relax}
+% \end{macrocode}
+%
+% Next the user interface for making |.,+-0123456789| active/inactive follows.
+% \begin{macro}{\ionumbers}
+% \begin{macrocode}
+\def\ionumbers{\ion@separators@math@active\ion@signs@math@active%
+ \ion@digits@math@active}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endionumbers}
+% \begin{macrocode}
+\def\endionumbers{\ion@separators@math@inactive\ion@signs@math@inactive%
+ \ion@digits@math@inactive}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ionumbersoff}
+% \begin{macrocode}
+\newcommand\ionumbersoff[1]{\begingroup\endionumbers#1\ionumbers\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% Of course, at the begining of the document the charactars shall be active
+% by default.
+% \begin{macrocode}
+\AtBeginDocument{\ionumbers}
+% \end{macrocode}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Definitions of active characters}
+%
+% The macro definitions for the characters |.,+-0123456789| are hold in the
+% following macros. Number processing works by looking at the next character
+% 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@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
+% |\ion@currnum@output|
+% \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. 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@append*{\ion@comma@curr}\ion@aftercomma@curr%
+ }{%
+ \ion@ifnextseparator{%
+ \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr%
+ \@warning{Too many separators}%
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@append*{\ion@comma@curr}\ion@aftercomma@curr%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output\ion@comma@original%
+ }%
+ }%
+ }%
+}
+\def\ion@point{%
+ \ion@ifnextdigit{%
+ \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr%
+ }{%
+ \ion@ifnextseparator{%
+ \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr%
+ \@warning{Too many separators}%
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@append*{\ion@point@curr}\ion@afterpoint@curr%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output\ion@point@original%
+ }%
+ }%
+ }%
+}
+\def\ion@plus{%
+ \ion@iffirstchar{%
+ \ion@plus@original%
+ }{%
+ \ion@currnum@append*{\ion@plus@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextsign{%
+ \@warning{Too many signs}%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@minus{%
+ \ion@iffirstchar{%
+ \ion@minus@original%
+ }{%
+ \ion@currnum@append*{\ion@minus@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextsign{%
+ \@warning{Too many signs}%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@zero{%
+ \ion@iffirstchar{%
+ \ion@zero@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@zero@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@one{%
+ \ion@iffirstchar{%
+ \ion@one@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@one@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@two{%
+ \ion@iffirstchar{%
+ \ion@two@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@two@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@three{%
+ \ion@iffirstchar{%
+ \ion@three@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@three@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@four{%
+ \ion@iffirstchar{%
+ \ion@four@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@four@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@five{%
+ \ion@iffirstchar{%
+ \ion@five@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@five@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@six{%
+ \ion@iffirstchar{%
+ \ion@six@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@six@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@seven{%
+ \ion@iffirstchar{%
+ \ion@seven@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@seven@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@eight{%
+ \ion@iffirstchar{%
+ \ion@eight@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@eight@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+\def\ion@nine{%
+ \ion@iffirstchar{%
+ \ion@nine@original\ion@currnum@append{}%
+ }{%
+ \ion@currnum@append{\ion@nine@original}%
+ }%
+ \ion@ifnextdigit{%
+ %% nothing
+ }{%
+ \ion@ifnextseparator{%
+ %% nothing
+ }{%
+ \ion@ifnextchar e{%
+ \ion@currnum@output\ion@exponent@curr\@gobble%
+ }{%
+ \ion@currnum@output%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% The macro |\ion@define@charmacros| is used to assign the above macros to the
+% (active) characters |.,+-0123456789|. It will be executed later in the
+% conflict test section.
+% \begin{macrocode}
+\begingroup
+ \ion@separators@active\ion@signs@active\ion@digits@active
+ \gdef\ion@define@charmacros{%
+ \global\let,=\ion@comma%
+ \global\let.=\ion@point%
+ \global\let+=\ion@plus%
+ \global\let-=\ion@minus%
+ \global\let0=\ion@zero%
+ \global\let1=\ion@one%
+ \global\let2=\ion@two%
+ \global\let3=\ion@three%
+ \global\let4=\ion@four%
+ \global\let5=\ion@five%
+ \global\let6=\ion@six%
+ \global\let7=\ion@seven%
+ \global\let8=\ion@eight%
+ \global\let9=\ion@nine%
+ }
+\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}
+\long\def\ion@ifnextdigit#1#2{%
+ \def\reserved@a{#1}%
+ \def\reserved@b{#2}%
+ \futurelet\@let@token\ion@ifnextdigit@}
+\def\ion@ifnextdigit@{%
+ \ifx\@let@token1\let\reserved@c\reserved@a\else%
+ \ifx\@let@token2\let\reserved@c\reserved@a\else%
+ \ifx\@let@token3\let\reserved@c\reserved@a\else%
+ \ifx\@let@token4\let\reserved@c\reserved@a\else%
+ \ifx\@let@token5\let\reserved@c\reserved@a\else%
+ \ifx\@let@token6\let\reserved@c\reserved@a\else%
+ \ifx\@let@token7\let\reserved@c\reserved@a\else%
+ \ifx\@let@token8\let\reserved@c\reserved@a\else%
+ \ifx\@let@token9\let\reserved@c\reserved@a\else%
+ \ifx\@let@token0\let\reserved@c\reserved@a\else%
+ \let\reserved@c\reserved@b%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \reserved@c}
+% \end{macrocode}
+%
+% \ldots{} for a separator |.,|, \ldots
+% \begin{macrocode}
+\long\def\ion@ifnextseparator#1#2{%
+ \def\reserved@a{#1}%
+ \def\reserved@b{#2}%
+ \futurelet\@let@token\ion@ifnextseparator@}
+\def\ion@ifnextseparator@{%
+ \ifx\@let@token,\let\reserved@c\reserved@a\else%
+ \ifx\@let@token.\let\reserved@c\reserved@a\else%
+ \let\reserved@c\reserved@b%
+ \fi%
+ \fi%
+ \reserved@c}
+% \end{macrocode}
+%
+% \ldots{} and for a sign |+-| as next character.
+% \begin{macrocode}
+\long\def\ion@ifnextsign#1#2{%
+ \def\reserved@a{#1}%
+ \def\reserved@b{#2}%
+ \futurelet\@let@token\ion@ifnextsign@}
+\def\ion@ifnextsign@{%
+ \ifx\@let@token+\let\reserved@c\reserved@a\else%
+ \ifx\@let@token-\let\reserved@c\reserved@a\else%
+ \let\reserved@c\reserved@b%
+ \fi%
+ \fi%
+ \reserved@c}
+% \end{macrocode}
+%
+% An additional test for an arbitrary character is also added. It obeys white
+% spaces in contrast to \LaTeX{}'s |\@ifnextchar|.
+% \begin{macrocode}
+\long\def\ion@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}%
+ \def\reserved@b{#3}%
+ \futurelet\@let@token\ion@ifnextchar@}
+\def\ion@ifnextchar@{%
+ \ifx\@let@token\reserved@d%
+ \let\reserved@c\reserved@a%
+ \else%
+ \let\reserved@c\reserved@b%
+ \fi%
+ \reserved@c}
+% \end{macrocode}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Test for conflicts with other packages}
+%
+% First of all we test for some packages known to conflict with
+% \textsf{ionumbers}. This will be done by checking at the begining of the
+% document, if one of these packages has been loaded and an error/warning will
+% be issued.
+% \begin{macrocode}
+\newcommand*{\ion@conflict@package}[1]{%
+ \@ifpackageloaded{#1}{%
+ \PackageError{ionumbers}%
+ {Packages #1 and ionumbers conflict!\MessageBreak%
+ Do not load both packages in the same document}{}%
+ }{}%
+}
+\newcommand*{\ion@problem@package}[2]{%
+ \@ifpackageloaded{#1}{%
+ \PackageWarning{ionumbers}%
+ {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}
+%
+% Next the characters |.,+-0123456789| are checked for macro definitions (by
+% other packages). This way conflicts with other packages may be detected with
+% some probability (but only if the conflicting package has already been
+% loaded).
+% \begin{macrocode}
+\newcommand*\ion@conflict@definedtest[1]{%
+ \ifx#1\@undefined\else\PackageWarning{ionumbers}%
+ {Potential conflict with other package(s) detected.\MessageBreak%
+ `\string#1' has already been defined. I will redefine it.\MessageBreak%
+ This might break other package(s)!\MessageBreak}\fi}
+\begingroup
+ \ion@separators@active\ion@signs@active\ion@digits@active
+ \ion@conflict@definedtest{,}
+ \ion@conflict@definedtest{.}
+ \ion@conflict@definedtest{+}
+ \ion@conflict@definedtest{-}
+ \ion@conflict@definedtest{0}
+ \ion@conflict@definedtest{1}
+ \ion@conflict@definedtest{2}
+ \ion@conflict@definedtest{3}
+ \ion@conflict@definedtest{4}
+ \ion@conflict@definedtest{5}
+ \ion@conflict@definedtest{6}
+ \ion@conflict@definedtest{7}
+ \ion@conflict@definedtest{8}
+ \ion@conflict@definedtest{9}
+\endgroup
+% \end{macrocode}
+%
+% After the above test the definitions of the characters of
+% \textsf{ionumbers} can be applied.
+% \begin{macrocode}
+\ion@define@charmacros
+% \end{macrocode}
+%
+% Additionally, \textsf{ionumbers} tests for redefinitions of the macros
+% of the characters at the begining of the document.
+% \begin{macrocode}
+\newcommand*{\ion@conflict@redefinedtest}[2]{%
+ \ifx#1#2\else\PackageWarning{ionumbers}%
+ {Potential conflict with other package(s) detected.\MessageBreak%
+ `\string#1' has been redefined. This might break ionumbers!\MessageBreak}%
+ \fi}
+\begingroup
+ \ion@separators@active\ion@signs@active\ion@digits@active
+ \gdef\ion@conflict@redefinedtest@macro{%
+ \ion@conflict@redefinedtest{,}{\ion@comma}%
+ \ion@conflict@redefinedtest{.}{\ion@point}%
+ \ion@conflict@redefinedtest{+}{\ion@plus}%
+ \ion@conflict@redefinedtest{-}{\ion@minus}%
+ \ion@conflict@redefinedtest{0}{\ion@zero}%
+ \ion@conflict@redefinedtest{1}{\ion@one}%
+ \ion@conflict@redefinedtest{2}{\ion@two}%
+ \ion@conflict@redefinedtest{3}{\ion@three}%
+ \ion@conflict@redefinedtest{4}{\ion@four}%
+ \ion@conflict@redefinedtest{5}{\ion@five}%
+ \ion@conflict@redefinedtest{6}{\ion@six}%
+ \ion@conflict@redefinedtest{7}{\ion@seven}%
+ \ion@conflict@redefinedtest{8}{\ion@eight}%
+ \ion@conflict@redefinedtest{9}{\ion@nine}%
+ }
+\endgroup
+\AtBeginDocument{\ion@conflict@redefinedtest@macro}
+% \end{macrocode}
+%
+% ---------------------------------------------------------------------
+%
+% \subsection{Commands for current number}
+%
+% Numbers are processed by first storing one character after the other in an
+% internal macro to be able to automatically group digits. The basic idea when
+% adding single characters is
+% \begin{itemize}
+% \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}
+% \item for the thousands part: add |\ion@thousands@sepa| for 1,
+% |\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}
+% \end{itemize}
+% The macros |\ion@thousands@sep...| and |\ion@thousandths@sep| are empty by
+% default. Before outputting the number, the number of digits in the thousands
+% part is known and the correct |\ion@thousands@sep...| macro can be set to the
+% thousands separator for correct grouping.
+%
+% 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
+\def\ion@currnum{}
+\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}
+%
+% 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@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@append@}[1]{%
+ \ifion@beforedecimal%
+ %% push back (empty) separator and character
+ \ifcase\ion@thousands@currpos%
+ \ion@addto@macro{\ion@currnum}{#1}%
+ \or%
+ \ion@addto@macro{\ion@currnum}{\ion@thousands@sepa#1}%
+ \or%
+ \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>\ion@grplenthousands%
+ \ion@thousands@currpos=1%
+ \fi%
+ \else%
+ %% push back (empty) separator and character
+ \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>\ion@grplenthousandths%
+ \ion@thousandths@currpos=1%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+%
+% The |\ion@currnum@output| macro defines the empty separator macros (depending
+% on the current configuration), outputs the current number, and resets
+% everything for the next number.
+% \begin{macrocode}
+\newcommand*{\ion@currnum@output}{%
+ \begingroup%
+ %% set automatic thousands separator
+ \ifion@autothousands%
+ \ifion@noexplicitthousands%
+ \ifcase\ion@thousands@currpos%
+ %% do nothing
+ \or%
+ \def\ion@thousands@sepa{\ion@thousands@curr}%
+ \or%
+ \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%
+ %% set automatic thousandths separator
+ \ifion@autothousandths%
+ \def\ion@thousandths@sep{\ion@thousandths@curr}%
+ \fi%
+ %% output number
+ \ifion@currnum@exponent%
+ \ifion@exponent@superscript%
+ ^{\ion@currnum}%
+ \else%
+ {\ion@currnum}%
+ \fi%
+ \else
+ \ion@currnum%
+ \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@currnum@exponentfalse%
+ \ion@exponent@superscriptfalse%
+}
+% \end{macrocode}
+%
+% This macro is identical to |\l@addto@macro| from \textsf{koma-script bundle}.
+% \begin{macrocode}
+\newcommand{\ion@addto@macro}[2]{%
+ \begingroup\toks@\expandafter{#1#2}%
+ \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/ionumbers/ionumbers.ins b/macros/latex/contrib/ionumbers/ionumbers.ins
new file mode 100644
index 0000000000..fc5505d555
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/ionumbers.ins
@@ -0,0 +1,82 @@
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% installation file 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!
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input docstrip.tex
+%\keepsilent
+
+\usedir{tex/latex/ionumbers}
+
+\preamble
+
+This is a generated file.
+
+Copyright 2007-2008 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>
+
+ion@addto@macro: identical to l@addto@macro from koma-script
+ bundle v2.9t
+Copyright 1994-2004 Markus Kohm and Frank Neukam
+
+Thanks to Martin Vaeth and Markus Kohm for permitting to use their
+code in this package. Please do not bother Martin and Markus with
+questions or bugs concering this package!
+
+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!
+
+\endpreamble
+
+\generate{\file{ionumbers.sty}{\from{ionumbers.dtx}{package}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* ionumbers.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* ionumbers.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{****************************************************}
+
+\endbatchfile
diff --git a/macros/latex/contrib/ionumbers/ionumbers.pdf b/macros/latex/contrib/ionumbers/ionumbers.pdf
new file mode 100644
index 0000000000..ca8caa6307
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/ionumbers.pdf
Binary files differ
diff --git a/macros/latex/contrib/ionumbers/ionumbers_test.pdf b/macros/latex/contrib/ionumbers/ionumbers_test.pdf
new file mode 100644
index 0000000000..bddba7de77
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/ionumbers_test.pdf
Binary files differ
diff --git a/macros/latex/contrib/ionumbers/ionumbers_test.tex b/macros/latex/contrib/ionumbers/ionumbers_test.tex
new file mode 100644
index 0000000000..277e4e7e3d
--- /dev/null
+++ b/macros/latex/contrib/ionumbers/ionumbers_test.tex
@@ -0,0 +1,765 @@
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% test file for ionumbers package
+%
+% Copyright 2008,2011 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!
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\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.
+ Note that a lot of input is nonsense and serves for testing purposes only.
+
+ \vspace{2ex}\noindent
+}
+
+\frenchspacing
+
+\begin{document}
+
+ \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{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{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
+ \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{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}
+
+ \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}