| 1 |
% This file is embedded in glossaries-extra-manual.pdf |
| 2 |
% Example 161 Using bib2gls: unit record counting mini-glossary |
| 3 |
% Label: "ex:recordcountminigloss" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: bib2gls: { recordcountunit: on } |
| 6 |
% arara: pdflatex |
| 7 |
% arara: pdfcrop |
| 8 |
\documentclass[12pt]{scrreport} |
| 9 |
\pagestyle{empty} |
| 10 |
\begin{filecontents*}{abbrvs.bib} |
| 11 |
@string{ssi={server-side includes}} |
| 12 |
@string{html={hypertext markup language}} |
| 13 |
|
| 14 |
@abbreviation{shtml, |
| 15 |
short="shtml", |
| 16 |
fulllong = ssi # " enabled " # html, |
| 17 |
nestedlong = "\glsps{ssi} enabled \glsps{html}", |
| 18 |
description={a combination of \gls{html} and \gls{ssi}} |
| 19 |
} |
| 20 |
|
| 21 |
@abbreviation{html, |
| 22 |
short ="html", |
| 23 |
long = html, |
| 24 |
description={a markup language for creating web pages} |
| 25 |
} |
| 26 |
|
| 27 |
@abbreviation{ssi, |
| 28 |
short="ssi", |
| 29 |
long = ssi, |
| 30 |
description={a simple interpreted server-side scripting language} |
| 31 |
} |
| 32 |
|
| 33 |
@abbreviation{xml, |
| 34 |
short={xml}, |
| 35 |
long={extensible markup language}, |
| 36 |
description={a simple text-base format for representing structured information} |
| 37 |
} |
| 38 |
|
| 39 |
@abbreviation{mathml, |
| 40 |
short={m\BibGlsNoCaseChange{ath}ml}, |
| 41 |
long={mathematical markup language}, |
| 42 |
description={an \gls{xml}-based language for describing mathematical notation} |
| 43 |
} |
| 44 |
\end{filecontents*} |
| 45 |
\usepackage[T1]{fontenc} |
| 46 |
\usepackage{kpfonts} |
| 47 |
\usepackage[colorlinks]{hyperref} |
| 48 |
\usepackage[record,postdot,stylemods=longextra]{glossaries-extra} |
| 49 |
|
| 50 |
\renewcommand{\chapterpagestyle}{empty}% to assist cropping |
| 51 |
\setabbreviationstyle{long-short-sc-desc} |
| 52 |
|
| 53 |
\newcommand*{\bibglssetlocationrecordcount}[4]{% |
| 54 |
\GlsXtrSetField{#1}{recordcount.#2.#3}{#4}% |
| 55 |
\provideignoredglossary{minigloss.#2.#3}% |
| 56 |
\glsxtrcopytoglossary{#1}{minigloss.#2.#3}% |
| 57 |
} |
| 58 |
|
| 59 |
\GlsXtrLoadResources[src={abbrvs}, |
| 60 |
field-aliases={fulllong=long} |
| 61 |
] |
| 62 |
|
| 63 |
\renewcommand{\glslinkpresetkeys}{% |
| 64 |
\glsadd[format=glsignore,counter=chapter]{\glslabel}} |
| 65 |
\newcommand{\minigloss}{% |
| 66 |
\printunsrtglossary*[style=abbr-short-long,type=minigloss.chapter.\theHchapter,groups=false,target=false]% |
| 67 |
{\renewcommand{\glossarysection}[2][]{}% |
| 68 |
\renewcommand{\glslongextraShortLongTabularHeader}{\toprule}% |
| 69 |
}} |
| 70 |
\begin{document} |
| 71 |
\chapter{First} \minigloss \gls{html}. \gls{html}. \gls{html}. \gls{ssi}. |
| 72 |
|
| 73 |
\chapter{Second} \minigloss \gls{html}. \gls{ssi}. \gls{ssi}. \gls{xml}. |
| 74 |
|
| 75 |
\renewcommand*{\printunsrtglossaryentryprocesshook}[1]{% |
| 76 |
\glsxtrifhasfield*{location}{#1}{}{\printunsrtglossaryskipentry}% |
| 77 |
} |
| 78 |
\printunsrtglossaries |
| 79 |
\end{document} |