使用 \DeclareCiteCommand 创建的自定义 cite-command 中的“[”

使用 \DeclareCiteCommand 创建的自定义 cite-command 中的“[”

对于我的工作,我需要一个自定义引用命令,它可以创建具有自定义样式的脚注。为此,我使用以下命令\DeclareCiteCommand

\DeclareCiteCommand{\xfootcite}[\mkbibfootnote][\unspace]
 {\usebibmacro{citeindex}
\setunit{\labelnamepunct}
\printtext{Vgl}
\printnames{author}
\printfield{prenote}
\printfield{year}
{\usebibmacro{postnote}}
}

脚注本身有效,但是在脚注的开头有一个[,如下所示:

在此处输入图片描述

[当我使用时会出现,[\unspace]但是如果我将其删除,则脚注之间会出现一个只有一个点的空行:

在此处输入图片描述

有没有办法让脚注不带[空行?我很久没用过 LaTeX 了,所以我自己也搞不清楚,也没发现类似的问题

答案1

也许你正在寻找以下内容

示例输出

\documentclass{article}

\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareCiteCommand{\xfootcite}[\mkbibfootnote]{%
\usebibmacro{citeindex}%
\iffieldundef{prenote}{\printtext{Vgl}\adddot\addspace}%
{\printfield{prenote}\setunit{\prenotedelim}}}%
{\printnames{author}\addspace
\printfield{year}}%
{\multicitedelim}%
{\usebibmacro{postnote}}

\begin{document}

\xfootcite{westfahl:space}

\xfootcite{angenendt,westfahl:space}

\xfootcite[See][]{westfahl:space}

\end{document}

\DeclareCiteCommand需要五个强制参数和一个可选参数。您的语法看起来[\unspace]像是第二个可选参数,但被读作前三个强制参数[\unspace]。输出中的空格是由行尾字符添加的,您需要%在适当的位置用 注释掉。

我已尝试猜测您可能想如何使用预注。

相关内容