Biblatex:自动*Vgl.*和自动引文缩进(取决于引文长度)

Biblatex:自动*Vgl.*和自动引文缩进(取决于引文长度)

是否可以创建一个命令:

  1. 当输出超过一定行数(最好是 3 行)时,将会进行排版缩进。
  2. 引文将自动排版,不带“是。“——无论它是简短形式还是长篇形式。
  3. 当输出是释义或摘要时(换句话说:当输出没有引用时),它会使用预注排版“维格“。
  4. 它在 中起作用biblatex

相关启发答案:

将引用环境与引用样式相链接lockstep 制定了一个基于的引用命令biblatex,可以自动生成“是。在引用环境中使用时,输出较少。这会生成一个“是。“不带引号使用时输出。

输出示例:

这是一个释义(vgl. 作者 2001)

这是带有注释的释义(参见作者 2001)

“这是直接引用” (作者 2001)

代码:

\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}

自定义引用样式取决于引用的长度Martin Scharrer 想出了一种生成排版缩进或不缩进的引文的方法——具体取决于引文的长度。此命令的要点是:只要引文在排版输出中超过一定行数,就会缩进。

代码:

\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}

笔记。这个命令有两个小问题。

  1. 每当你使用\autocites{}{}多个来源时,你都会得到类似的结果藝術。 Grice(1989)藝術。莱文森(2000)。包括一个以上藝術。

  2. 当您使用此命令时,autocite=footnote计数器将“跳跃”两步,每\autocite一步都嵌入在 中\cquotation{},例如,每当您有这样的情况时,\cquotation{text text text \autocite{}.}计数器就会增加两个而不是一个。因此,脚注的编号看起来会很奇怪(例如 1、2、3、5、7、8、9...)。

moewe 的回答成功地解决了这两个问题Biblatex:问题藝術。动态引用命令中的编号

答案1

biblatex假设您想在 Martin Scharrer 命令的参数中使用引用命令\cquotation,则需要修补后者,以便它将withintextquote我的链接答案的布尔值在组内设置为 true。

\documentclass{article}

\usepackage[ngerman]{babel}

\usepackage[style=authoryear]{biblatex}

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

\newbool{withintextquote}

\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
        #1}%
    \ifdim\wd\@tempboxa>3\linewidth
        \begin{quote}
            \itshape
            #1
        \end{quote}
    \else
        {\itshape #1}%
    \fi
    \endgroup}
\makeatother


\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

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

\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{A01}}

This is a paraphrase \autocite{A01}

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

\printbibliography

\end{document}

在此处输入图片描述

相关内容