BibTeX, biblatex and biberConditional Formatting of Author Names

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
rainbowgoblin
Posts: 2
Joined: Sat Sep 24, 2011 2:32 am

Conditional Formatting of Author Names

Post by rainbowgoblin »

I'm not sure if this is possible... I'd like to define the font used for authors' names conditionally based on who the author is. I'm writing a CV, and I want my name in publications to be in bold typeface, and others to be in the normal typeface. I've got my .bst file set up to use bibnamefont, and I've successfully renewed the bibnamefont command to make all authors bold, but I can't figure out how to do this conditionally. I've tried this:

Code: Select all

\usepackage{ifthen}
\renewcommand{\bibnamefont}[1]{\ifthenelse{\equal{Einstein A}}{\textbf{#1}}{#1}}
but this won't even compile. Ideas?
Last edited by rainbowgoblin on Sat Sep 24, 2011 12:11 pm, edited 2 times in total.

Recommended reading 2024:

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

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

rainbowgoblin
Posts: 2
Joined: Sat Sep 24, 2011 2:32 am

Conditional Formatting of Author Names

Post by rainbowgoblin »

I figured this out, so I'm replying to my own question in case someone else wants to do this...

It turns out that my original solution works, I just didn't have the right syntax for the \equal command:

Code: Select all

\newcommand{\bibnamefont}[1]{\ifthenelse{\equal{#1}{Einstein A}}{\textbf{#1}}{#1}}
Post Reply