以上 n 个引用已损坏

以上 n 个引用已损坏

编辑:从我的 aglc2.cbx 文件中添加了完整的引用宏。
编辑:按照 domwass 的建议添加了 cite:save 宏
编辑:添加了这些文件链接以重现问题
更新:我想我现在已经解决了这个问题。关键是按照 @domwass 的建议创建一个cite:save宏。更新后的代码如下


嗨,我认为这是一个新手问题。在我的 biblatexcite宏中,我有以下代码:

\newbibmacro*{cite:save}{%
    \csxdef{cbx@\thefield{entrykey}}{\the\value{instcount}}%
    \label{cbx@\the\value{instcount}}%
}

\newbibmacro*{cite}{%
\global\boolfalse{cbx@loccit}%
\ifciteseen
{%
    \iffieldundef{shorthand}
    {%
        \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
        {%
            % citeibid is true and this citation has been seen on this page previously
            % and citation is in a footnote
            \usebibmacro{cite:ibid}%
        } {%else
            % either citeibid is false or this is the first time the citation appears
            % on this page
            \ifthenelse{\(\equal{\thefield{entrytype}}{jurisdiction}\or%
                    \equal{\thefield{entrytype}}{legislation}\or%
                    \equal{\thefield{entrytype}}{legal}\)%
                \or\not\ifciteseen}
                    {%
                % If the entry is a jurisdiction or legislation or legal
                % or if the citation has not been seen before
                % ie: this is how to print a first citation.  Legislation, legal and
                % jurisdictions are always printed as though they were a first citation.
                \usebibmacro{cite:short}%
            } {% else
                % Must be something else or a subsequent citation
                \usebibmacro{author/editor:surname}%
                                   above n\addnbspace%
                                    \ref{cbx@\csuse{cbx@\thefield{entrykey}}}%
            }
        } {%
            % shorthand field is defined
            \usebibmacro{cite:shorthand}%
        }
    }
} {%
    % citation has not been seen before
    \usebibmacro{cite:full}
}
}

因此,当脚注打印为 ...'above n xx' 时,xx 是页码。我如何将其设置为脚注编号?

答案1

在引用条目的第一个引用之前,您必须保存信息。为此,您可以创建一个 bibmacro:

\newbibmacro*{cite:save}{%
  \csxdef{cbx@\thefield{entrykey}}{\the\value{instcount}}}

然后,您必须在 cite-bibmacro 中调用这个 bibmacro,在测试的第二个强制参数中\ifciteseen(因此,仅当该条目第一次被引用时):

\newbibmacro*{cite}{%
  […]
  \ifciteseen
    {[…]}
    {[…]
     \usebibmacro{cite:save}}}

现在,每次您想要回顾第一个条目时,您可以使用以下几行:

\bibstring{seenote}\addnbspace
\ref{cbx@\csuse{cbx@\thefield{entrykey}}%
***\label{cbx@\the\value{instcount}}***}

因此,您发布的 bibmacro 可以进行如下修改(我尚未测试过!):

\newbibmacro*{cite:save}{%
  \csxdef{cbx@\thefield{entrykey}}{\the\value{instcount}}}

\newbibmacro*{cite}{%
\global\boolfalse{cbx@loccit}%
\ifciteseen
{%
    \iffieldundef{shorthand}
    {%
        \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
        {%
            % citeibid is true and this citation has been seen on this page previously
            % and citation is in a footnote
            \usebibmacro{cite:ibid}%
        } {%else
            % either citeibid is false or this is the first time the citation appears
            % on this page
            \ifthenelse{\(\equal{\thefield{entrytype}}{jurisdiction}\or%
                    \equal{\thefield{entrytype}}{legislation}\or%
                    \equal{\thefield{entrytype}}{legal}\)%
                \or\not\ifciteseen}
                    {%
                % If the entry is a jurisdiction or legislation or legal
                % or if the citation has not been seen before
                % ie: this is how to print a first citation.  Legislation, legal and
                % jurisdictions are always printed as though they were a first citation.
                \usebibmacro{cite:short}%
            } {% else
                % Must be something else or a subsequent citation
                \usebibmacro{author/editor:surname}%
                \bibstring{seenote}\addnbspace%
                \ref{cbx@\csuse{cbx@\thefield{entrykey}}}%
            }
        } {%
            % shorthand field is defined
            \usebibmacro{cite:shorthand}%
        }
    }
} {%
    % citation has not been seen before
    \usebibmacro{cite:full}%
    \usebibmacro{cite:save}%
}
}

但请注意,这只有当每个引用都在脚注中时才有效。如果您也在文本中引用,并且条目的第一个引用在文本中而不是在脚注中,则引用将不起作用。这就是为什么 biblatex 的样式verbose-note区分脚注中的引用和文本中的引用。因此,那里的代码稍微复杂一些。

相关内容