Text FormattingBibliography name bold

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
tsippel
Posts: 1
Joined: Tue Jun 22, 2010 9:28 am

Bibliography name bold

Post by tsippel »

Hi-
I'm writing my academic cv, and need to highlight my name within my list of publications.

Say I have a bibtex bibliography called My_Bibliography which includes my peer reviewed work, and my name is Bob Smith.

\usepackackage(natbib) %bibliography package in preamble

\nocite{Jones_etal_2010} %Show first bibliographic reference
\nocite{Smith_etal_2009} %Show second bibliographic reference
\bibliographystyle{PLoS-Biology} %I want to use the style from PLoS-Biology
\bibliography{My_Bibliography} %The name of my bibliography is My_Bibliography

When this bibliography shows with my name "Smith B" amongst my co-authors, I want my name to be in bold.

Jones A, Smith B, Walker C 2010. Another paper I wrote. PLoS Biology 1(1): 1-10.

Smith B, Walker C, Jones A. 2009. A paper I wrote. Nature 1(1): 1-10.

I want to use the \nocite{} command to make use of my bibtex bibliography and not have to type out my work individually just so I can make my name bold.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Bibliography name bold

Post by kaiserkarl13 »

I can think of two solutions that might work:

(1) Put two "@string" entries at the top of your bibliography file like so:

Code: Select all

@string{ myname = "{Smith, B[restofname]" }
string{ myname = "{\textbf{Smith}}, {\textbf{B}}" }
then change all occurrences of your name to use the new string macro. For example,

Code: Select all

@article{Jones2010,
  author = "Jones, A and " # myname # " and Walker, C",
  year = 2010,
  note = "Another paper I wrote",
  journal = "PLoS Biology",
  volume = 1,
  number = 1,
  pages = "1--10"
}
When making your CV, change the strings to "@string" for the boldface one and just "string" for the other (anything not starting in '@' is a comment in BibTeX).

This may also work, depending on your bibliography style: edit your bibliography style file to include something like

Code: Select all

\providecommand{\myname}{Jones, B.}
in the .bbl file (during the definition of \begin{thebibliography} should work) and then put a line like

Code: Select all

\newcommand{\myname}{\textbf{Jones, B.}}
before your bibliography environment. If you leave out the \newcommand, it will default to non-bold, but if you put the command in there it will grab the boldface version. Note that you'd have to include a similar command if you ever needed your name written in a style other than "Jones, B." (using a different bibliography style). Then change all occurrences of your name to "{\myname}" in the .bib file; for example,

Code: Select all

@article{Jones2010,
  author = "Jones, A and {\myname} and Walker, C",
  year = 2010,
  note = "Another paper I wrote",
  journal = "PLoS Biology",
  volume = 1,
  number = 1,
  pages = "1--10"
}
Neither of these is foolproof---for example, I think the comma will never be boldfaced using the first method, and some BST files will be stupid and put a comma after your name in the second instance. Both of these are easily rectified by edits to the .bib file, but the whole point of doing this is to avoid such edits.
Post Reply