summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-ms/doc/examples/98-multiscript-ms.tex
blob: da65ed9d8339e99bed04954e80f75090142cc573 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
%
% This file demonstrates the multiscript features
%
\documentclass[a4paper]{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}

\usepackage[russian,greek,french,german,main=english]{babel}
\usepackage{csquotes}
\begin{filecontents}[force]{\jobname.bib}
@BOOK{mstest,
  AUTHOR                                     = {Bill Smith and Пушкин, Александр},
  AUTHOR+an:mslang                           = {2="ru"},
  AUTHOR_transliteration_el                  = {Bill Smith and Πούσκιν, Ἀλεξάντρ},
  AUTHOR_transliteration_el+an:mslang        = {1="en"},
  LOCATION                                   = {locationa and Standort"s},
  LOCATION+an:mslang                         = {2="de"},
  LOCATION_translation_fr                    = {emplacementa and Standortb},
  LOCATION_translation_fr+an:mslang          = {2="de"},
  TITLE                                      = {Title},
  TITLE_translation_fr                       = {Titre},
  DATE                                       = {1995}
}
\end{filecontents}
\usepackage[style=authoryear,%
            dynamiclabel=true,%
            language=auto,%
            autolang=other,%
            autofieldlang=other]{biblatex-ms}
\addbibresource{\jobname.bib}

\begin{document}
% Here we are citing and printing the bibliography using data contained in
% the entryfields of alternate msform="default" and mslang="en" (due to the
% main babel language of "english" which maps to "en")
\cite{mstest}

% Due to "autofieldlang=other" and the langtags annotation for the default author
% name field, the second, russian name in the author field is automatically printed inside
% a babel \otherlanguage{russian} context where additionally, all biblatex russian bibstrings
% are activated

% Inside the name format which \printnames uses, macros are automatically defined for every
% alternate of the current name list item. This means when printing the first name in the author
% list, in addition to the usual \namepartfamily, \namepartgiven etc. macros, also available are:

% \namepartfamilydefaulten={Smith}
% \namepartfamilydefaulteni={S\bibinitperiod}
% \namepartgivendefaulten={Bill}
% \namepartgivendefaulteni={B\bibinitperiod}
% \namepartfamilytransliterationen={Smith}
% \namepartfamilytransliterationeni={S\bibinitperiod}
% \namepartgiventransliterationen={Bill}
% \namepartgiventransliterationeni={B\bibinitperiod}

% and for the second name, also available are:

% \namepartfamilydefaultru={Пушкин},
% \namepartfamilydefaultrui={П\bibinitperiod},
% \namepartgivendefaultru={Александр},
% \namepartgivendefaultrui={А\bibinitperiod},
% \namepartfamilytransliterationel={Πούσκιν},
% \namepartfamilytransliterationeli={Π\bibinitperiod},
% \namepartgiventransliterationel={Ἀλεξάντρ},
% \namepartgiventransliterationeli={Ἀ\bibinitperiod}


% The location list is in the context of a babel "english" otherlanguage environment
% (the global default) but the second item in the list is switched to the \otherlanguage{german}
% due to the langtags annotation and you can see this by the use of the german "s babel shorthand
% being correctly interpreted

% Inside the list format which \printlist uses, macros are automatically defined for every
% alternate of the current plain list item. This means when printing the first item in the location
% list, also available are:

% \listitemdefaulten={locationa}
% \listitemtranslationfr={emplacementa}

% and for the second list item, also available are:

% \listitemdefaultde={Standort"s}
% \listitemtranslationde={Standortb}

% The translated french alternate of the location list could be printed in a driver
% using \printlist[][][translated][fr]{location} and this would automatically (due to
% autofieldlang=other) be inside a \otherlanguage{french} environment with all french biblatex
% bibstrings being activated.
\printbibliography

% Here we are citing and printing the bibliography using data contain in
% the entryfields of alternate msform="transliteration" and mslang="el"
\begin{refcontext}[msform=transliteration,mslang=el]

  % Notice that due to the "dynamiclabel=true" option, the labelname printed in the citation
  % is not the static labelname as determined by \DeclareLabelname but the alternate
  % of the labelname determined by the current (refcontext) msform/mslang options
  \cite{mstest}

  % Note that the default msform/mslang used to determine which alternates to print in the
  % bibliography for multiscript entryfields are determined by the current (refcontext)
  % msform/mslang options

  % Note that the "and" in the name list is in Greek. This is because the "autofieldlang"
  % is set to "other", which automatically loads the greek language strings for the whole
  % msform=transliteration/mslang=el author field. This alternate is being printed due to
  % the refcontext settings for msform and mslang.

  % Note also that due to "autofieldlang=other" and the langtags annotation for the first, english
  % name in the transliterated greek author name list, this english name is automatically printed
  % inside a babel \otherlanguage{english} context where additionally, all biblatex english
  % bibstrings are activated

  % No location field is printed in the bibliography because there is no transliterated greek
  % alternate for this field, only a translated french alternate. The same applied to the title
  % field
  \printbibliography
\end{refcontext}
\end{document}