7

I would like to cite an article by its title and its date (the date should be inside parenthesis).

For now, I have to use two commands:

\citetitle{key} \parencite*{key}

which produces (with authoryear style):

 My title (1999)

I am using Biblatex which has the same kind of command I want but for the name of author(s) and the date (\textcite{key} produces Author (1999))

Is there a way to cite the title as a sentence's subject and the date in parenthesis by one biblatex command ? (I didn't anything related in bibaltex's manual)

3
  • 3
    I'm not to fluent in biblatex, but you could change the cite style. However, why not go the direct route \newcommand{\mycite}[1]{\citetitle{#1} \parencite*{#1}} – Bort Dec 21 '15 at 20:28
  • @bort Because it's appears like I cited twice the paper. It could generate problem if I use specific biblatex features to see how frequently I cite some reference. – ppr Dec 21 '15 at 20:43
  • 1
    Define a new cite command \citetitleyear. The documentation says how to do it – Ulrike Fischer Dec 21 '15 at 22:04
4

EDIT Improved code thanks to moewe's help.

Possibly something like this?

\documentclass{article}
\usepackage{biblatex}
\bibliography{biblatex-examples}
\DeclareCiteCommand{\citetitleyear}
{\boolfalse{citetracker}%
  \boolfalse{pagetracker}}
{\ifciteindex
  {\indexfield{indextitle}}
  {}%
  \printfield[citetitle]{labeltitle}%
  \setunit{\addspace}%
  \printtext[parens]{%
    \usebibmacro{prenote}%
    \printfield{year}\printfield{extrayear}%
    \usebibmacro{postnote}}}
{\multicitedelim}
{}
\begin{document}

  \citetitleyear{westfahl:space}

  \citetitleyear{westfahl:space,matuz:doody}

  \citetitleyear[pre][3--9]{westfahl:space}

\end{document}

cite title and year

4
  • 2
    +1) It is probably a bit more idiomatic to use \printtext[parens] instead of \mkbibparens. Then you can use \setunit{\addspace} instead of the bare \addspace. In combination that should have exactly the same result, but it feels a bit more biblatex-y. – moewe Dec 22 '15 at 8:24
  • @moewe Thanks. I will update this shortly. Is \mkbibparens really for use in documents as opposed to formatting commands? – cfr Dec 22 '15 at 11:11
  • 1
    As far as I can tell \mkbibparens and friends are really only ever used in \DeclareFieldFormat directives. If you want to have parentheses and such in your biblatex macros, the way to go seems to be \printtext[parens]. But this is more or less from what I observed so far, the only official thing I could find is §4.11.7 Using the Punctuation Tracker in the docs, esp. §4.11.7.2. It is quite easy to come up with code that uses \mkbibparens and shows side effects, some of them can be avoided at the cost of other undesirables. – moewe Dec 22 '15 at 12:57
  • @moewe Thanks! Could you check I've got it right? – cfr Dec 22 '15 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.