TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The solution provided here

Make one author's name bold every time it shows up in the bibliography

does unfortunately not work, as soon as the Author's name contains special characters, e.g. Hans M{\"u}ller? How can this problem be solved?

share|improve this question

The following modification of this answer seems to work if you use the plain bib style:

\let\originalbibitem\bibitem
\def\bibitem#1#2\par{%
  \noexpandarg
  \originalbibitem{#1}
  \StrSubstitute{#2}{Hans M{\"u}ller}{\textbf{Hans M{\"u}ller}}\par}

Example

\begin{filecontents*}{\jobname.bib}
@article{a,
author={M{\"u}ller, Gerd},
title={Scoring goals},
journal={J. Applied Soccer},
year={1974},
}
@article{b,
author={M{\"u}ller, Hans},
title={Splitting hairs},
journal={J. Abstract Tetrapiloctomy},
year={1255},
}
\end{filecontents*}

\documentclass{article}

\usepackage{xstring}

\let\originalbibitem\bibitem
\def\bibitem#1#2\par{%
  \noexpandarg
  \originalbibitem{#1}
  \StrSubstitute{#2}{Hans M{\"u}ller}{\textbf{Hans M{\"u}ller}}\par}

\begin{document}
\cite{a}

\cite{b}

\bibliographystyle{plain}
\bibliography{\jobname}

\end{document}

enter image description here

share|improve this answer
    
Well, the simple example indeed works, but if I use a more complex example, e.g. with the web.sty and URLs, I receive the error message(s): unaway argument? ... ! Paragraph ended before \BR@c@bibitem was complete. <to be read again> \par – Patrick Jöckel Mar 13 '12 at 21:26
    
@PatrickJöckel This is not a forum, but a "question and answers" site. Please, edit the original question, rather than adding "non answers". You need to register, though. A moderator will merge the "different identities". – egreg Mar 13 '12 at 21:29

I finally found a straightforward solution by modifying the .bbl-file with sed:

bibtex mydoc

mv my.bbl my.bbl.ori 

cat my.bbl.ori | tr '\n' '\t' | sed 's/\(M{\\\"u}ller, *\t* *H.\)/\\textbf{\1}/g'  | tr '\t' '\n' > my.bbl

The trick is to convert newlines to tabs in order to enable sed to wrap the name into \texbf{...}, even if there is a newline in between.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.