%20em%20negrito.png)
Gostaria de imprimir tudo \cite{}
de um determinado autor em negrito no meu documento. Por enquanto, eu faço isso shorthand = {\textbf{Foo23}}
no meu .bib
, mas não é realmente prático, e não só tem o problema de lidar com entradas mal duplicadas com a mesma abreviação, mais importante ainda,a ordem alfabética está quebrada:
\documentclass{article}
\usepackage[
style=alphabetic,% also
minalphanames=3,maxalphanames=4, % [Foo+99] -> [FBB+99].
maxnames=99, % Do not put "et al". Sets maxbibnames, maxcitenames and maxsortnames.
sortcites=true,
sortcites=false, % \cite{B,A,C}: [A,B,C] --> [B,A,C]
]{biblatex}
\usepackage{filecontents}
\begin{filecontents}[overwrite]{\jobname.bib}
@article{a1,
author={John Smith and Mary Stuart and Peter Pan},
year = 2020,
shorthand = {\textbf{SSP20}},
journal = {I should should have a Awesome Journal},
volume = 3
}
@article{a2,
author={John Smith and Mary Stuart and Peter Pan},
year = 2020,
journal = {Another Journal},
volume = 3
}
@article{a3,
author={Abc Abc and Def Ahi},
year = 2020,
journal = {I should appear first in the list as it is sorted alphabetically},
volume = 3
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{a1,a2,a3}
\printbibliography
\end{document}
Responder1
Normalmente é melhor evitar ao máximo a formatação de comandos na .bib
entrada. Como você notou, os comandos serão tratados mais ou menos como texto normal e podem atrapalhar a classificação e os cálculos de exclusividade.
Em vez disso, é melhor definir um marcador semântico nos dados e agir de acordo com isso paralelamente biblatex
. Uma opção seria definir uma palavra-chave.
Surpreendentemente, não existe uma maneira simples biblatex
de destacar todo o rótulo de citação, então precisamos incorporá-lo no cite
bibmacro.
\documentclass{article}
\usepackage[
style=alphabetic,% also
minalphanames=3,maxalphanames=4, % [Foo+99] -> [FBB+99].
maxnames=99, % Do not put "et al". Sets maxbibnames, maxcitenames and maxsortnames.
sortcites=true,
sortcites=false, % \cite{B,A,C}: [A,B,C] --> [B,A,C]
]{biblatex}
\DeclareFieldFormat{citelabel}{%
\ifkeyword{importantauthor}
{\mkbibbold{#1}}
{#1}}
\DeclareFieldFormat{labelalphawidth}{%
\mkbibbrackets{%
\ifkeyword{importantauthor}
{\mkbibbold{#1}}
{#1}}}
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printtext[citelabel]{%
\printfield{labelprefix}%
\printfield{labelalpha}%
\printfield{extraalpha}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}}}
\begin{filecontents}{\jobname.bib}
@article{a1,
author = {John Smith and Mary Stuart and Peter Pan},
year = 2020,
journal = {I should should have a Awesome Journal},
volume = 3,
keywords = {importantauthor},
}
@article{a2,
author = {John Smith and Mary Stuart and Peter Pan},
year = 2020,
journal = {Another Journal},
volume = 3,
}
@article{a3,
author = {Abc Abc and Def Ahi},
year = 2020,
journal = {I should appear first in the list as it is sorted alphabetically},
volume = 3,
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{a1,a2,a3}
\printbibliography
\end{document}