I would like to set in bold one particular author name when it appears in references throughout the text.
I am following the approach in this answer that proposes to modify the *.bst file for my citation style. More specifically, the answer says to modify the function format.names.
My problem is that with my particular style apalike I cannot figure out how to change format.names. I tried to place highlight.if.custom.author (a custom function that applies \textbf) on different lines within format.names, but this either results in a BibTeX error or makes all author names disappear.
Details about the desired result:
- In the MWE below I would like to set in bold "Koehn, P." when it resulted from
\bibentry. - If possible, I do not want to use bold font in regular citations (e.g. with
\citep) and my links should still be colored. - If possible, I do not want the bibliography at the end to contain bold font either.
MWE
Tex file:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{bibentry}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\nobibliography*
\title{MWE}
\begin{document}
\maketitle
\section{MWE}
Here is a sentence with a regular reference \citep{Koehn2017}. \
\noindent Here is a list of all contributions, some by an important author in \textbf{bold}:
\begin{itemize}
\item \bibentry{Koehn2017}
\item \bibentry{Lison2016}
\item \bibentry{koehn2005epc}
\end{itemize}
\clearpage
\bibliographystyle{apalike}
\bibliography{bibliography}
\end{document}
Bibliography file bibliography.bib:
@InProceedings{Koehn2017,
author = {Koehn, Philipp
and Knowles, Rebecca},
title = {{Six Challenges for Neural Machine Translation}},
booktitle = "Proceedings of the First Workshop on Neural Machine Translation",
year = "2017",
publisher = "Association for Computational Linguistics",
pages = "28--39",
location = "Vancouver, Canada"
}
@InProceedings{Lison2016,
author = {Lison, Pierre and
Tiedemann, Jörg},
title = {{OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles}},
booktitle = "Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)",
year = "2016",
publisher = "European Language Resources Association (ELRA)",
editor = {Nicoletta Calzolari (Conference Chair) and Khalid Choukri and Thierry Declerck and Sara Goggi and Marko Grobelnik and Bente Maegaard and Joseph Mariani and Helene Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis},
pages = "923--929",
location = {Portorož, Slovenia}
}
@inproceedings{koehn2005epc,
added-at = {2010-11-10T15:46:05.000+0100},
address = {Phuket, Thailand},
author = {Koehn, Philipp},
biburl = {https://www.bibsonomy.org/bibtex/205e5fa13fd7ba7992aedfe3514379a1f/unhammer},
booktitle = {{Conference Proceedings: the tenth Machine Translation Summit}},
interhash = {abd06b551527865eb50e21508841b6de},
intrahash = {05e5fa13fd7ba7992aedfe3514379a1f},
keywords = {Corpus Europarl MT Master},
organization = {AAMT},
pages = {79--86},
publisher = {AAMT},
timestamp = {2010-11-10T15:46:05.000+0100},
title = {{Europarl: A Parallel Corpus for Statistical Machine Translation}},
url = {http://mt-archive.info/MTS-2005-Koehn.pdf},
year = 2005
}
Changes to apalike.bst:
FUNCTION {custom.author}
{ "Koehn, P." }
FUNCTION {highlight}
{ duplicate$ empty$
{ pop$ "" }
{ "\textbf{" swap$ * "}" * }
if$
}
FUNCTION {highlight.if.custom.author}
{ duplicate$ purify$ custom.author purify$ =
{ highlight }
'skip$
if$
}
Overleaf link to MWE