# Can you invoke stylizing commands in a .bib-file when using the BiBLaTeX apa package?

This question has been heavily rewritten. That's why some of the comments and answers might be a little bit odd (they were responses to earlier versions of the question).

I'm using the BiBLaTeX apa package in conjunction with a .bib-file (generated by Mendeley) to create references. Now, in one of my titles, I would like some words to be in italics. Is it possible to invoke stylizing commands directly in the .bib-file?

Minimal (non)working example (taken from Lockstep):

\documentclass{article}

\usepackage[style=apa]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@thesis{A01,
author = {Author, A.},
year = {2001},
title = {This is a thesis title with some \mkbibemph{emphasized words}},
}
@book{B02,
author = {Buthor, B.},
year = {2002},
title = {This is a book title with some \mkbibemph{emphasized words}},
}
\end{filecontents}

\nocite{*}

\begin{document}

\printbibliography

\end{document}


This just prints the whole title with italics (as specified by the apa style).

-
If I write A \emph{title} in the title field, then the word will be emphasized in the final printout. Would you show a minimal example, please? –  egreg Nov 1 '11 at 11:09
Works for me also with biblatex-apa, so you'll have to provide a minimal working example (MWE) –  lockstep Nov 1 '11 at 11:34
Also, check the .bib file generated by Mendeley. Maybe Mendeley tries to sanitize your input and goes over the top (i.e., removes \mkbibemeph). –  lockstep Nov 1 '11 at 11:37
@lockstep Darn it. You're right. Mendeley converts it like so: 'title = {{The $\backslash$mkbibemph\{Treason\} of Images [Painting]}}' when I write 'The \mkbibemph{Treason} of Images [Painting]' in Mendeley itself. –  Speldosa Nov 1 '11 at 11:42
I'll probably just have to unsync my .bib-file from Mendeley and do the edits manually. –  Speldosa Nov 1 '11 at 11:48

If you use commands like \mkbibemph in a .bib file, biblatex should apply the correct formatting. Note, however, that the built-in bibliography styles will by default print the titles of some entry types (e.g. @book) in italics, so \mkbibemph will result in upright text.

\documentclass{article}

\usepackage{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@thesis{A01,
author = {Author, A.},
year = {2001},
title = {This is a thesis title with some \mkbibemph{emphasized words}},
}
@book{B02,
author = {Buthor, B.},
year = {2002},
title = {This is a book title with some \mkbibemph{emphasized words}},
}
\end{filecontents}

\nocite{*}

\begin{document}

\printbibliography

\end{document}


EDIT: In response to your edited question: Your original example doesn't compile for me, and if I replace

\usepackage[style=apa]{biblatex}


with

\usepackage[american]{babel}
\usepackage[style=apa]{biblatex}
\DeclareLanguageMapping{american}{american-apa}


, \mkbibemph works as expected. (Note that biblatex-apa typesets thesis titles in italics.)

EDIT 2: Also, check the .bib file generated by Mendeley. Maybe Mendeley tries to sanitize your input and goes over the top (i.e., removes \mkbibemph).

-
Formally, this answers my question. However, I'm using the BiBLaTeX apa package "Invoked by adding the option '[style=apa]' when loading the biblatex package. This is what causes my problems.I'll try to rewrite my question. –  Speldosa Nov 1 '11 at 11:31
How come the two different titles are different? The stylizing you've applied looks the same to me. –  Speldosa Nov 1 '11 at 11:38
It's @thesis v. @book in the .bib file. –  lockstep Nov 1 '11 at 11:40
Right :) I see it now. –  Speldosa Nov 1 '11 at 11:44