From 20e4f23a895d4b5fa56db3303e1fcb02ace51002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Thu, 17 Dec 2015 22:41:54 +0100 Subject: [PATCH] Add glossary example (#263) --- test/feature/completions/glossary.tex | 53 +++++++++++++++++++++++++++ test/feature/completions/latexmkrc | 9 +++++ test/feature/completions/main.tex | 22 ++++++++++- 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 test/feature/completions/glossary.tex create mode 100644 test/feature/completions/latexmkrc diff --git a/test/feature/completions/glossary.tex b/test/feature/completions/glossary.tex new file mode 100644 index 0000000..04a1e07 --- /dev/null +++ b/test/feature/completions/glossary.tex @@ -0,0 +1,53 @@ +\newglossary[gla]{gloss}{glb}{glc}{Glossar} +\newglossary[sya]{symbols}{syb}{syc}{Symbolverzeichnis} + +\makeglossaries + +\newglossaryentry{kv} +{ + type=gloss, + name=KV, + description={Kontrollvolumen} +} + +\newglossaryentry{dgl} +{ + type=gloss, + name=DGL, + description={Differentialgleichung} +} + +\newglossaryentry{agl} +{ + type=gloss, + name=AGL, + description={Algebraische Gleichung} +} + +\newglossaryentry{dichte} +{ + sort=1171, + type=symbols, + name={\ensuremath{\varrho}}, + description={ + Dichte, $[\varrho] = \frac{kg}{m^3}$ + } +} +\newglossaryentry{c} +{ + sort=0031, + type=symbols, + name={\ensuremath{c}}, + description={ + spezifische Wärmekapazität, $[c] = \frac{J}{kg\cdot K}$ + } +} +\newglossaryentry{C} +{ + sort=0030, + type=symbols, + name={\ensuremath{C_{th}}}, + description={ + Wärmekapazität, $[C_{th}] = \frac{J}{K}$ + } +} diff --git a/test/feature/completions/latexmkrc b/test/feature/completions/latexmkrc new file mode 100644 index 0000000..60712cb --- /dev/null +++ b/test/feature/completions/latexmkrc @@ -0,0 +1,9 @@ +add_cus_dep( 'glc', 'glb', 1, 'makeglc2glb' ); +add_cus_dep( 'syc', 'syb', 1, 'makesyc2syb' ); + +sub makeglc2glb { + system( "makeindex -s \"$_[0].ist\" -t \"$_[0].gla\" -o \"$_[0].glb\" \"$_[0].glc\"" ); +} +sub makesyc2syb { + system( "makeindex -s \"$_[0].ist\" -t \"$_[0].sya\" -o \"$_[0].syb\" \"$_[0].syc\"" ); +} diff --git a/test/feature/completions/main.tex b/test/feature/completions/main.tex index 19f55a1..74ecdd3 100644 --- a/test/feature/completions/main.tex +++ b/test/feature/completions/main.tex @@ -1,9 +1,14 @@ \documentclass{article} -\usepackage{biblatex} \usepackage{amsmath} + +\usepackage[backend=biber]{biblatex} \addbibresource{biblatex-examples.bib} \addbibresource{local1.bib} \addbibresource{~/.vim/bundle/vim-latex/test/completion/local2.bib} + +\usepackage[nonumberlist,acronymlists={gloss,symbolslist}]{glossaries} +\input{glossary.tex} + \begin{document} To test label completion you need to compile the document first! @@ -78,4 +83,19 @@ To test label completion you need to compile the document first! \end{align} \end{subequations} +\newpage +\glsaddall +\printglossary[ + type=gloss, + style=long, + title={Glossary}, + toctitle={Glossary} +] +\printglossary[ + type=symbols, + style=long, + title={List of Symbols}, + toctitle={List of Symbols} +] + \end{document}