I create my list of publications using \bibentry
. As in some of the publications I'm only the fifth author (or there around) I would like to highlight my name by underlining it. I found solutions doing this in the complete bibliography e.g. here or here. Is there a possibility to apply the underlining just locally for the "chapter" where I create the publication list using \bibentry
? I'm also open to alternatives to \bibentry
however I would prefer not to make the list completely by hand. I'm using BibTeX and the bibliographystyle statto.
2 Answers
EDIT Answer updated with step-by-step instructions on how to modify the .bst
file according to this answer.
It is possible to use the solution provided in this answer to Make one author's name bold every time it shows up in the bibliography as follows:
Create a command \myref
that takes an argument, and use such command to wrap your name in the bibliography using the solutions above. This means that in the .bbl
file one has something like
\bibitem[Author and M{\"u}ller(2013)]{A}
A~Author and \myref{M~M{\"}ller}.
\newblock Title, 2013.
\bibitem[M{\"u}ller(2013)]{B}
\myref{M~M{\"u}ller}.
\newblock Title, 2013.
\bibitem[Cuthor(2013)]{C}
C~Cuthor.
\newblock Title, 2013.
The command \myref
is defined to simply print its content in a normal bibliography and print the underlined argument in the list of publication. This is achieved in the following way (using toolbox
package toggle
facilities)
\newtoggle{myrefs}
\newcommand{\myref}[1]{\iftoggle{myrefs}{\underline{#1}}{#1}}
then set myrefs
to false before the normal bibliography (\togglefalse{myrefs}
) and true for the list of publications (\toggletrue{myrefs}
).
Here is the complete example (the \jobname.bbl
file is included to demonstrate the solution). Also the step-by-step modifications to the .bst
file, according to this solution are included
Include the following functions in the .bst
file (as usual create a copy of the style and rename it).
FUNCTION {cv.author}
{ "M Muller" }
FUNCTION {highlight}
{ duplicate$ empty$
{ pop$ "" }
{ "\myref{" swap$ * "}" * }
if$
}
FUNCTION {highlight.if.cv.author}
{ duplicate$ purify$ cv.author purify$ =
{ highlight }
'skip$
if$
}
Then locate the function FUNCTION {format.names}
in the .bst
file (it is around line 550 in my copy). Change
format.name$
bib.name.font
in
format.name$
highlight.if.cv.author
bib.name.font
namely, add highlight.if.cv.author
immediately after format.name$
.
At this point you are ready to use the modified .bst
file.
\documentclass{article}
\usepackage{natbib}
\usepackage{bibentry}
\usepackage{etoolbox}
\usepackage{filecontents}
\begin{filecontents}{bib.bib}
@Misc{A,
author = {A Author and M M{\"u}ller},
title = {Title},
year = 2013,
}
@Misc{B,
author = {M M{\'}ller},
title = {Title},
year = 2013,
}
@Misc{C,
author = {C Cuthor},
title = {Title},
year = 2013,
}
\end{filecontents}
\newtoggle{myrefs}
\newcommand{\myref}[1]{\iftoggle{myrefs}{\underline{#1}}{#1}}
\begin{document}
\nocite{*}
\togglefalse{myrefs}
\bibliographystyle{mystatto}
\bibliography{bib}
\section*{My Publications}
\toggletrue{myrefs}
\nobibliography*
\begin{itemize}
\item\bibentry{A}
\item\bibentry{B}
\end{itemize}
\end{document}
The MWE yields
-
I guess this should work, at least when putting
\myname{Buthor, Bernd}
directly in the bib file it highlight correctly but will the not give the correct order of the names. So I guess, I should adapt thestatto.bst
somehow accordingly to this solution. However I don't see where I have to make the corresponding adjustment. Could you help me here?– TanjaNov 16, 2013 at 13:06 -
I tried to adapts it as following ` { "\FormatName{" s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ bib.name.font bibinfo bibinfo.check "}" 't := %{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ bib.name.font bibinfo bibinfo.check 't :=` But this is not working (i.e. the names are now longer ordered by first name, last name and nothing is underlined). I don't know if a name as Müller (M\"uller) provides additional difficulty?– TanjaNov 16, 2013 at 13:19
-
-
Can you put it explicitly what and where I have to change it? I tried with names as Müller and names without Umlaut, I'm not getting it somehow. There is nothing highlighted at all.– TanjaNov 17, 2013 at 13:12
-
I put the names in the wrong order, i.e. Burthor, Bernd instead of Bernd Buthor. The
\textbf
in the second solution I replaced by\myref
and the everthing works fine. thanks– TanjaNov 19, 2013 at 10:15
Another approach to doing this is with Bibulous in place of BibTeX or Biblatex. In order make a given author underlined, all that is needed is to apply a "substring replace" operator into the author list variable. For example, to replace the author "J. W. Tukey" with its underlined version "\underline{J. W. Tukey}", we can change each entrytype template from, say,
article = <au>, \enquote{<title.replace(Sunset,\color{red}Sunset\color{black})>,}{ }...
<journal.replace(American,\textit{American})> \textbf{<volume>} (<year>).
to the new form
article = <au.replace(J. W. Tukey,\underline{J. W. Tukey})>,{ }...
\enquote{<title.replace(Sunset,\color{red}Sunset\color{black})>,}{ }...
<journal.replace(American,\textit{American})> \textbf{<volume>} (<year>).
The change here is only applied to "article" type entries, and so similar changes to the other entrytype templates ("book", "inproceedings", etc.) would also be needed, in each case replacing <au>
with <au.replace(J. W. Tukey,\underline{J. W. Tukey})>
.
author={\underline{authorname}}
not work for you? Or probably I'm misunderstanding.\bibentry
. However I would like to have the name only highlighted when calling the\bibentry
for the publications list of my papers.\bibentry
as well.