Skip to content

Commit 96d692b

Browse files
committed
feat(biblatex): improved multicite, and prenote
Signed-off-by: Jonas Dujava <[email protected]>
1 parent 99cf121 commit 96d692b

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

preamble/references/cite.tex

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
\renewbibmacro*{cite}{%
99
\printtext[bibhyperref]{%
1010
\citebox{% <---- wrap the whole citation with a `tcolorbox` frame
11+
%% turn postnote into custom prenote
12+
\iffieldundef{postnote}{}{{\normalfont\hspace{0.18em}\printfield{postnote}\hspace{0.15em}}}%
1113
\lbrack% <---- always consistently use brackets
1214
\printfield{labelprefix}%
1315
\printfield{labelnumber}%
@@ -16,3 +18,24 @@
1618
}%
1719
}%
1820
}
21+
22+
%% do not put commas between multiple citations when using `\cite{something,something}`
23+
\renewcommand*{\multicitedelim}{\space}
24+
% \renewcommand*{\multicitedelim}{\addsemicolon\space}
25+
26+
%% disable default postnote
27+
\renewbibmacro*{postnote}{%
28+
% \iffieldundef{postnote}
29+
% {}
30+
% {\setunit{\printdelim{postnotedelim}}%
31+
% \printfield{postnote}}
32+
}
33+
34+
%%% Alternative style of multicitations
35+
% \renewcommand*{\multicitedelim}{\addcomma} % no space between multiple citations, just a comma
36+
%
37+
% %% wrap the citation commands in a `\citebox`
38+
% \NewCommandCopy{\autociteOrig}{\autocite}
39+
% \NewCommandCopy{\citeOrig} {\cite}
40+
% \RenewDocumentCommand{\autocite}{O{} O{} m}{\citebox{\autociteOrig[#1][#2]{#3}}}
41+
% \RenewDocumentCommand{\cite} {O{} O{} m}{\citebox{\citeOrig[#1][#2]{#3}}}

0 commit comments

Comments
 (0)