| 1 |
% |
| 2 |
% This file demonstrates the multiscript features |
| 3 |
% |
| 4 |
\documentclass[a4paper]{article} |
| 5 |
\usepackage{fontspec} |
| 6 |
\setmainfont{Linux Libertine O} |
| 7 |
\setsansfont{Linux Biolinum O} |
| 8 |
|
| 9 |
\usepackage[russian,greek,french,german,main=english]{babel} |
| 10 |
\usepackage{csquotes} |
| 11 |
\begin{filecontents}[force]{\jobname.bib} |
| 12 |
@BOOK{mstest, |
| 13 |
AUTHOR = {Bill Smith and Пушкин, Александр}, |
| 14 |
AUTHOR+an:mslang = {2="ru"}, |
| 15 |
AUTHOR_transliteration_el = {Bill Smith and Πούσκιν, Ἀλεξάντρ}, |
| 16 |
AUTHOR_transliteration_el+an:mslang = {1="en"}, |
| 17 |
LOCATION = {locationa and Standort"s}, |
| 18 |
LOCATION+an:mslang = {2="de"}, |
| 19 |
LOCATION_translation_fr = {emplacementa and Standortb}, |
| 20 |
LOCATION_translation_fr+an:mslang = {2="de"}, |
| 21 |
TITLE = {Title}, |
| 22 |
TITLE_translation_fr = {Titre}, |
| 23 |
DATE = {1995} |
| 24 |
} |
| 25 |
\end{filecontents} |
| 26 |
\usepackage[style=authoryear,% |
| 27 |
dynamiclabel=true,% |
| 28 |
language=auto,% |
| 29 |
autolang=other,% |
| 30 |
autofieldlang=other]{biblatex-ms} |
| 31 |
\addbibresource{\jobname.bib} |
| 32 |
|
| 33 |
\begin{document} |
| 34 |
% Here we are citing and printing the bibliography using data contained in |
| 35 |
% the entryfields of alternate msform="default" and mslang="en" (due to the |
| 36 |
% main babel language of "english" which maps to "en") |
| 37 |
\cite{mstest} |
| 38 |
|
| 39 |
% Due to "autofieldlang=other" and the langtags annotation for the default author |
| 40 |
% name field, the second, russian name in the author field is automatically printed inside |
| 41 |
% a babel \otherlanguage{russian} context where additionally, all biblatex russian bibstrings |
| 42 |
% are activated |
| 43 |
|
| 44 |
% Inside the name format which \printnames uses, macros are automatically defined for every |
| 45 |
% alternate of the current name list item. This means when printing the first name in the author |
| 46 |
% list, in addition to the usual \namepartfamily, \namepartgiven etc. macros, also available are: |
| 47 |
|
| 48 |
% \namepartfamilydefaulten={Smith} |
| 49 |
% \namepartfamilydefaulteni={S\bibinitperiod} |
| 50 |
% \namepartgivendefaulten={Bill} |
| 51 |
% \namepartgivendefaulteni={B\bibinitperiod} |
| 52 |
% \namepartfamilytransliterationen={Smith} |
| 53 |
% \namepartfamilytransliterationeni={S\bibinitperiod} |
| 54 |
% \namepartgiventransliterationen={Bill} |
| 55 |
% \namepartgiventransliterationeni={B\bibinitperiod} |
| 56 |
|
| 57 |
% and for the second name, also available are: |
| 58 |
|
| 59 |
% \namepartfamilydefaultru={Пушкин}, |
| 60 |
% \namepartfamilydefaultrui={П\bibinitperiod}, |
| 61 |
% \namepartgivendefaultru={Александр}, |
| 62 |
% \namepartgivendefaultrui={А\bibinitperiod}, |
| 63 |
% \namepartfamilytransliterationel={Πούσκιν}, |
| 64 |
% \namepartfamilytransliterationeli={Π\bibinitperiod}, |
| 65 |
% \namepartgiventransliterationel={Ἀλεξάντρ}, |
| 66 |
% \namepartgiventransliterationeli={Ἀ\bibinitperiod} |
| 67 |
|
| 68 |
|
| 69 |
% The location list is in the context of a babel "english" otherlanguage environment |
| 70 |
% (the global default) but the second item in the list is switched to the \otherlanguage{german} |
| 71 |
% due to the langtags annotation and you can see this by the use of the german "s babel shorthand |
| 72 |
% being correctly interpreted |
| 73 |
|
| 74 |
% Inside the list format which \printlist uses, macros are automatically defined for every |
| 75 |
% alternate of the current plain list item. This means when printing the first item in the location |
| 76 |
% list, also available are: |
| 77 |
|
| 78 |
% \listitemdefaulten={locationa} |
| 79 |
% \listitemtranslationfr={emplacementa} |
| 80 |
|
| 81 |
% and for the second list item, also available are: |
| 82 |
|
| 83 |
% \listitemdefaultde={Standort"s} |
| 84 |
% \listitemtranslationde={Standortb} |
| 85 |
|
| 86 |
% The translated french alternate of the location list could be printed in a driver |
| 87 |
% using \printlist[][][translated][fr]{location} and this would automatically (due to |
| 88 |
% autofieldlang=other) be inside a \otherlanguage{french} environment with all french biblatex |
| 89 |
% bibstrings being activated. |
| 90 |
\printbibliography |
| 91 |
|
| 92 |
% Here we are citing and printing the bibliography using data contained in |
| 93 |
% the entryfields of alternate msform="transliteration" and mslang="el" |
| 94 |
\begin{refcontext}[msform=transliteration,mslang=el] |
| 95 |
|
| 96 |
% Notice that due to the "dynamiclabel=true" option, the labelname printed in the citation |
| 97 |
% is not the static labelname as determined by \DeclareLabelname but the alternate |
| 98 |
% of the labelname determined by the current (refcontext) msform/mslang options |
| 99 |
\cite{mstest} |
| 100 |
|
| 101 |
% Note that the default msform/mslang used to determine which alternates to print in the |
| 102 |
% bibliography for multiscript entryfields are determined by the current (refcontext) |
| 103 |
% msform/mslang options |
| 104 |
|
| 105 |
% Note that the "and" in the name list is in Greek. This is because the "autofieldlang" |
| 106 |
% is set to "other", which automatically loads the greek language strings for the whole |
| 107 |
% msform=transliteration/mslang=el author field. This alternate is being printed due to |
| 108 |
% the refcontext settings for msform and mslang. |
| 109 |
|
| 110 |
% Note also that due to "autofieldlang=other" and the langtags annotation for the first, english |
| 111 |
% name in the transliterated greek author name list, this english name is automatically printed |
| 112 |
% inside a babel \otherlanguage{english} context where additionally, all biblatex english |
| 113 |
% bibstrings are activated |
| 114 |
|
| 115 |
% No location field is printed in the bibliography because there is no transliterated greek |
| 116 |
% alternate for this field, only a translated french alternate. The same applied to the title |
| 117 |
% field |
| 118 |
\printbibliography |
| 119 |
\end{refcontext} |
| 120 |
\end{document} |