Is it possible to create a command that:
- Whenever it exceeds a certain number of lines in the output (preferably 3), it will be typeset indented.
- The citation will automatically be typeset without "Vgl." -- regardless of whether it is the short or the long form.
- When the output is a paraphrase or summary (in other words: when the output is no citation) it is typeset with the prenote "Vgl".
- It works in
biblatex.
Related answers for inspiration:
In Linking quotation environment with citation styles lockstep worked out a quotation command based on biblatex that automatically generates a "Vgl."-less output when used in a citation environment. And that generates a "Vgl." output when used without quotation mark.
Output-Example:
This is a paraphrase (vgl. Author 2001)
This is a paraphrase with prenote (siehe hierzu auch Author 2001)
"This is a direct quotation" (Author 2001)
The Code:
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[style=authoryear]{biblatex}
\NewBibliographyString{compare}
\DefineBibliographyStrings{ngerman}{%
compare = {vgl\adddot},
}
\usepackage{csquotes}
\SetCiteCommand{\autocite}
% \usepackage{etoolbox}% loaded by `biblatex`
\newbool{withintextquote}
\makeatletter
\patchcmd{\csq@tquote@i}{\begingroup}{\begingroup\booltrue{withintextquote}}{}{}
\makeatother
\renewbibmacro*{prenote}{%
\iffieldundef{prenote}{%
\ifbool{withintextquote}{%
}{%
\bibstring{compare}\addspace
}%
}
{\printfield{prenote}%
\setunit{\prenotedelim}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
This is a paraphrase \autocite{A01}
This is a paraphrase with prenote \autocite[siehe hierzu auch][]{A01}
\textcquote{A01}{This is a direct quotation}
\printbibliography
\end{document}
In Custom quotation style which depends on length of quotation Martin Scharrer worked out a way to generate quotations that are typeset indented or unindented -- depending on the length of the quotation. The main point with this command is: Whenever the quotation exceeds a certain number of lines in the typeset output, it will be indented.
The code:
\documentclass{article}
\makeatletter \newcommand{\cquotation}[1]{%
% \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
#1}%
\ifdim\wd\@tempboxa>3\linewidth
\begin{quote}
\itshape
#1
\end{quote}
\else
{\itshape #1}%
\fi } \makeatother
\begin{document}
% Lipsum add paragraphs :-( \def\Text{text text text text text } \edef\Text{\Text\Text\Text\Text\Text}
\Text \cquotation{some short quote} \Text
\Text \cquotation{% Some quotation just short of three lines of text. Some quotation just short of three lines of text. Some quotation just short of three lines of text. Some quotation just short of three lines of text. Some quotation just short of three lines. } \Text
\Text \cquotation{% Some quotation shorter than three lines.
But with a paragraph inside. } \Text
\Text \cquotation{% Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. } \Text
\end{document}
% Lipsum add paragraphs :-( \def\Text{text text text text text } \edef\Text{\Text\Text\Text\Text\Text}
\Text \cquotation{some short quote} \Text
\Text \cquotation{% Some quotation just short of three lines of text. Some quotation just short of three lines of text. Some quotation just short of three lines of text. Some quotation just short of three lines of text. Some quotation just short of three lines. } \Text
\Text \cquotation{% Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. Some quotation longer than three lines. } \Text
\end{document}

