Editor-cite:如何使用 \DeclareCiteCommand 创建新命令

Editor-cite:如何使用 \DeclareCiteCommand 创建新命令

使用biblatex-chicago,我如何创建一组新的引用命令\edcite,并\edvolcite在第一个引用上排版“ editor-fullname( address: publisher, year/ date), pagerange/ vol-page-range”,并在后续引用上排版“ editor-lastname, pagerange/ vol-page-range”?

这个问题与我之前问过的一个问题类似引用中世纪文本版本,但我认为答案需要非常不同的解决方案,涉及\DeclareCiteCommand,而不是biblatex-source-division(这仅适用于您还想biblatex格式化中世纪/古代作者的姓名和书名的情况)。

参考书目中的条目应该正常。

梅威瑟:

\documentclass{article}

\usepackage[notes]{biblatex-chicago}

\begin{filecontents*}{\jobname.bib}
@book{photios:bibliotheca:henry,
    Address = {Paris},
    Author = {Photios},
    Booktitle = {Bibliothèque},
    Editor = {Henry, René},
    Entrysubtype = {primary},
    Note = {index by Jacques Schamp},
    Publisher = {Les Belles Lettres},
    Title = {Bibliothèque},
    Volumes = {9},
    Year = {1959--1991}}
@book{VettiusValens:Pingree1986,
    Address = {Leipzig},
    Author = {{Vettius Valens}},
    Editor = {Pingree, David},
    Entrysubtype = {primary},
    Publisher = {Teubner},
    Title = {Vettii Valentis Antiocheni Anthologiarum Libri Novem},
    Year = {1986}}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

\section{edcite}

1st time:
\cite[1]{VettiusValens:Pingree1986}.

2nd time:
\cite[2]{VettiusValens:Pingree1986}.

\mancite{}

Again after \verb`\mancite`:
\cite[3]{VettiusValens:Pingree1986}.


\section{edvolcite}

1st time:
\volcite{2}[169]{photios:bibliotheca:henry}.

2nd time:
\volcite{1}[20]{photios:bibliotheca:henry}.

\mancite{}

Again after \verb`\mancite`:
\volcite{2}[40]{photios:bibliotheca:henry}.

\end{document}

为了实现这一点,我使用了\cite\volcite。我希望用\edcite和替换它们\edvolcite以产生以下输出:

1 篇引用

第一次:David Pingree(莱比锡:Teubner,1986),1。

第二次:同上,2。

再次之后\mancite:Pingree,3。

2 火山灰岩

第一次:René Henry(巴黎:Les Belles Lettres,1959–1991),第卷。 2,页169.

第二次:同上,第1卷,第20页。

再次之后\mancite:Henry,第 2 卷,第 40 页。

我想象答案将类似于(或使用)命令\blindcite @moewe 为响应我提出的问题几年前,但我对在\DeclareCiteCommand没有理解其工作原理的情况下乱用它持谨慎态度。

答案1

\footcite这非常简单地展示了如何做到这一点。但如果您想要其他标准引用命令等效项(例如, ,\autocite\parenciteplus 变体),您实际上可能需要的不止这些。

不过这并不难。看看biblatex.def引用命令是如何声明的。

我使用的引用命令也非常简单,并假设您需要的所有条目都与\edcite示例中给出的条目一样,但这可能并非事实。

\documentclass{article}

\usepackage[notes]{biblatex-chicago}

\begin{filecontents*}{\jobname.bib}
@book{photios:bibliotheca:henry,
    Address = {Paris},
    Author = {Photios},
    Booktitle = {Bibliothèque},
    Editor = {Henry, René},
    Entrysubtype = {primary},
    Note = {index by Jacques Schamp},
    Publisher = {Les Belles Lettres},
    Title = {Bibliothèque},
    Volumes = {9},
    Year = {1959--1991}}
@book{VettiusValens:Pingree1986,
    Address = {Leipzig},
    Author = {{Vettius Valens}},
    Editor = {Pingree, David},
    Entrysubtype = {primary},
    Publisher = {Teubner},
    Title = {Vettii Valentis Antiocheni Anthologiarum Libri Novem},
    Year = {1986}}
\end{filecontents*}
\addbibresource{\jobname.bib}

\newbibmacro*{edcite}{%
  \ifboolexpr{
    test {\ifciteibid}
    and
    not test {\iffirstonpage}
  }
    {\usebibmacro{cite:ibid}}
    {\ifciteseen
       {\printnames[labelname]{editor}}
       {\printnames[given-family]{editor}%
        \newcunit
        \usebibmacro{cpubl+loc+year}}}}

\DeclareCiteCommand{\edcite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{edcite}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareMultiCiteCommand{\edcites}{\edcite}{\multicitedelim}
\newrobustcmd*{\edvolcite}{\volcitecmd\edcite}
\newrobustcmd*{\edvolcites}{\volcitecmd\edcites}

\pagestyle{empty}

\begin{document}

\section{edcite}

1st time:
\edcite[1]{VettiusValens:Pingree1986}.

2nd time:
\edcite[2]{VettiusValens:Pingree1986}.

\mancite{}

Again after \verb`\mancite`:
\edcite[3]{VettiusValens:Pingree1986}.

\section{edvolcite}

1st time:
\edvolcite{2}[169]{photios:bibliotheca:henry}.

2nd time:
\edvolcite{1}[20]{photios:bibliotheca:henry}.

\mancite{}

Again after \verb`\mancite`:
\edvolcite{2}[40]{photios:bibliotheca:henry}.

\end{document}

在此处输入图片描述

相关内容