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

For several documents I'm preparing, I need to highlight (or underline) occurences of my name within the bibliography.

Is there an easy way of doing this?

share|improve this question

It depends on how you prepare the bibliography. If you are preparing it with BibTeX, you can use a trick I mentioned earlier today, which requires you change the .bib files; this definition should go in the .tex file

\newcommand{\myname}[1]{\textit{Wurm, Y.}}

and an entry in the .bib file will have

author={{\myname{wurm}} and Zauthor, X.}

However this depends also on how you want the names displayed in the bibliography.

If you don't want to act on the bib files, a different approach might work:



This exploits the fact that BibTeX separates each \bibitem entry with empty lines. A different redefinition of \bibitem must be done if you use the abbrv bibstyle instead of plain.

For biblatex the situation is more involved; I got something with


for the standard style; but I don't know if there are side effects. Probably acting as Alan Munn suggested in a comment is best.

share|improve this answer
thanks for the quick reply greg. However, I was hoping to be able to only change something in my .tex file. Messing with .bib file (which may require having multiple copies) is something I would like to avoid... – Yannick Wurm May 20 '11 at 11:30
@Yannick: see the edit – egreg May 20 '11 at 11:58
Is there a biber/biblatex solution? – Raphael May 20 '11 at 12:07
The accepted answer to this question: Pass variable from LaTeX to bibtex (for easy anonymization)? gives you another way take on the multiple bibfile: you make your name a variable in the bib file and then alias it to a command. So you don't really have multiple bib files, just one line for the special formatting, and the other for not. – Alan Munn May 20 '11 at 12:42
Thanks for all the replies. Problem with having a different bib file with different formatting is that the formatting will be applied in the main text as well, not only in the bibliography. (I want my name to be highlighted only in the list of references)... – Yannick Wurm May 21 '11 at 13:39

If you are using biblatex you can override the formatting of the list of authors:

\usepackage[normalem]{ulem} %for \uline


This of course means you have to reproduce formatting of the backend you are using but it allows you to e.g. underline your initials and last name together[1]. The example above is fairly basic (for example it doesn't care about inserting "et al." or "and" as required by some guidelines).

[1] I might be wrong here (I couldn't make the attached example to work) but it seems to me that egreg's solution works at .bbl file level, where initials, first and last names are still kept separately.


Below is a redefined default name formatting macro (based on definition of a name:first-last macro from a biblatex.def file). I'm sorry for my poor coding style. If someone could show me how to properly restructure this macro (to avoid repetition) that would be great.

\usepackage[normalem]{ulem} %for \uline

  \ifthenelse{\equal{#1}{YourLastName}}% matches last name against YourLastName
      \uline{% wrapped with \uline
    {% original
share|improve this answer
While this is an old post, I have recently noticed that the format in biblatex (see the release notes for version 3.3). In particular, when using DeclareNameFormat, one should add \nameparts{#1} at the beginning of its definition and use \namepartXXXX instead of the numbered arguments #2 and so on as detailed in the release notes. – Egon Apr 4 at 9:43

I am using Mendeley to manage my references. It can output a bibtex file but LaTeX has problems with lines that are too long (abstracts). I use a simple shell script to strip abstracts in a new .bib file, and following egreg's advice, included the {\myname{wurm}} change to the .bib file. I am also using the bibliography style ieeetr and my name is underlined as expected.

For me, the shell script contains:

sed "/^abstract/d" library.bib | sed "s|Hurvitz, P. M.|{\\\myname{hurvitz}}|" > library_noabstract.bib

and in my .tex file:

\newcommand{\myname}[1]{\uline{P. M. Hurvitz}}
share|improve this answer
Welcome to TeX.sx! – Peter Jansson Mar 13 '13 at 15:46
Using \newcommand{\myname}[1]{\uline{#1}} would be the more general option. – e9t Dec 12 '15 at 7:17

Your Answer


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.