summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/biblatex-gost/biblatex-gost-examples.tex
blob: 6aaca8b89465b24b5836e143ea33a439eb69ffec (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
121
122
123
124
125
126
127
128
129
130
131
132
133
\documentclass[a4paper,10pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{fontspec}
\defaultfontfeatures{%Mapping=tex-text,
  Ligatures=TeX,
  % Scale=MatchLowercase,
}
\usepackage{luatexbase}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}

\usepackage[british,american,spanish,greek,french,german,polish,english,russian]{babel}
\usepackage{csquotes}
\usepackage{multicol}
\usepackage{fancyvrb}
\usepackage{color}
\usepackage{xpatch}
\definecolor{spot}{rgb}{0,0.2,0.6}
\usepackage[colorlinks,allcolors=spot,bookmarksopen=true,pdfstartview=FitH]{hyperref}
\usepackage[parentracker=true,
  backend=biber,
  hyperref=auto,
  language=auto,
  autolang=other,
  citestyle=gost-numeric,
  defernumbers=true,
  bibstyle=gost-footnote,
]{biblatex}
\addbibresource{biblatex-gost-examples.bib}

% Russian sources first
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=langid, fieldvalue={tempruorder}]
    }
    \map[overwrite]{
      \step[fieldsource=langid, match=russian, final]
      \step[fieldsource=presort, match=\regexp{(.+)}, replace=\regexp{aa$1}]  %$
    }
    \map{
      \step[fieldsource=langid, match=russian, final]
      \step[fieldset=presort, fieldvalue={az}]
    }
    \map[overwrite]{
      \step[fieldsource=langid, notmatch=russian, final]
      \step[fieldsource=presort, match=\regexp{(.+)}, replace=\regexp{za$1}]  %$
    }
    \map{
      \step[fieldsource=langid, notmatch=russian, final]
    }
    \map{
      \step[fieldsource=langid, match={tempruorder}, final]
      \step[fieldset=langid, null]
    }
  }
}

\tolerance=1500

\xpatchbibmacro{related:default}
  {\renewbibmacro*{pageref}{}}
  {\renewbibmacro*{pageref}{}\renewbibmacro*{begentry}{}}{}{}
\renewbibmacro*{begentry}
  {\hspace{-4em}\makebox[4em]{\hyperlink{\thefield{entrykey}}{$\Downarrow$}}%
       \raisebox{\baselineskip}{\hypertarget{back:\thefield{entrykey}}{}}}%
\edef\mytempforAtCharacter{\char64}
\def\getkey#1#2{%
  \csappto{mytempforbibkey}{#1}%
  \ifstrequal{#2}{,}
  {\hspace{-4em}\makebox[4em]{\hyperlink{back:\mytempforbibkey}{$\Uparrow$}}%
   \raisebox{\baselineskip}{\hypertarget{\mytempforbibkey}{}}%
   \mytempforAtCharacter\mytempforbibtype\{\mytempforbibkey,}
  {\getkey#2}%
}
\renewcommand*{\do}[1]{\csdef{#1}##1{\def\mytempforbibtype{#1}\def\mytempforbibkey{}\getkey}}
\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}
\renewcommand*{\do}[1]{\csdef{#1}##1{\mytempforAtCharacter #1\{}}
\docsvlist{XDATA,COMMENT,xdata,comment,}

\makeatletter
\title{Biblatex-GOST examples\thanks{Version~\bbx@gost@version.}}
\makeatother
\author{Oleg Domanov\thanks{odomanov@yandex.ru}}

\defbibcheck{related}{%
  \iffieldundef{related}{\skipentry}{}}
\defbibcheck{norelated}{%
  \iffieldundef{related}{}{\skipentry}}

\begin{document}
\selectlanguage{english}
\maketitle
Examples are grouped according to their entrytypes. The types themselves are the following
(click to go to the respective bibliography section):
\renewcommand*{\do}[1]{\hyperref[#1]{@#1}\\}
\begin{multicols}{5}
\noindent%
\docsvlist{mvbook,book,inbook,suppbook,bookinbook,mvcollection,collection,incollection,suppcollection,mvreference,reference,inreference,mvproceedings,proceedings,inproceedings,periodical,article,patent,online,thesis}
\end{multicols}

See also examples of the \hyperref[related]{\texttt{related}} field.

In the end of the text you may find the listing of the
\hyperref[bibfile]{bibliography database file} used.
You may take advantage of
the arrows on the left to switch between a database entry and its presentation.
The database itself is preliminary. This is actually a file that I use in my everyday work,
so it contains some redundant, provisional and even erroneous (sometimes) material.
I hope this is not going to confuse the reader too much.

\nocite{*}

\selectlanguage{russian}
\defbibheading{bibliography}{}
\renewcommand*{\do}[1]{\section{@#1\label{#1}}\printbibliography[type=#1]}
\docsvlist{mvbook,book,inbook,suppbook,bookinbook,mvcollection,collection,incollection,suppcollection,mvreference,reference,inreference,mvproceedings,proceedings,inproceedings,periodical,article,patent,online,thesis}

\renewbibmacro*{begentry}
  {\hspace{-4em}\makebox[4em]{\hyperlink{\thefield{entrykey}}{$\Downarrow$}}}%

\section{\texttt{Related} field\label{related}}
\printbibliography[check=related]

\section{Bibliography database\label{bibfile}}
\VerbatimInput[fontsize=\small,codes={\catcode`\-=11},commandchars=\@\[\]]{biblatex-gost-examples.bib}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: