diff options
Diffstat (limited to 'macros/latex/contrib/glossaries/samples/sample-font-abbr.tex')
-rw-r--r-- | macros/latex/contrib/glossaries/samples/sample-font-abbr.tex | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/macros/latex/contrib/glossaries/samples/sample-font-abbr.tex b/macros/latex/contrib/glossaries/samples/sample-font-abbr.tex new file mode 100644 index 0000000000..c7b04e192b --- /dev/null +++ b/macros/latex/contrib/glossaries/samples/sample-font-abbr.tex @@ -0,0 +1,63 @@ + % arara: pdflatex + % arara: makeglossaries + % arara: pdflatex +\documentclass{article} + +\usepackage{glossaries} + +\makeglossaries + +\glsaddstoragekey{font}{}{\entryfont} + +\newacronymstyle{long-font-short} +{% + \GlsUseAcrEntryDispStyle{long-short}% +} +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand*{\genacrfullformat}[2]{% + \glsentrylong{##1}##2\space + ({\entryfont{##1}\glsentryshort{##1}})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \Glsentrylong{##1}##2\space + ({\entryfont{##1}\glsentryshort{##1}})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsentrylongpl{##1}##2\space + ({\entryfont{##1}\glsentryshortpl{##1}})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \Glsentrylongpl{##1}##2\space + ({\entryfont{##1}\glsentryshortpl{##1}})% + }% + \renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}##1}}% + \renewcommand*{\acronymentry}[1]{{\entryfont{##1}\glsentryshort{##1}}}% +} + +\setacronymstyle{long-font-short} + +\newcommand*{\newitabbr}[1][]{\newacronym[font=\em,#1]} +\newcommand*{\newupabbr}[1][]{\newacronym[#1]} + +\newitabbr{eg}{e.g.}{exempli gratia} +\newitabbr{ie}{i.e.}{id est} + +\newupabbr{bsc}{BSc}{Bachelor of Science} +\newupabbr{ba}{BA}{Bachelor of Arts} +\newupabbr{agm}{AGM}{annual general meeting} + +\begin{document} + +First use: \gls{eg} \gls{ie} \gls{bsc} \gls{ba} \gls{agm}. + +Next use: \gls{eg} \gls{ie} \gls{bsc} \gls{ba} \gls{agm}. + +Short: \acrshort{eg} \acrshort{ie} \acrshort{bsc} \acrshort{ba} +\acrshort{agm}. + +Full: \acrfull{eg} \acrfull{ie} \acrfull{bsc} \acrfull{ba} +\acrfull{agm}. + +\printglossaries +\end{document} |