From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 support/bib2gls/examples/sample-media.tex | 66 +++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 support/bib2gls/examples/sample-media.tex

(limited to 'support/bib2gls/examples/sample-media.tex')

diff --git a/support/bib2gls/examples/sample-media.tex b/support/bib2gls/examples/sample-media.tex
new file mode 100644
index 0000000000..b04b93241b
--- /dev/null
+++ b/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}
-- 
cgit v1.2.3

