This is a variation of the question posted here:

Now I want to highlight multiple names in a bibliography. Here is the erroneous solution that I tried.



The problem is that for each reference it makes two copies. In the first copy, it makes blue and bold Author1 and Author2, and in the second copy, it makes blue and bold Author1 only.

Any ideas on how to fix this so that the reference only has a single name being made blue and bold? Also whatever solution you propose should be made extensible to up to N authors.


  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Cutting and pasting your code in to a standard document gives me the expected behaviour, not that you report. – Andrew Swann Apr 19 '14 at 14:48
  • This is a standard minimal example that shows what I'm after. You will find that the reference list (using BibTeX) is totally not correct. – Amro Apr 19 '14 at 17:10
  • I get output that looks like: Author3, Author1BlueBold, and Author2BlueBold, “My Title” in My Conference. Author3, Author1BlueBold, and Author2PLAIN, “My Title” in My Conference. – Amro Apr 19 '14 at 17:13
  • Here Author1BlueBold means the name of Author1 appears in Blue and Bold. – Amro Apr 19 '14 at 17:16
  • You should add your code to your original question, via the edit button, rather than to the comments. Also include the relevant part of your bibliography file. – Andrew Swann Apr 20 '14 at 14:45

You have a coding error in your macros. The second \StrSubstitute should not have your \x temporary macro at the end - a final argument to \StrSubstitute should be in square brackets [..] to assign the output to \x, but at this stage you no longer need to save its output.

Sample output


\noexpandarg \originalbibitem{#1}
\expandafter\StrSubstitute\expandafter{\mytmpa}{Sameh}{{\color{blue}\textbf{Sameh}}} \par}




The above uses a bibliography file found in standard distributions (in the documentation for bibtex) with a couple of different author names chosen to show the effect. Note that the dashes used for repeated authors partly defeats what you are trying to achieve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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