diff options
author | Karl Berry <karl@freefriends.org> | 2018-11-03 21:11:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-11-03 21:11:01 +0000 |
commit | 75d35a09f72ec23912d8aa1b40dcbf674a91c398 (patch) | |
tree | c6bdec0150292bc936d76dd87049fe00452aba3a /Master/texmf-dist/doc/latex/biblatex/examples/97-annotations.tex | |
parent | f1dd9b42c3592316b29602acadfbce3f2d975424 (diff) |
biblatex (3nov18)
git-svn-id: svn://tug.org/texlive/trunk@49069 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/biblatex/examples/97-annotations.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex/examples/97-annotations.tex | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/biblatex/examples/97-annotations.tex b/Master/texmf-dist/doc/latex/biblatex/examples/97-annotations.tex new file mode 100644 index 00000000000..03be50f142c --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex/examples/97-annotations.tex @@ -0,0 +1,53 @@ +% +% This file demonstrates the data annotation feature +% +\documentclass[a4paper]{article} +\usepackage{fontspec} +\usepackage[american]{babel} +\usepackage{csquotes} +\usepackage{filecontents} +\begin{filecontents}{\jobname.bib} +@MISC{ann1, + AUTHOR = {Last1, First1 and Last2, First2 and Last3, First3}, + AUTHOR+an = {1:family=student;2=corresponding}, + TITLE = {The Title}, + TITLE+an:default = {=titleannotation}, + TITLE+an:french = {="Le titre"}, + TITLE+an:german = {="Der Titel"} +} +\end{filecontents} +\usepackage[backend=biber]{biblatex} +\addbibresource{\jobname.bib} + +\renewcommand*{\mkbibnamefamily}[1]{% + \ifitemannotation{corresponding} + {\textbf{#1}} + {#1}% + \ifpartannotation{family}{student} + {\textsuperscript{*}} + {}} + +% Default for numeric style so we are overriding the active format for titles +\DeclareFieldFormat{titlecase}{ + \iffieldannotation{titleannotation}{\textsc{#1}}{#1}% + \hasfieldannotation[][french]{\mkbibparens{\getfieldannotation[][french]}}{}% + \hasfieldannotation[][german]{\mkbibparens{\getfieldannotation[][german]}}{}} + +\begin{document} +The annotation feature allows the user to attache metadata, either in the +form of strings to be tested for in formatting commands, or in the form of +strings to be printed as-is. This example demonstrates all aspects of the +annotation feature: + +\begin{itemize} +\item Metadata attaching to fields, items in a list or parts of an item in + a list (e.g. name parts) +\item Literal annotations where the annotation is a string to be printed + rather than used as a metadata test for other formatting. +\item Multiple named annotations for the same data field. +\item The ``default'' name for annotations with no explicit name. +\end{itemize} + +\cite{ann1} +\printbibliography +\end{document} |