summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example156.tex
blob: 3045a11de4f3a11ee4183872e768c648aa718aa1 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% This file is embedded in glossaries-extra-manual.pdf
% Example 156 Using bib2gls: unit record counting mini-glossary
% arara: pdflatex
% arara: bib2gls: { recordcountunit: on }
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{scrreport}
\pagestyle{empty}
\begin{filecontents*}{abbrvs.bib}
@string{ssi={server-side includes}}
@string{html={hypertext markup language}} 

@abbreviation{shtml,
 short="shtml",
 long= ssi # " enabled " # html,
 description={a combination of \gls{html} and \gls{ssi}}
} 

@abbreviation{html,
 short ="html",
 long = html,
 description={a markup language for creating web pages}
} 

@abbreviation{ssi,
 short="ssi",
 long = ssi,
 description={a simple interpreted server-side scripting language}
}

@abbreviation{xml,
 short={xml}, long={extensible markup language}, description={a simple text-base format for representing structured information} }
\end{filecontents*}
\usepackage[T1]{fontenc}
\usepackage[colorlinks]{hyperref}
\usepackage[record,postdot,stylemods=longextra]{glossaries-extra} 

\renewcommand{\chapterpagestyle}{empty}% to assist cropping
\setabbreviationstyle{long-short-sc-desc} 

\newcommand*{\bibglssetlocationrecordcount}[4]{% 
 \GlsXtrSetField{#1}{recordcount.#2.#3}{#4}% 
 \provideignoredglossary{minigloss.#2.#3}% 
 \glsxtrcopytoglossary{#1}{minigloss.#2.#3}% 
} 

\GlsXtrLoadResources[src={abbrvs}] 

\renewcommand{\glslinkpresetkeys}{% 
 \glsadd[format=glsignore,counter=chapter]{\glslabel}}
\newcommand{\minigloss}{% 
 \printunsrtglossary*[style=abbr-short-long,type=minigloss.chapter.\theHchapter,groups=false,target=false]% 
 {\renewcommand{\glossarysection}[2][]{}% 
 \renewcommand{\glslongextraShortLongTabularHeader}{\toprule}% 
}} 
\begin{document}
\chapter{First} \minigloss \gls{html}. \gls{html}. \gls{html}. \gls{ssi}. 

\chapter{Second} \minigloss \gls{html}. \gls{ssi}. \gls{ssi}. \gls{xml}. 

\renewcommand*{\printunsrtglossaryentryprocesshook}[1]{% 
 \glsxtrifhasfield*{location}{#1}{}{\printunsrtglossaryskipentry}% 
}
\printunsrtglossaries 
\end{document}