Newer
Older
% Gestion de la bibliographie avec biblatex
\usepackage[
backend=bibtex,
style=authoryear,
uniquename=init,
giveninits=true,
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
natbib=true
]{biblatex}
\addbibresource{biblio.bib}
%Line breaks of long URLs in biblatex bibliography http://tex.stackexchange.com/a/134281
\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{8000}
% Line break for DOI http://tex.stackexchange.com/a/50958/124910
\setcounter{biburlnumpenalty}{100}
% hyperlink name with biblatex authoryear
% https://tex.stackexchange.com/a/27107/124910
\DeclareFieldFormat{citehyperref}{%
\DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
\bibhyperref{#1}}
\DeclareFieldFormat{textcitehyperref}{%
\DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
\bibhyperref{%
#1%
\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}}}
\savebibmacro{cite}
\savebibmacro{textcite}
\renewbibmacro*{cite}{%
\printtext[citehyperref]{%
\restorebibmacro{cite}%
\usebibmacro{cite}}}
\renewbibmacro*{textcite}{%
\ifboolexpr{
( not test {\iffieldundef{prenote}} and
test {\ifnumequal{\value{citecount}}{1}} )
or
( not test {\iffieldundef{postnote}} and
test {\ifnumequal{\value{citecount}}{\value{citetotal}}} )
}
{\DeclareFieldAlias{textcitehyperref}{noformat}}
{}%
\printtext[textcitehyperref]{%
\restorebibmacro{textcite}%
\usebibmacro{textcite}}}