I am writing my thesis and I want to highlight my name in the publications using the \fullcite{}
while keeping the main bibliography untouched (if not possible, the name can also be highlighted there). I tried the approaches in :
- Make specific author bold using biblatex
- Make one author's name bold every time it shows up in the bibliography
But I was not able to put it work. Thus I defined a command:
% Show me as author
%\newcommand*{\showme}[1]{\textbf{#1}}
\newcommand*{\showme}[1]{\mkbibbold{#1}}
To be used inside my biblio.bib. It seem to work. But them I noticed that the entry is not formated as the other authors' name. It was easy to see because I am using ieee
style.
@incollection{Silva:2014a,
title={Radio Resource Management for Device-to-Device Communications in Long Term Evolution Networks},
author={\showme{Carlos F. M. Silva} and Jos\'{e} Mairton B. Silva Jr. and Tarcisio F. Maciel},
booktitle={Resource Allocation and {MIMO} for {4G} and Beyond},
publisher={Springer Science+Business Media},
year=2014,
address={New York, USA},
editor={Francisco Rodrigo Porto Cavalcanti},
pages={105-156},
doi={10.1007/978-1-4614-8057-0_3},
isbn={978-1-4614-8056-3},
}
Which gives:
Carlos F. M. Silva, J. M. B. S. Jr., and T. F. Maciel, “Radio resource management for device-to-device communications in long term
evolution networks”, in Resource Allocation and MIMO for 4G and
Beyond, F. R. P. Cavalcanti, Ed., New York, USA: Springer
Science+Business Media, 2014, pp. 105–156, isbn: 978-1-4614-8056-3.
doi:
10.1007/978-1-4614-8057-0_3
As it can be seen, my first name appears full, while the correct entry would be C. F. M. Silva. I know this happens because anything inside {}
is not formated by the bibliography style.
So my question is: how can I define such a command to let the bibliography style to format my name and put it on bold if a flag is on, i.e., \ifshowme=1
. The MWE is below.
\documentclass{article}
\usepackage[backend=biber,style=ieee]{biblatex}
% Show me as author
%\newcommand*{\showme}[1]{\textbf{#1}}
\newcommand*{\showme}[1]{\mkbibbold{#1}}
\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@incollection{Silva:2014a,
title={Radio Resource Management for Device-to-Device Communications in Long Term Evolution Networks},
author={\showme{Carlos F. M. Silva} and Jos\'{e} Mairton B. Silva Jr. and Tarcisio F. Maciel},
booktitle={Resource Allocation and {MIMO} for {4G} and Beyond},
publisher={Springer Science+Business Media},
year=2014,
address={New York, USA},
editor={Francisco Rodrigo Porto Cavalcanti},
pages={105-156},
doi={10.1007/978-1-4614-8057-0_3},
isbn={978-1-4614-8056-3},
}
\end{filecontents}
\addbibresource{biblio.bib}
\begin{document}
\fullcite{Silva:2014a}
\printbibliography
\end{document}
Best Answer
Edit Continuing updates for this methods are posted to https://tex.stackexchange.com/a/416416/35864.
The following solution automatically extracts the hashes for the given names. Everything else is based on the bit of the answer below.
Warning! The code will write a
.bib
file called<your TeX file/\jobname>-boldnames.bib
, if it exists, it will be overwritten. You can change the name of that file by adjusting the value of\hlblx@bibfile@name
.We can use Audrey's approach to Make specific author bold using biblatex, but instead of string comparison we use the name hash produced by Biber.
You can find out the
hash
values for your name (and its versions) by looking at the.bbl
file produced by Biber, it will contain information for a cited entry like thisThe hash for the relevant name is shown right before the name, for C. F. M. Silva is
894de27062ab25d43f1d7b50fd923256
, for J. M. B Silva Jr. it iscc273ec4593222cb35c353d3f073214e
. (Note that the value of this hash may change between Biber version: Check that the names highlight correctly after an update.)Since the
hash
is different for different name inputs (thehash
for "Donald E. Knuth" will not equal the one for "D. E. Knuth" or "Donald Knuth") you will have to find the correct hash for all the variants you use of your name.With the help of
you can then add a list of hashes to the
\boldnames
macroMWE
The answer has been updated to reflect the changes needed for
biblatex
>= 3.3 (seebiblatex
3.3 name formatting). All mentions oflast
in name macros are nowfamily
andfirst
becomesgiven
. Refer to the edit history for the pre-3.3 code.edited to use a more elegant version to format complete names.
\DeclareNameWrapperFormat
and\mkbibcompletename
are only available inbiblatex
v3.12 (2018-10-30) and v3.13 (2019-08-17), respectively. Please refer to the edit history if you are using an older version ofbiblatex
.