forked from pzorin/decoupling-lecture-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
biblatex.cfg
54 lines (48 loc) · 1.52 KB
/
biblatex.cfg
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
\ExecuteBibliographyOptions{safeinputenc=true,backref=true,giveninits,useprefix=true,maxnames=5,doi=false,eprint=true,isbn=false,url=false}
\renewcommand{\bibfont}{\normalfont\footnotesize}
\newbibmacro{string+doiurl}[1]{%
\iffieldundef{doi}{%
\iffieldundef{url}{%
#1%
}{%
\href{\thefield{url}}{#1}%
}%
}{%
\href{https://doi.org/\thefield{doi}}{#1}%
}%
}
\DeclareFieldFormat[article,misc,thesis,incollection]{title}{\usebibmacro{string+doiurl}{\mkbibquote{#1}}}
%% smart \MR
%% code suggested by Vilmos Prokaj <[email protected]>
%% solves the problem when MR is in a format
%% \MR{MR1037262 (91i:60148)}
%% \woMR ("without MR"): this macro removes the MR prefix if it
%% is present and does not change the argument otherwise
\def\woMR#1{\w@MR#1MR#1MR\relax}%
\def\w@MR#1MR#2MR#3\relax{#2}
%% this creates a mathscinet URL using first part of MR... (...)
\def\MR@URL#1 #2\relax{https://www.ams.org/mathscinet-getitem?mr=#1}
\AtBeginDocument{
\@ifpackageloaded{hyperref}
{
\def\MRnumber#1{\href{\MR@URL#1 \relax}{\nolinkurl{\woMR#1}}}% make a link to mathscinet
}% else
{
\def\MRnumber#1{\texttt{\woMR#1}}% just typeset the MR number without prefix
}
\DeclareFieldFormat{mrnumber}{\mkbibacro{MR}\addcolon\space\MRnumber{#1}}
\newbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}%
\newunit\newblock
\printfield{mrnumber}}
}