CTAN update: datatool
Date: March 5, 2025 6:23:46 AM CET
Nicola Talbot submitted an update to the
datatool
package.
Version: 3.0 2025-03-03
License: lppl1.3
Summary description: Tools to load and manipulate data
Announcement text:
Major rewrite. Rollback to v2.32 available if there are any issues. Key features: - new 'math' package options: math=lua and math=l3fp. If not specified, the defaults are now math=lua for LuaLaTeX and math=l3fp otherwise. The older options are still supported, but the newer ones are better and support scientific notation. - parsed formatted numbers and currency have their values embedded within the control sequence variable for easy access without having to reparse. Note that this affects expansion, which may cause a difference from v2.32. For example: \DTLparse\result{\$12,345.67} Original text: \result. Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}. Numeric value: \DTLdatumvalue{\result}. Currency symbol: \DTLdatumcurrency{\result}. In this case, \result will only expand as far as the original text. To fully expand use \DTLusedatum{\result}. - For databases that contain numeric values that will be used in calculations (including plotting), use \DTLsetup{store-datum} (before creating the database) to embed the numeric information within the database entries. This should improve build time but may impair fast data lookup of unique strings. - New multi-purpose \DTLaction command with key=value interface that may be used instead of the alternative commands with long names. - New sort functions that internally use \seq_sort:Nn for faster sorting. The old sort commands still work but the newer ones are more efficient. Note: the glossaries package uses the datatool-base sorting commands for \printnoidxglossary. If you are using that command you may notice a difference. Make sure you have at least glossaries v4.56 to take advantage of the improved sorting and new localisation support. - Localisation support has been added for orthography (alphabet order for word sorting) and for numeric parsing (currency symbols, number group separator and decimal character). Support for numeric parsing and currency is supplied by datatool-regions which needs to be installed separately. Support for orthography is supplied by the applicable language module, which needs to be installed separately. Currently only datatool-english is available. For example (assuming datatool v3.0, datatool-regions and datatool-english are all installed): \documentclass{article} \usepackage{fontspec} \setromanfont{Noto Serif} \usepackage[locales={en-BE,ang-Latn}]{datatool-base} \newcommand{\wordlist}{ýþung, eásteweard, áǽðan, Œthelwald, þorn, æsċ, eaþ-fynde, ðæt, Æðelþryð, aardvark, zebra, ƿēana, Oswine} \begin{document} Currency: \DTLdecimaltocurrency{1234.56}{\result}\result. \DTLenLocaleHook \DTLsortwordlist{\wordlist}{\DTLsortletterhandler} Sorted list: \DTLformatlist{\wordlist}. \DTLangLatnLocaleHook \DTLsortwordlist{\wordlist}{\DTLsortletterhandler} Sorted list: \DTLformatlist{\wordlist}. \DTLresetRegion \DTLresetLanguage Currency: \DTLdecimaltocurrency{1234.56}{\result}\result. \DTLsortwordlist{\wordlist}{\DTLsortletterhandler} Sorted list: \DTLformatlist{\wordlist}. \end{document} The result is: Currency: 1.234,56€. Sorted list: aardvark, Æðelþryð, æsċ, áǽðan, ðæt, eásteweard, eaþ-fynde, Œthelwald, Oswine, þorn, ƿēana, ýþung and zebra. Sorted list: aardvark, áǽðan, eásteweard, eaþ-fynde, Œthelwald, Oswine, ýþung, zebra, ƿēana, ðæt, æsċ, Æðelþryð ⁊ þorn. Currency: ¤1,234.56. Sorted list: aardvark, eaþ-fynde, eásteweard, Oswine, zebra, áǽðan, æsċ, Æðelþryð, ðæt, ýþung, þorn, Œthelwald & ƿēana.
This package is located at https://mirrors.ctan.org/macros/latex/contrib/datatool More information is at https://www.ctan.org/pkg/datatool
Thanks for the upload. For the CTAN Team Manfred Lotz CTAN is run entirely by volunteers and supported by TeX user groups. Please join a user group or donate to one, see https://ctan.org/lugs .
Major rewrite. Rollback to v2.32 available if there are any issues. Key features: - new 'math' package options: math=lua and math=l3fp. If not specified, the defaults are now math=lua for LuaLaTeX and math=l3fp otherwise. The older options are still supported, but the newer ones are better and support scientific notation. - parsed formatted numbers and currency have their values embedded within the control sequence variable for easy access without having to reparse. Note that this affects expansion, which may cause a difference from v2.32. For example: \DTLparse\result{\$12,345.67} Original text: \result. Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}. Numeric value: \DTLdatumvalue{\result}. Currency symbol: \DTLdatumcurrency{\result}. In this case, \result will only expand as far as the original text. To fully expand use \DTLusedatum{\result}. - For databases that contain numeric values that will be used in calculations (including plotting), use \DTLsetup{store-datum} (before creating the database) to embed the numeric information within the database entries. This should improve build time but may impair fast data lookup of unique strings. - New multi-purpose \DTLaction command with key=value interface that may be used instead of the alternative commands with long names. - New sort functions that internally use \seq_sort:Nn for faster sorting. The old sort commands still work but the newer ones are more efficient. Note: the glossaries package uses the datatool-base sorting commands for \printnoidxglossary. If you are using that command you may notice a difference. Make sure you have at least glossaries v4.56 to take advantage of the improved sorting and new localisation support. - Localisation support has been added for orthography (alphabet order for word sorting) and for numeric parsing (currency symbols, number group separator and decimal character). Support for numeric parsing and currency is supplied by datatool-regions which needs to be installed separately. Support for orthography is supplied by the applicable language module, which needs to be installed separately. Currently only datatool-english is available. For example (assuming datatool v3.0, datatool-regions and datatool-english are all installed): \documentclass{article} \usepackage{fontspec} \setromanfont{Noto Serif} \usepackage[locales={en-BE,ang-Latn}]{datatool-base} \newcommand{\wordlist}{ýþung, eásteweard, áǽðan, Œthelwald, þorn, æsċ, eaþ-fynde, ðæt, Æðelþryð, aardvark, zebra, ƿēana, Oswine} \begin{document} Currency: \DTLdecimaltocurrency{1234.56}{\result}\result. \DTLenLocaleHook \DTLsortwordlist{\wordlist}{\DTLsortletterhandler} Sorted list: \DTLformatlist{\wordlist}. \DTLangLatnLocaleHook \DTLsortwordlist{\wordlist}{\DTLsortletterhandler} Sorted list: \DTLformatlist{\wordlist}. \DTLresetRegion \DTLresetLanguage Currency: \DTLdecimaltocurrency{1234.56}{\result}\result. \DTLsortwordlist{\wordlist}{\DTLsortletterhandler} Sorted list: \DTLformatlist{\wordlist}. \end{document} The result is: Currency: 1.234,56€. Sorted list: aardvark, Æðelþryð, æsċ, áǽðan, ðæt, eásteweard, eaþ-fynde, Œthelwald, Oswine, þorn, ƿēana, ýþung and zebra. Sorted list: aardvark, áǽðan, eásteweard, eaþ-fynde, Œthelwald, Oswine, ýþung, zebra, ƿēana, ðæt, æsċ, Æðelþryð ⁊ þorn. Currency: ¤1,234.56. Sorted list: aardvark, eaþ-fynde, eásteweard, Oswine, zebra, áǽðan, æsċ, Æðelþryð, ðæt, ýþung, þorn, Œthelwald & ƿēana.
This package is located at https://mirrors.ctan.org/macros/latex/contrib/datatool More information is at https://www.ctan.org/pkg/datatool
Thanks for the upload. For the CTAN Team Manfred Lotz CTAN is run entirely by volunteers and supported by TeX user groups. Please join a user group or donate to one, see https://ctan.org/lugs .
datatool – Tools to load and manipulate data
The tools comprise the packages:
- datatool-base.sty: the underlying base package used by all the other packages in this bundle;
- datatool.sty: databases may be created using LaTeX commands or by importing external files; they may be sorted numerically or alphabetically; repetitive operations (such as mail merging) may be performed on each row of a database, subject to conditions to exclude particular rows; commands are provided to examine database elements, and to convert formats (for example, to convert a numeric element to a format compatible with l3fp or the fp package;
- datapie.sty: a database may be represented as a pie chart; flexible options allow colouring of the chart, and annotation hooks are available;
- dataplot.sty: a database may be represented as a 2-dimensional scatter or line plot; flexible options control of the plot's overall appearance, and of legends and other extra information;
- databar.sty: a database may be represented as a bar chart; overall appearance, colouring and annotation are controllable;
- datagidx.sty: provides a way of indexing or creating glossaries/lists of abbreviations that uses TeX to do the sorting and collating instead of using an external indexing application, such as xindy or makeindex (although you may prefer \printnoidxglossary now provided by the glossaries package);
- databib.sty: a bibliography may be loaded into a datatool database, and manipulated there before being printed (this permits a LaTeX-based route to printing bibliographies in formats for which no BibTeX style is available, although biblatex is now the better route); and
- person.sty: provides support for displaying a person’s name and pronoun in a document, thus avoiding cumbersome use of “he/she”, etc.
The drawing packages make use of PGF/TikZ for their output.
Localisation support needs to be installed separately. See datatool-regions and datatool-english.
The bundle supersedes and replaces the author’s csvtools bundle.
Package | datatool |
Version | 3.4 2025-04-03 |
Copyright | 2007–2025 Nicola Talbot |
Maintainer | Nicola Talbot |