-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathplainnat-ime.cbx
84 lines (71 loc) · 2.83 KB
/
plainnat-ime.cbx
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
% Author: Nelson Lago
% This file is derived from files in the BibLaTeX distribution
% and, therefore, is distributed under the LPPL
\ProvidesFile{plainnat-ime.cbx}
[2021/02/04 v1.1 plainnat-like citations by IME/USP]
\RequireCitationStyle{authoryear}
\RequirePackage{regexpatch}
% Sobrenomes nas citações (e na bibliografia) em Small Caps
\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
% Autores no formato "nome sobrenome"
\DeclareNameAlias{sortname}{given-family}
\DeclareNameAlias{default}{given-family}
% Autores no formato "sobrenome, nome"
%\DeclareNameAlias{sortname}{family-given}
%\DeclareNameAlias{default}{family-given}
% Com mais de 2 nomes, usa "et al." nas citações
\ExecuteBibliographyOptions{maxcitenames=2}
% Usando o pacote hyperref, o estilo de citação authoryear transforma
% apenas o ano da citação em um link para a bibliografia, porque isso
% funciona adequadamente para qualquer estilo. Os autores de biblatex
% não vão implementar mudanças nisso, mas é possível fazer o nome do
% autor + o ano serem um link. Existem diversas soluções, mas aqui
% implementamos esta: https://tex.stackexchange.com/a/537666 ,
% criada por um dos desenvolvedores de biblatex.
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\iffieldundef{shorthand}
{\ifboolexpr{test {\ifnameundef{labelname}}
or test {\iffieldundef{labelyear}}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}}
\renewbibmacro*{citeyear}{%
\printtext[bibhyperref]{%
\iffieldundef{shorthand}
{\iffieldundef{labelyear}
{\usebibmacro{cite:label}}
{\usebibmacro{cite:labeldate+extradate}}}
{\usebibmacro{cite:shorthand}}}}
\renewbibmacro*{textcite}{%
\ifnameundef{labelname}
{\iffieldundef{shorthand}
{\printtext[bibhyperref]{%
\usebibmacro{cite:label}}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nonameyeardelim}\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\printtext[bibhyperref]{\usebibmacro{cite:labeldate+extradate}}}
{\printtext[bibhyperref]{\usebibmacro{cite:shorthand}}}}
{\printtext[bibhyperref]{\printnames{labelname}}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nameyeardelim}\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{citeyear}}}
\renewbibmacro*{cite:shorthand}{%
\printfield{shorthand}}
\renewbibmacro*{cite:label}{%
\iffieldundef{label}
{\printfield[citetitle]{labeltitle}}
{\printfield{label}}}
\renewbibmacro*{cite:labeldate+extradate}{%
\printlabeldateextra}