Biblatex:动态引用命令中的 *vgl.* 和编号问题

Biblatex:动态引用命令中的 *vgl.* 和编号问题

Biblatex:自动是。& 自动引文缩进(取决于引文长度)lockstep 根据 lockstep 和 Martin Scharrer 之前的贡献创建了一个引用命令,

  1. 当输出超过一定行数(最好是 3 行)时,将会进行排版缩进。

  2. 引用将自动排版,不带“Vgl.”——无论是短格式还是长格式。

  3. 当输出是释义或摘要时(换句话说:当输出没有引用时),它会使用预注“Vgl”排版。

  4. 它在 biblatex 中起作用。

主要目的是实现藝術。(英语比较)和行缩进。

使用此命令一段时间后出现了两个小问题。

  1. 每当你使用\autocites{}{}多个来源时,你都会得到类似的结果藝術。 Grice(1989)藝術。莱文森(2000)。包括一个以上藝術。. 问题是:是否有可能有一个藝術。一开始只出现一次,然后抑制所有后续相同的来源\autocite{}{},从而产生另请参见 Grice (1989);Levinson (2000)。无需任何额外藝術。

  2. 当您使用此命令时自动引用=脚注计数器将随着\autocite嵌入在 中的每个 而“跳跃”两步\cquotation{},例如,每当您有这样的事情时,\cquotation{text text text \autocite{}.}计数器就会加二而不是加一。

有人知道如何解决这些问题吗?

下面是锁步代码。为了解决我的具体问题,我在开头autocite=footnote添加了两次。This is a paraphrase \autocite{A01}{A01}

\documentclass{article}

\usepackage[ngerman]{babel}

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

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

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

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

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

在此处输入图片描述

答案1

您可能喜欢以下修改

问题 1 可以通过重新定义multicite multiprenotebibmacro 来解决。如果遇到这种prenote情况,我们会重新定义multiprenote添加“vgl”注释,并重新定义prenote不这样做的正常情况。

问题 2 可以通过禁用用于评估文本长度的框中的脚注命令来解决。该命令cquotation会在其参数中对文本进行两次排版:一次是不可见的,以检查其长度(以决定如何处理文本),另一次是正确排版;不可见的排版也会增加脚注编号,因此您会得到双倍步骤。

\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

然后我们的 MWE 得出

\documentclass{article}

\usepackage[ngerman]{babel}

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

\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


\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 \autocites{A01}{A01} % Added by Philip

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

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

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

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

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

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

\printbibliography

\end{document}

在此处输入图片描述


如果您使用,csquotes您可能想看看blockquote,这是一个非常复杂的内联/段落切换实现。

我们还可以借用内部宏来实现我们的目的:\blockquote@parsehook禁用 LaTeX 代码中所有不需要的脆弱部分,例如脚注、边注、标签和索引命令savebox。甚至还有一个命令供用户添加要在blockquote评估中禁用的命令:\BlockquoteDisable{}

命令\cquotation则变成。

\makeatletter
\newcommand{\cquotation}[1]{%
    \begingroup
    \booltrue{withintextquote}%
    % \settowidth doesn't like paragraphs
    \setbox\@tempboxa\vbox{%
        \def\par{\hspace{3\linewidth}}% If a paragraph is included force long form
        %\let\par\space  % Ignore paragraphs
        %\let\blx@thecheckpunct\@gobble
        \blockquote@parsehook
        #1}%
    \ifdim\wd\@tempboxa>3\linewidth
        \begin{quote}
            \itshape
            #1
        \end{quote}
    \else
        {\itshape #1}%
    \fi
    \endgroup}
\makeatother

相关内容