CTAN update: datatool

Liste des GroupesRevenir à ct tex 
Sujet : CTAN update: datatool
De : manfred (at) *nospam* ctan.org (CTAN Announcements)
Groupes : comp.text.tex
Date : 05. Mar 2025, 07:23:46
Autres entêtes
Organisation : CTAN
Message-ID : <aafaffc5-6d77-4afe-bebc-a2f7eec2f2c5@ctan.org>
User-Agent : Mozilla Thunderbird
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 .


Date Sujet#  Auteur
5 Mar 25 * CTAN update: datatool2CTAN Announcements
5 Mar 25 `- Re: CTAN update: datatool1Nicola Talbot

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal