| 1 |
\documentclass[a4paper,10pt]{article} |
| 2 |
\usepackage[margin=2cm]{geometry} |
| 3 |
\usepackage{fontspec} |
| 4 |
\defaultfontfeatures{%Mapping=tex-text, |
| 5 |
Ligatures=TeX, |
| 6 |
% Scale=MatchLowercase, |
| 7 |
} |
| 8 |
\usepackage{luatexbase} |
| 9 |
\setmainfont{CMU Serif} |
| 10 |
\setsansfont{CMU Sans Serif} |
| 11 |
\setmonofont{CMU Typewriter Text} |
| 12 |
|
| 13 |
\usepackage[british,american,spanish,greek,french,german,polish,english,russian]{babel} |
| 14 |
\usepackage{csquotes} |
| 15 |
\usepackage{multicol} |
| 16 |
\usepackage{fancyvrb} |
| 17 |
\usepackage{color} |
| 18 |
\usepackage{xpatch} |
| 19 |
\definecolor{spot}{rgb}{0,0.2,0.6} |
| 20 |
\usepackage[colorlinks,allcolors=spot,bookmarksopen=true,pdfstartview=FitH]{hyperref} |
| 21 |
\usepackage[parentracker=true, |
| 22 |
backend=biber, |
| 23 |
hyperref=auto, |
| 24 |
language=auto, |
| 25 |
autolang=other, |
| 26 |
citestyle=gost-numeric, |
| 27 |
defernumbers=true, |
| 28 |
bibstyle=gost-footnote, |
| 29 |
]{biblatex} |
| 30 |
\addbibresource{biblatex-gost-examples.bib} |
| 31 |
|
| 32 |
% Russian sources first |
| 33 |
\DeclareSourcemap{ |
| 34 |
\maps[datatype=bibtex]{ |
| 35 |
\map{ |
| 36 |
\step[fieldset=langid, fieldvalue={tempruorder}] |
| 37 |
} |
| 38 |
\map[overwrite]{ |
| 39 |
\step[fieldsource=langid, match=russian, final] |
| 40 |
\step[fieldsource=presort, match=\regexp{(.+)}, replace=\regexp{aa$1}] %$ |
| 41 |
} |
| 42 |
\map{ |
| 43 |
\step[fieldsource=langid, match=russian, final] |
| 44 |
\step[fieldset=presort, fieldvalue={az}] |
| 45 |
} |
| 46 |
\map[overwrite]{ |
| 47 |
\step[fieldsource=langid, notmatch=russian, final] |
| 48 |
\step[fieldsource=presort, match=\regexp{(.+)}, replace=\regexp{za$1}] %$ |
| 49 |
} |
| 50 |
\map{ |
| 51 |
\step[fieldsource=langid, notmatch=russian, final] |
| 52 |
} |
| 53 |
\map{ |
| 54 |
\step[fieldsource=langid, match={tempruorder}, final] |
| 55 |
\step[fieldset=langid, null] |
| 56 |
} |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
\tolerance=1500 |
| 61 |
|
| 62 |
\xpatchbibmacro{related:default} |
| 63 |
{\renewbibmacro*{pageref}{}} |
| 64 |
{\renewbibmacro*{pageref}{}\renewbibmacro*{begentry}{}}{}{} |
| 65 |
\renewbibmacro*{begentry} |
| 66 |
{\hspace{-4em}\makebox[4em]{\hyperlink{\thefield{entrykey}}{$\Downarrow$}}% |
| 67 |
\raisebox{\baselineskip}{\hypertarget{back:\thefield{entrykey}}{}}}% |
| 68 |
\edef\mytempforAtCharacter{\char64} |
| 69 |
\def\getkey#1#2{% |
| 70 |
\csappto{mytempforbibkey}{#1}% |
| 71 |
\ifstrequal{#2}{,} |
| 72 |
{\hspace{-4em}\makebox[4em]{\hyperlink{back:\mytempforbibkey}{$\Uparrow$}}% |
| 73 |
\raisebox{\baselineskip}{\hypertarget{\mytempforbibkey}{}}% |
| 74 |
\mytempforAtCharacter\mytempforbibtype\{\mytempforbibkey,} |
| 75 |
{\getkey#2}% |
| 76 |
} |
| 77 |
\renewcommand*{\do}[1]{\csdef{#1}##1{\def\mytempforbibtype{#1}\def\mytempforbibkey{}\getkey}} |
| 78 |
\docsvlist{MVBOOK,BOOK,INBOOK,SUPPBOOK,BOOKINBOOK,MVCOLLECTION,COLLECTION,INCOLLECTION,SUPPCOLLECTION,MVREFERENCE,REFERENCE,INREFERENCE,MVPROCEEDINGS,PROCEEDINGS,INPROCEEDINGS,PERIODICAL,ARTICLE,PATENT,ONLINE,THESIS,mvbook,book,inbook,suppbook,bookinbook,mvcollection,collection,incollection,suppcollection,mvreference,reference,inreference,mvproceedings,proceedings,inproceedings,periodical,article,patent,online,thesis,Article,Book,MVBook,InBook,BookInBook,SuppBook,Booklet,Collection,MVCollection,InCollection,SuppCollection,Manual,Misc,Online,Patent,Periodical,SuppPeriodical,Proceedings,MVProceedings,InProceedings,Reference,MVReference,InReference,Report,Thesis,Unpublished} |
| 79 |
\renewcommand*{\do}[1]{\csdef{#1}##1{\mytempforAtCharacter #1\{}} |
| 80 |
\docsvlist{XDATA,COMMENT,xdata,comment,} |
| 81 |
|
| 82 |
\makeatletter |
| 83 |
\title{Biblatex-GOST examples\thanks{Version~\bbx@gost@version.}} |
| 84 |
\makeatother |
| 85 |
\author{Oleg Domanov\thanks{[email protected]}} |
| 86 |
|
| 87 |
\defbibcheck{related}{% |
| 88 |
\iffieldundef{related}{\skipentry}{}} |
| 89 |
\defbibcheck{norelated}{% |
| 90 |
\iffieldundef{related}{}{\skipentry}} |
| 91 |
|
| 92 |
\begin{document} |
| 93 |
\selectlanguage{english} |
| 94 |
\maketitle |
| 95 |
Examples are grouped according to their entrytypes. The types themselves are the following |
| 96 |
(click to go to the respective bibliography section): |
| 97 |
\renewcommand*{\do}[1]{\hyperref[#1]{@#1}\\} |
| 98 |
\begin{multicols}{5} |
| 99 |
\noindent% |
| 100 |
\docsvlist{mvbook,book,inbook,suppbook,bookinbook,mvcollection,collection,incollection,suppcollection,mvreference,reference,inreference,mvproceedings,proceedings,inproceedings,periodical,article,patent,online,thesis} |
| 101 |
\end{multicols} |
| 102 |
|
| 103 |
See also examples of the \hyperref[related]{\texttt{related}} field. |
| 104 |
|
| 105 |
In the end of the text you may find the listing of the |
| 106 |
\hyperref[bibfile]{bibliography database file} used. |
| 107 |
You may take advantage of |
| 108 |
the arrows on the left to switch between a database entry and its presentation. |
| 109 |
The database itself is preliminary. This is actually a file that I use in my everyday work, |
| 110 |
so it contains some redundant, provisional and even erroneous (sometimes) material. |
| 111 |
I hope this is not going to confuse the reader too much. |
| 112 |
|
| 113 |
\nocite{*} |
| 114 |
|
| 115 |
\selectlanguage{russian} |
| 116 |
\defbibheading{bibliography}{} |
| 117 |
\renewcommand*{\do}[1]{\section{@#1\label{#1}}\printbibliography[type=#1]} |
| 118 |
\docsvlist{mvbook,book,inbook,suppbook,bookinbook,mvcollection,collection,incollection,suppcollection,mvreference,reference,inreference,mvproceedings,proceedings,inproceedings,periodical,article,patent,online,thesis} |
| 119 |
|
| 120 |
\renewbibmacro*{begentry} |
| 121 |
{\hspace{-4em}\makebox[4em]{\hyperlink{\thefield{entrykey}}{$\Downarrow$}}}% |
| 122 |
|
| 123 |
\section{\texttt{Related} field\label{related}} |
| 124 |
\printbibliography[check=related] |
| 125 |
|
| 126 |
\section{Bibliography database\label{bibfile}} |
| 127 |
\VerbatimInput[fontsize=\small,codes={\catcode`\-=11},commandchars=\@\[\]]{biblatex-gost-examples.bib} |
| 128 |
\end{document} |
| 129 |
|
| 130 |
%%% Local Variables: |
| 131 |
%%% mode: latex |
| 132 |
%%% TeX-master: t |
| 133 |
%%% End: |