summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-26 22:52:39 +0000
committerKarl Berry <karl@freefriends.org>2016-01-26 22:52:39 +0000
commit8d88e6714a570bf2b598132718ae2beb4641c80b (patch)
tree6d627fdd2263e73984a523aeaacd6b0aca1c358e /Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex
parent9b9abe02f86c766295512f6699dac2b40de6968c (diff)
glossaries-extra (24jan15)
git-svn-id: svn://tug.org/texlive/trunk@39487 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex')
-rw-r--r--Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex114
1 files changed, 114 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex
new file mode 100644
index 00000000000..a6e595d9493
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.tex
@@ -0,0 +1,114 @@
+% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+% arara: makeindex
+% arara: pdflatex
+\documentclass{report}
+
+\usepackage[T1]{fontenc}
+
+\usepackage{makeidx}
+\usepackage[abbreviations,counter=chapter,nopostdot=false]{glossaries-extra}
+
+\renewcommand*{\abbreviationsname}{List of Abbreviations}
+\renewcommand*{\glossarypreamble}{\emph{Numbers refer to the chapter
+where the entry was referenced.}}
+
+\makeindex
+\makeglossaries
+
+% Automatically index the location of entry in the glossary
+% for those entries that are in the "general" category:
+
+\glssetcategoryattribute{general}{indexname}{textbf}
+\glssetcategoryattribute{general}{dualindex}{true}
+
+% Only index first use for the glossary location lists
+% (doesn't affect the indexing from "dualindex" attribute):
+%\glssetcategoryattribute{general}{indexonlyfirst}{true}
+
+% Automatically index the location of entry in the glossary
+% for those entries that are in the "abbreviation" category
+% and use "textbf" as the encap:
+
+\glssetcategoryattribute{abbreviation}{indexname}{textbf}
+\glssetcategoryattribute{abbreviation}{dualindex}{true}
+
+% Only index first use for the glossary location lists
+% (doesn't affect the indexing from "dualindex" attribute):
+%\glssetcategoryattribute{abbreviation}{indexonlyfirst}{true}
+
+% Convert the first letter of the name to upper case in the
+% glossary for general entries:
+\glssetcategoryattribute{general}{glossname}{firstuc}
+
+% Allow "format" key to override "dualindex" attribute.
+\GlsXtrEnableIndexFormatOverride
+
+% Define general entries:
+
+\newglossaryentry{duck}{name=duck,%
+ description={a waterbird with webbed feet}}
+
+\newglossaryentry{parrot}{name=parrot,%
+ description={mainly tropical bird with bright plumage}}
+
+\newglossaryentry{at}{name={@},%
+ description={makeindex's default for the ``actual value''}}
+
+\newglossaryentry{esc}{name={"},%
+ description={makeindex's default for the ``escape value''}}
+
+\newglossaryentry{encap}{name={|},%
+ description={makeindex's default for the ``encap value''}}
+
+% Set abbreviation style:
+
+\setabbreviationstyle{long-short-sc}
+
+% Define abbreviations:
+
+\newabbreviation
+ {html}% identifying label
+ {html}% short form
+ {hypertext markup language}% long form
+
+\newabbreviation
+ {xml}% identifying label
+ {xml}% short form
+ {extensible markup language}% long form
+
+\title{Sample document testing the glossaries-extra package}
+\author{Nicola Talbot}
+
+\begin{document}
+\maketitle
+
+\chapter{Introduction}
+
+This is a sample\index{sample} document testing the
+\texttt{glossaries-extra} package.
+
+\chapter{General Entries}
+
+Sample entries: \gls{duck} and \gls{parrot}.
+
+Test makeindex's special characters: \gls{at} (actual)
+\gls{esc} (escape) and \gls{encap} (encap).
+
+\chapter{Abbreviations}
+
+First use: \gls{html} and \gls{xml}.
+
+Next use: \gls{html} and \gls{xml}.
+
+\newpage
+
+Uses some entries again: \gls{duck} and \gls[format=textit]{parrot}.
+
+\printglossaries
+
+\printindex
+
+\end{document}
+