summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/bib2gls/examples/sample-media.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/support/bib2gls/examples/sample-media.tex')
-rw-r--r--Master/texmf-dist/doc/support/bib2gls/examples/sample-media.tex66
1 files changed, 66 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/bib2gls/examples/sample-media.tex b/Master/texmf-dist/doc/support/bib2gls/examples/sample-media.tex
new file mode 100644
index 00000000000..b04b93241bb
--- /dev/null
+++ b/Master/texmf-dist/doc/support/bib2gls/examples/sample-media.tex
@@ -0,0 +1,66 @@
+% This file is public domain. See the "Examples" chapter
+% in the bib2gls user manual for a more detailed description
+% of this file.
+
+\documentclass[11pt,a4paper]{report}
+
+\usepackage[T1]{fontenc}
+\usepackage[colorlinks]{hyperref}
+\usepackage[record,% using bib2gls
+ nostyles,% don't load default styles
+ postdot,% append a dot after descriptions
+ stylemods={list},% load glossary-list.sty and fix styles
+ style=altlistgroup]{glossaries-extra}
+
+\GlsXtrLoadResources[
+ src=no-interpret-preamble,
+ interpret-preamble=false
+]
+
+\GlsXtrLoadResources[
+ src={interpret-preamble,books,films},
+ field-aliases={identifier=category,year=user1,cast=user2},
+ bibtex-contributor-fields={user2},
+ contributor-order={forenames},
+ identical-sort-action={category},
+ save-locations=false,
+ selection=all
+]
+
+% requires datatool-base.sty v2.28+:
+\renewcommand*{\DTLlistformatoxford}{,}
+\renewcommand*{\DTLandname}{and}
+
+\newcommand*{\bookfont}[1]{\emph{#1}}
+\newcommand*{\filmfont}[1]{\textsf{\em #1}}
+
+\glssetcategoryattribute{book}{textformat}{bookfont}
+\glssetcategoryattribute{book}{glossnamefont}{bookfont}
+
+\glssetcategoryattribute{film}{textformat}{filmfont}
+\glssetcategoryattribute{film}{glossnamefont}{filmfont}
+
+\newcommand*{\glsxtrpostnamebook}{%
+ \ifglshasfield{user1}{\glscurrententrylabel}%
+ {\space(published \glscurrentfieldvalue)}%
+ {}%
+}
+
+\newcommand*{\glsxtrpostnamefilm}{%
+ \ifglshasfield{user1}{\glscurrententrylabel}%
+ {\space (released \glscurrentfieldvalue)}%
+ {}%
+}
+
+\newcommand*{\glsxtrpostdescfilm}{%
+ \ifglshasfield{user2}{\glscurrententrylabel}%
+ {%
+ \glsxtrrestorepostpunc % requires glossaries-extra v1.23+
+ \ featuring \glscurrentfieldvalue
+ }%
+ {}%
+}
+
+\begin{document}
+\printunsrtglossaries
+\end{document}