19

I'd like to extract the title from a bibtex file and use it in the main document text. I'm using \citetitle, but this adds the title plus whatever markup is defined for the bibliography style I'm using. How do I get the article title as-is, without anything attached?

My minimal working example:

\documentclass{article}
\usepackage[style=authoryear-comp]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{refs_local.bib}
@Article{fubar,
  author =       {J. Doe},
  title =        {A fabulous finding},
  journal =  {Journal of Improbable Results},
  year =         2010,
  volume =   42,
}
\end{filecontents}
\addbibresource{refs_local.bib}
\begin{document}%
Test: {\bfseries \sffamily \citetitle*{fubar}}\\
\rule{\textwidth}{0.4mm}
\printbibliography
\end{document}

The generated document (cropped):

Compiled document

The desired document would not affect layout of the References, but would show the text A fabulous finding in the main document without any quotes.

Do I need to define my own citation command to get this effect, or is there a more low-level way to extract information directly from bibtex fields?

Moriambar
  • 11,466
gerrit
  • 5,165

2 Answers2

21

The formatting of \citetitle is done by the field formatting citetitle. You can change it in the following way:

\DeclareFieldFormat*{citetitle}{#1}

The star version is used to redefine citetitle for all entry types.

Marco Daniel
  • 95,681
  • I think that there should be some formatting applied, e.g., using \emph. The problem I have is that it is, by default, not consistent. – khatchad Aug 03 '21 at 15:46
14

It's actually a way easier, just use \citefield

\citefield{my-referenc}{title}
ziima
  • 431
  • 4
  • 5
  • 3
    You might want to add that this works because \citefield uses the generic format defined via \DeclareFieldFormat{citefield}{#1} (so no formatting is applied, everything comes out bare), while \citetitle uses the citetitle format that follows the definition of the title format (as explained in Marco Daniel's answer). – moewe Aug 23 '17 at 16:07
  • moewe: Thanks for an explanation, I wasn't aware of that. I just accidentally found this works. You're welcome to edit my post and provide the explanation. – ziima Aug 26 '17 at 13:30