# Underline different authors in the bibliography by hacking BST file [duplicate]

I am updating my CV (moderncv) and I am including a list of all my communications (oral and poster) using multibib (I use different .bib files for each one).

The final output should display my name in bold and the presenting author underlined.

So far I have figured out how to do the first bit but have not find solution for the last part. Because the presenting author is not always the same person I was thinking in using the "comment field" to tell BibTeX/LaTex who I want to underline in that specific entry.

Because I do not have enough skills to do that I wonder if anyone can give me a help.

EDITED

I am using a .bst file.

-

## marked as duplicate by mafp, Claudio Fiandrino, zeroth, Seamus, KurtFeb 28 '13 at 11:33

Welcome to TX.SX! Do you use a bst file, or biblatex? –  mafp Jan 10 '13 at 23:18
Note that underlining is not a very nice typographical style; we might use it in hand-written text because we can't do bold or italic, but you might want to try other styles (e.g. italic) and see if they look better than underlining. –  gerrit Jan 11 '13 at 9:05
Gerrit, thank you for your comment. I don't mind doing something different to the text, I just want a way to systematically doing so where I only have to say which (presenting) author/name is to be typographically distinct from everything else. –  Katuyci Jan 11 '13 at 14:45
@gerrit I can hand-write italic :-) I think that you meant typewritten (as with a old fashioned mechanical typewriter) text. –  JLDiaz Jan 11 '13 at 14:48
@gerrit You are right. However, in some fields there is a convention that when a work of multiple people is presented, the name of the speaker is underlined. So for me, despite being "typographically incorrect", it is a reasonable thing to do. –  yo' Jan 11 '13 at 16:09

By following a previous example I was able to fulfill my question when using the plain.bst file.

First, I've added a comment field in .bib file as a easier way to referrence which was the speaker/presenting author and declared this new field in plain.bst file:

ENTRY{
...
...
chapter
comment
...
}


Second, I've created a new function (speaker.author) to set the name in the same format as this style uses in format.names:

FUNCTION {speaker.author}
{
comment empty${ "" } { comment nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ }
if$}  Third, a new function (highlight) is created to highlight a text, in our case a name. In this case I opt to underline the text/name but you can set whatever text style you want. FUNCTION {highlight} { duplicate$ empty${ pop$ "" }
{ "\underline{" swap$* "}" * } if$
}


Fourth, a new function (highlight.if.speaker.author) is created to run highlight if the author on the stack (see next) is the same as speaker.author.

FUNCTION {highlight.if.speaker.author}
{ duplicate$purify$ speaker.author purify$= { highlight } 'skip$
if$}  Last, insert a call to highlight.if.speaker.author to FUNCTION{format.names} right after the format.names$.

FUNCTION{format.names}
{...
format.names$highlight.if.speaker.author ... }  NOTE: step 2-4 should be placed before FUNCTION{format.names}. The only flaw in this method (which arises from the fact that plain.bst style does not abbreviate names) is that you have to make sure that the way you type the author name in author field is the same as in comment because "Doe, John" and "Doe, J" will be seen as different names, although "Doe, J", "Doe, J." or "J Doe" will be seen as equal. EDITED In some particular cases you may want to have your name in bold together with the previous style (if you are the speaker AND the author of the CV). In that case use the following two new functions: FUNCTION {cv.author} { "Doe, John" nameptr "{vv~}{ll}{, jj}{, f{.}.}" format.name$ }

FUNCTION{double.highlight}
{ duplicate$empty$
{ pop$"" } { "\textbf{\underline{" swap$ * "}}" * }
if$}  And then, change FUNCTION{highlight.if.speaker.author} to this: FUNCTION {highlight.if.speaker.author} { duplicate$ purify$speaker.author purify$ =
{ speaker.author cv.author =
{ double.highlight }
{highlight}
if$} 'skip$
if\$
}

-
Just for reference: I made a similar answer to the other bibtex-author-emphasis question. –  mafp Feb 28 '13 at 10:30