Debian Codegraph @

texmf-dist/doc/latex/datatool/datatool-user-examples/datatool-user-example011.tex

raw
1 % This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04
2 % Example 11 IJ-Initial Support
3 % Label: "ex:ijinitial"
4 % arara: pdflatex
5 % arara: pdfcrop
6 \documentclass[12pt]{article}
7 \pagestyle{empty}
8 \usepackage{datatool-base}
9 \ExplSyntaxOn
10 \newcommand{\DTLdutchLocaleGetInitialLetter}[2]{
11 \tl_clear:N #2
12 \text_map_inline:nn { #1 }
13 {
14 \tl_if_empty:NTF #2
15 {
16 \datatool_if_letter:nT { ##1 }
17 {
18 \tl_set:Nn #2 { ##1 }
19 \tl_if_in:nnF { Ii } { ##1 } { \text_map_break: }
20 }
21 }
22 {
23 \tl_if_in:nnT { Jj } { ##1 }
24 {
25 \tl_put_right:Nn #2 { ##1 }
26 }
27 \text_map_break:
28 }
29 }
30 }
31 \ExplSyntaxOff
32
33 \let\DTLCurrentLocaleGetInitialLetter\DTLdutchLocaleGetInitialLetter
34 \begin{document}
35 IJsselmeer: \DTLinitials{IJsselmeer}
36 Industrieel: \DTLinitials{Industrieel}
37 ``IJsselmeer'': \DTLinitials{``IJsselmeer''}
38 ``Industrieel'': \DTLinitials{``Industrieel''}
39 \end{document}