评估一个命令中另一个命令的结果

评估一个命令中另一个命令的结果

我想使用 创建一个新的脚注引用命令,biblatex因此我使用\DeclareCiteCommand作为其定义。然后该命令\printfield{labelnumber}会给我引用的编号(根据style=numeric)。

但是当我想将的结果传递\printfield{labelnumber}给命令\footnotemark以指定要打印的数字时,我收到错误 Missing number。因此,我假设命令\footnotemark接收的是字符串\printfield{labelnumber},而不是其结果数字。

因此我的问题是如何评估或传递一个命令在另一个命令内的结果?

这是 MWE

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Harshman1970,
    author = {and others Harshman, Richard A},
    doi = {10.1134/S0036023613040165},
    issn = {00360236},
    journal = {UCLA Working Papers in Phonetics},
    pages = {1--84},
    title = {{Foundations of the PARAFAC procedure: Models and conditions for an" explanatory" multimodal factor analysis}},
    volume = {16},
    year = {1970}
}
@article{Hitchcock1927,
    author = {Hitchcock, Frank L.},
    doi = {10.1002/sapm192761164},
    issn = {0097-1421},
    journal = {Journal of Mathematics and Physics},
    number = {1-4},
    pages = {164--189},
    title = {{The Expression of a Tensor or a Polyadic as a Sum of Products}},
    volume = {6},
    year = {1927}
}   
\end{filecontents}

\usepackage[style=numeric, sorting=none, backend=bibtex]{biblatex}
\addbibresource{\jobname.bib}

\DeclareCiteCommand{\testcommand}
    {\usebibmacro{prenote}}
    {\footnotemark[\printfield{labelnumber}]\footnotetext[1]{\printfield{labelnumber} \printnames{labelname}%
    }}
    {\multicitedelim}
    {\usebibmacro{postnote}}


\begin{document}
    \begin{frame}{Slide 1\testcommand{Harshman1970}\testcommand{Hitchcock1927}}
        some text
    \end{frame}

\end{document}

答案1

\printfield{labelnumber}我只是把 Ulrike Fischer 的评论变成了答案。用命令替换命令\thefield{labelnumber}可以解决这个问题。

我对此确实没有解释,因此欢迎任何其他答案。

相关内容