3

In How to create a \citejournal, \citebooktitle, \cite… command in biblatex? Gonzalo Medina and Audrey provided code that works like \citeauthor{}e.g. when you put in your document it creates just the title of a book or a journal ... This problem occurs for the \citeauthorcommand as well.

In Automatic Vgl. & automatic quote indenting (depending on quote length) lockstep creates a quotation command based on previous contribitions by lockstep and Martin Scharrer that

  1. Whenever it exceeds a certain number of lines in the output (preferably 3), it will be typeset indented.

  2. The citation will automatically be typeset without "Vgl." -- regardless of whether it is the short or the long form.

  3. When the output is a paraphrase or summary (in other words: when the output is no citation) it is typeset with the prenote "Vgl".

  4. It works in biblatex.

The main purpose is to automize both the vgl. (engl. compare) and the line indention.

The problem: Unfortunately, when you combine both codes the prenote vgl. will precede each \citeauthor, \citetitle etc. command in the output. You will get vgl. Author instead of Author. Is there anyone who could fix this problem globally?

\documentclass{article}

\usepackage[ngerman]{babel}

\usepackage[style=authoryear,autocite=footnote,backend=bibtex]{biblatex} % Here, Philip added "autocite=footnote,backend=bibtex"

%-------------------
\NewBibliographyString{compare}
\DefineBibliographyStrings{ngerman}{%
  compare = {vgl\adddot},
}

\newbool{withintextquote}

\renewbibmacro*{multiprenote}{%
  \renewbibmacro*{prenote}{%
    \iffieldundef{prenote}
      {}
      {\printfield{prenote}%
       \setunit{\prenotedelim}}}%
  \iffieldundef{multiprenote}{%
    \ifbool{withintextquote}{%
    }{%
      \bibstring{compare}\addspace
    }%
    }
    {\printfield{multiprenote}%
     \setunit{\prenotedelim}}}

\renewbibmacro*{prenote}{%
  \iffieldundef{prenote}{%
    \ifbool{withintextquote}{%
    }{%
      \bibstring{compare}\addspace
    }%
    }
    {\printfield{prenote}%
     \setunit{\prenotedelim}}}

\makeatletter
\newcommand{\cquotation}[1]{%
    \begingroup
    \booltrue{withintextquote}%
    % \settowidth doesn't like paragraphs
    \setbox\@tempboxa\hbox{%
        \def\par{\hspace{3\linewidth}}% If a paragraph is included force long form
        %\let\par\space  % Ignore paragraphs
        \let\footnote\@empty% make sure autocite does not do anything here; this is new
        \let\autocite\@empty
        #1}%
    \ifdim\wd\@tempboxa>3\linewidth
        \begin{quote}
            \itshape
            #1
        \end{quote}
    \else
        {\itshape #1}%
    \fi
    \endgroup}
\makeatother

%-------------------

\DeclareCiteCommand{\citejournal}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \usebibmacro{journal}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citebooktitle}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \usebibmacro{booktitle}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeintitle}% Based on \citetitle from biblatex.def
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \iffieldundef{journaltitle}
     {\iffieldundef{booktitle}
        {\iffieldundef{maintitle}
          {\printfield[citetitle]{labeltitle}}% Behave like \citetitle if no "main" title
          {\printtext[maintitle]{\printfield[titlecase]{maintitle}}}}
        {\printtext[booktitle]{\printfield[titlecase]{booktitle}}}}
     {\printtext[journaltitle]{\printfield[titlecase]{journaltitle}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

  \usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@Article{yoon,
  author = {Yoon, Myeong S. and Ryu, Dowook and Kim, Jeongryul and Ahn, Kyo Han},
  title = {Palladium pincer complexes with reduced bond angle strain: efficient catalysts
    for the Heck reaction},
  journaltitle = {Organometallics},
  volume = {25},
  number = {10},
  date = {2006},
  pages = {2409--2411}}
@InProceedings{salam,
  author = {Salam, Abdus},
  editor = {Svartholm, Nils},
  title = {Weak and Electromagnetic Interactions},
  booktitle = {Elementary Particle Theory},
  booksubtitle = {Relativistic Groups and Analyticity},
  booktitleaddon = {Proceedings of the Eighth Nobel Symposium},
  eventdate = {1968-05-19/1968-05-25},
  venue = {Aspen{\"a}sgarden, Lerum},
  publisher = {Almquist \& Wiksell},
  location = {Stockholm},
  date = {1968},
  pages = {367--377}}
@InProceedings{moraux,
  author = {Moraux, Paul},
  editor = {Lloyd, G. E. R. and Owen, G. E. L.},
  title = {Le \emph{De Anima} dans la tradition gr{\`e}cque},
  subtitle = {Quelques aspects de l'interpretation du trait{\'e}, de Theophraste {\`a}
    Themistius},
  shorttitle = {\emph{De Anima} dans la tradition gr{\`e}cque},
  booktitle = {Aristotle on Mind and the Senses},
  booktitleaddon = {Proceedings of the Seventh Symposium Aristotelicum},
  eventdate = {1975},
  publisher = cup,
  location = {Cambridge},
  date = {1979},
  pages = {281--324}}
@InCollection{pines,
  author = {Pines, Shlomo},
  editor = {Twersky, Isadore},
  indextitle = {Limitations of Human Knowledge According to Al-Farabi, ibn Bajja, and
    Maimonides, The},
  title = {The Limitations of Human Knowledge According to Al-Farabi, ibn Bajja, and
    Maimonides},
  shorttitle = {Limitations of Human Knowledge},
  booktitle = {Studies in Medieval Jewish History and Literature},
  publisher = hup,
  location = {Cambridge, Mass.},
  date = {1979},
  pages = {82--109}}
\end{filecontents}

\begin{document}

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

\cquotation{This is a short direct quotation. \autocite{yoon}}

\cquotation{This is a long direct quotation. This is a long direct
    quotation. This is a long direct quotation. This is a long direct
    quotation. This is a long direct quotation. This is a long direct
    quotation. This is a long direct quotation. This is a long direct
    quotation.\autocite{yoon}}

This is a paraphrase \autocite{yoon}

This is a paraphrase with prenote \autocite[siehe hierzu auch][]{yoon}

This is a paraphrase \autocite{yoon}
This is a paraphrase \autocite{yoon}

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

\cquotation{This is a short direct quotation. \autocite{yoon}}
This is a paraphrase \autocite{yoon}

\noindent
\citeintitle{yoon} versus \citejournal{yoon} \\\\
\citeintitle{salam} versus \citebooktitle{salam} \\\\
\citeintitle{moraux} versus \citebooktitle{moraux} \\\\
\citeintitle{pines} versus \citebooktitle{pines}
\printbibliography

\end{document}

Note1: The vgl. code used here is slightly refined by moewe based on the version of lockstep. It avoids strange numbering and a undesired output of the prenote vgl. in autocite=footnote setting in biblatex (the link Biblatex: Problems with vgl. and numbering in dynamic quotation command).

Note2: For the \citeauthor{} the problem could be fixed by replacing the command by \citeauthor[\unspace][]{}. As this affects the readability, a global solution would be prefered. However, maybe a global solution may build on this.

2

You could define a new \newbibmacro*{simp:prenote} that never prints any "vgl"/compare stuff

\newbibmacro*{simp:prenote}{%
  \iffieldundef{prenote}
    {}
    {\printfield{prenote}%
     \setunit{\prenotedelim}}}

(This, incidentally, is the standard definition of bibmacro{prenote} in biblatex.def.)

We then use this simple bib macro in all the \citetitle/\citeauthor and friends macros

We have to redefine the standard \citeauthor/\citetitle macros to use simp:prenote

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames[][1-1]{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printfield[citetitle]{labeltitle}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printfield[citetitle]{title}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeyear}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printfield{year}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeyear}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printfield{year}\printfield{extrayear}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citedate}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printdate}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citedate}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printdateextra}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeurl}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printfield[citeurl]{url}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\notecite}
  {\printfield{simp:prenote}%
   \setunit*{\prenotedelim}}
  {\nocite{\thefield{entrykey}}}
  {}
  {\printfield{postnote}}

\DeclareCiteCommand{\citejournal}
  {\usebibmacro{simp:prenote}}
  {\usebibmacro{citeindex}%
    \usebibmacro{journal}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citebooktitle}
  {\usebibmacro{simp:prenote}}
  {\usebibmacro{citeindex}%
    \usebibmacro{booktitle}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeintitle}% Based on \citetitle from biblatex.def
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \iffieldundef{journaltitle}
     {\iffieldundef{booktitle}
        {\iffieldundef{maintitle}
          {\printfield[citetitle]{labeltitle}}% Behave like \citetitle if no "main" title
          {\printtext[maintitle]{\printfield[titlecase]{maintitle}}}}
        {\printtext[booktitle]{\printfield[titlecase]{booktitle}}}}
     {\printtext[journaltitle]{\printfield[titlecase]{journaltitle}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

That is quite a lot of code, but quite straightforward.

MWE

\documentclass{article}

\usepackage[ngerman]{babel}

\usepackage[style=authoryear,autocite=footnote,backend=bibtex]{biblatex} % Here, Philip added "autocite=footnote,backend=bibtex"

%-------------------
\NewBibliographyString{compare}
\DefineBibliographyStrings{ngerman}{%
  compare = {vgl\adddot},
}

\newbool{withintextquote}

\renewbibmacro*{multiprenote}{%
  \renewbibmacro*{prenote}{%
    \iffieldundef{prenote}
      {}
      {\printfield{prenote}%
       \setunit{\prenotedelim}}}%
  \iffieldundef{multiprenote}{%
    \ifbool{withintextquote}{%
    }{%
      \bibstring{compare}\addspace
    }%
    }
    {\printfield{multiprenote}%
     \setunit{\prenotedelim}}}

\renewbibmacro*{prenote}{%
  \iffieldundef{prenote}{%
    \ifbool{withintextquote}{%
    }{%
      \bibstring{compare}\addspace
    }%
    }
    {\printfield{prenote}%
     \setunit{\prenotedelim}}}

\newbibmacro*{simp:prenote}{%
  \iffieldundef{prenote}
    {}
    {\printfield{prenote}%
     \setunit{\prenotedelim}}}

\makeatletter
\newcommand{\cquotation}[1]{%
    \begingroup
    \booltrue{withintextquote}%
    % \settowidth doesn't like paragraphs
    \setbox\@tempboxa\hbox{%
        \def\par{\hspace{3\linewidth}}% If a paragraph is included force long form
        %\let\par\space  % Ignore paragraphs
        \let\footnote\@empty% make sure autocite does not do anything here; this is new
        \let\autocite\@empty
        #1}%
    \ifdim\wd\@tempboxa>3\linewidth
        \begin{quote}
            \itshape
            #1
        \end{quote}
    \else
        {\itshape #1}%
    \fi
    \endgroup}
\makeatother

%-------------------

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames[][1-1]{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printfield[citetitle]{labeltitle}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printfield[citetitle]{title}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeyear}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printfield{year}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeyear}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printfield{year}\printfield{extrayear}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citedate}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printdate}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citedate}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printdateextra}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeurl}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\printfield[citeurl]{url}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\notecite}
  {\printfield{simp:prenote}%
   \setunit*{\prenotedelim}}
  {\nocite{\thefield{entrykey}}}
  {}
  {\printfield{postnote}}

\DeclareCiteCommand{\citejournal}
  {\usebibmacro{simp:prenote}}
  {\usebibmacro{citeindex}%
    \usebibmacro{journal}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citebooktitle}
  {\usebibmacro{simp:prenote}}
  {\usebibmacro{citeindex}%
    \usebibmacro{booktitle}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeintitle}% Based on \citetitle from biblatex.def
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{simp:prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \iffieldundef{journaltitle}
     {\iffieldundef{booktitle}
        {\iffieldundef{maintitle}
          {\printfield[citetitle]{labeltitle}}% Behave like \citetitle if no "main" title
          {\printtext[maintitle]{\printfield[titlecase]{maintitle}}}}
        {\printtext[booktitle]{\printfield[titlecase]{booktitle}}}}
     {\printtext[journaltitle]{\printfield[titlecase]{journaltitle}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

  \usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@Article{yoon,
  author = {Yoon, Myeong S. and Ryu, Dowook and Kim, Jeongryul and Ahn, Kyo Han},
  title = {Palladium pincer complexes with reduced bond angle strain: efficient catalysts
    for the Heck reaction},
  journaltitle = {Organometallics},
  volume = {25},
  number = {10},
  date = {2006},
  pages = {2409--2411}}
@InProceedings{salam,
  author = {Salam, Abdus},
  editor = {Svartholm, Nils},
  title = {Weak and Electromagnetic Interactions},
  booktitle = {Elementary Particle Theory},
  booksubtitle = {Relativistic Groups and Analyticity},
  booktitleaddon = {Proceedings of the Eighth Nobel Symposium},
  eventdate = {1968-05-19/1968-05-25},
  venue = {Aspen{\"a}sgarden, Lerum},
  publisher = {Almquist \& Wiksell},
  location = {Stockholm},
  date = {1968},
  pages = {367--377}}
@InProceedings{moraux,
  author = {Moraux, Paul},
  editor = {Lloyd, G. E. R. and Owen, G. E. L.},
  title = {Le \emph{De Anima} dans la tradition gr{\`e}cque},
  subtitle = {Quelques aspects de l'interpretation du trait{\'e}, de Theophraste {\`a}
    Themistius},
  shorttitle = {\emph{De Anima} dans la tradition gr{\`e}cque},
  booktitle = {Aristotle on Mind and the Senses},
  booktitleaddon = {Proceedings of the Seventh Symposium Aristotelicum},
  eventdate = {1975},
  publisher = cup,
  location = {Cambridge},
  date = {1979},
  pages = {281--324}}
@InCollection{pines,
  author = {Pines, Shlomo},
  editor = {Twersky, Isadore},
  indextitle = {Limitations of Human Knowledge According to Al-Farabi, ibn Bajja, and
    Maimonides, The},
  title = {The Limitations of Human Knowledge According to Al-Farabi, ibn Bajja, and
    Maimonides},
  shorttitle = {Limitations of Human Knowledge},
  booktitle = {Studies in Medieval Jewish History and Literature},
  publisher = hup,
  location = {Cambridge, Mass.},
  date = {1979},
  pages = {82--109}}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

\cquotation{This is a short direct quotation. \autocite{yoon}}

\cquotation{This is a long direct quotation. This is a long direct
    quotation. This is a long direct quotation. This is a long direct
    quotation. This is a long direct quotation. This is a long direct
    quotation. This is a long direct quotation. This is a long direct
    quotation.\autocite{yoon}}

This is a paraphrase \autocite{yoon}

This is a paraphrase with prenote \autocite[siehe hierzu auch][]{yoon}

This is a paraphrase \autocite{yoon}
This is a paraphrase \autocite{yoon}

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

This is a paraphrase \autocites{yoon}{yoon} % Added by Philip

\cquotation{This is a short direct quotation. \autocite{yoon}}
This is a paraphrase \autocite{yoon}

\noindent
\citeauthor{yoon} versus \citetitle{yoon} \\\\
\citeintitle{yoon} versus \citejournal{yoon} \\\\
\citeintitle{salam} versus \citebooktitle{salam} \\\\
\citeintitle{moraux} versus \citebooktitle{moraux} \\\\
\citeintitle{pines} versus \citebooktitle{pines}
\printbibliography

\end{document}

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.