summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/samples/sample-langdict.tex
blob: f7675f8b6c638c67ea63bfa039695f779ac04c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
\documentclass[english,french]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[nomain]{glossaries}

\newglossary[glg]{english}{gls}{glo}{English to French}
\newglossary[flg]{french}{fls}{flo}{French to English}

\makeglossaries

 % \newword{label}{english}{determiner}{french}
\newcommand*{\newword}[4]{%
   \newglossaryentry{en-#1}{type=english,name={#2},description={#3 #4}}%
   \newglossaryentry{fr-#1}{type=french,name={#3 #4},text={#4},sort={#4},description={#2}}%
}

\newword{cat}{cat}{le}{chat}
\newword{mat}{mat}{la}{natte}

\begin{document}
\selectlanguage{english}
The \gls{en-cat} sat on the \gls{en-mat}.

\selectlanguage{french}
Le \gls{fr-cat} s'est repos\'e sur la \gls{fr-mat}.

\selectlanguage{english}
\printglossary[type=english]

\selectlanguage{french}
\printglossary[type=french]
\end{document}