Start with the dictionary environment
Use datatool to create database of entries and print them sorted.
This commit is contained in:
commit
d7d4107505
1 changed files with 21 additions and 0 deletions
21
dictionary.sty
Normal file
21
dictionary.sty
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
|
\ProvidesPackage{dictionary}[2024/11/24 Dictionary]
|
||||||
|
|
||||||
|
\RequirePackage{babel}
|
||||||
|
\RequirePackage{datatool}
|
||||||
|
|
||||||
|
\newcommand{\entry}[2]{%
|
||||||
|
\DTLnewrow{dictionary}%
|
||||||
|
\DTLnewdbentry{dictionary}{word}{#1}%
|
||||||
|
\DTLnewdbentry{dictionary}{translation}{#2}%
|
||||||
|
}
|
||||||
|
|
||||||
|
\newenvironment{dictionary}{%
|
||||||
|
\DTLifdbexists{dictionary}{\DTLcleardb{dictionary}}{\DTLnewdb{dictionary}}%
|
||||||
|
}{%
|
||||||
|
\DTLsort{word}{dictionary}%
|
||||||
|
\scriptsize%
|
||||||
|
\DTLforeach*{dictionary}{\word=word,\translation=translation}{%
|
||||||
|
\selectlanguage{vietnamese}\textbf{\word:} \selectlanguage{naustrian}\translation\\}%
|
||||||
|
\selectlanguage{vietnamese}%
|
||||||
|
}
|
Loading…
Reference in a new issue