在elsarticle
课堂上,当您使用命令时\tnoteref
,星号会被放置在标题末尾,并用作脚注的符号,请参见下面的示例。
我想将其改为星号以外的其他符号,比如匕首。有没有办法通过在.tex
文件前言中添加代码来实现这一点?
\documentclass{elsarticle}
\begin{document}
\begin{frontmatter}
\title{This is a specimen title\tnoteref{t1}}
\author{M. Author}
\tnotetext[t1]{This document is a collaborative effort.}
\end{frontmatter}
\section{Paper Material}
Some Text.
\end{document}
输出:
答案1
由于 elsarticle
自从这个答案首次发布以来,方法现在取决于软件包版本。
针对版本 3.1(2019 年 1 月)
自 1.2 版起,该包\ding{73}
用替换了$\star$
标题脚注,并改变了处理脚注索引的方法。此外,还提供了一个新的包选项 (doubleblind
还添加了一个新的软件包选项 ( ),如果使用,则禁用标题脚注。
以下是对原始“为了好玩”的编辑的重新实现,它删除了两个脚注的限制,并用用户定义的符号替换了默认符号\tnotemarksymbol
。
\documentclass{elsarticle}
\usepackage{etoolbox}
\usepackage{expl3}
\ExplSyntaxOn
\cs_new_eq:NN \Repeat \prg_replicate:nn
\ExplSyntaxOff
\makeatletter
\ifdoubleblind\else%The default behavior is to disable title footnotes for doubleblind reviews (the edit will fail if applied with the doubleblind option)
\patchcmd{\tnotetext}{\ifcase\c@tnote\or$\star$\or$\star\star$\fi}{\Repeat{\the\c@tnote}{\tnotemarksymbol}}{}{\@latex@error{Failed to patch \string\tnotetext}}
\patchcmd{\tnotemark}{\expandafter\ifcase\elsRef{\mytmark}\or$^{\star}$\or$^{,\star\star}$\fi}{\textsuperscript{\expandafter\ifnum\elsRef{\mytmark}>1,\fi\expandafter\Repeat\expandafter{\elsRef{\mytmark}}{\tnotemarksymbol}}}{}{\@latex@error{Failed to patch \string\tnotemark}}%
\fi
\makeatother
\newcommand{\tnotemarksymbol}{\dag}
\begin{document}
\begin{frontmatter}
\title{This is a specimen title\tnoteref{t1}\tnoteref{t2}\tnoteref{t3}\tnoteref{t4}}
\author{M. Author}
\tnotetext[t1]{This document is a collaborative effort.}
\tnotetext[t2]{Another title note.}
\tnotetext[t3]{One more title note.}
\tnotetext[t4]{Yet another title note.}
\end{frontmatter}
\section{Paper Material}
Some Text.
\end{document}
原始答案:针对版本 1.2 和(可能)3.0
您可以修补\tnotemark
和\tnotetext
命令,将etoolbox
星号 ( \ding{73}
) 替换为匕首 ( \dag
):
\documentclass{elsarticle}
\usepackage{etoolbox}
\makeatletter
%replace first instance (first tnote)
\patchcmd{\tnotemark}{\ding{73}}{\dag}{}{\@latex@error{Failed to path \string\tnotemark\space for \string\ding{73}}}
%replace second instance (second tnote)
\patchcmd{\tnotemark}{\ding{73}\ding{73}}{\dag\dag}{}{\@latex@error{Failed to path \string\tnotemark\space for \string\ding{73}\string\ding{73}}}
%replace first instance (first tnote)
\patchcmd{\tnotetext}{\ding{73}}{\dag}{}{\@latex@error{Failed to path \string\tnotetext\space for \string\ding{73}}}
%replace second instance (second tnote)
\patchcmd{\tnotetext}{\ding{73}\ding{73}}{\dag\dag}{}{\@latex@error{Failed to path \string\tnotetext\space for \string\ding{73}\string\ding{73}}}
\makeatother
\begin{document}
\begin{frontmatter}
\title{This is a specimen title\tnoteref{t1}\tnoteref{t2}}
\author{M. Author}
\tnotetext[t1]{This document is a collaborative effort.}
\tnotetext[t2]{Another title note.}
\end{frontmatter}
\section{Paper Material}
Some Text.
\end{document}
编辑:
\tnotemark
为了好玩,这里是/\tnotetext
系统的概括elsarticle
为了好玩,这里是2 个以上音符expl3
。它使用(特别是 Joseph Wright 的这个回答\tnotemarksymbol
)通过与每个音符相关的计数来重复命令定义的符号。
\documentclass{elsarticle}
\usepackage{etoolbox}
\usepackage{expl3}
\ExplSyntaxOn
\cs_new_eq:NN \Repeat \prg_replicate:nn
\ExplSyntaxOff
\makeatletter
\patchcmd{\tnotetext}{\ifcase\c@tnote\or\ding{73}\or\ding{73}\ding{73}\fi}{\Repeat{\the\c@tnote}{\tnotemarksymbol}}{}{\@latex@error{Failed to patch \string\tnotetext}}
\patchcmd{\tnotemark}{\ifcase\tnotenum\or\ding{73}\or,\ding{73}\ding{73}\fi}{\ifnum\tnotenum>1,\fi\Repeat{\tnotenum}{\tnotemarksymbol}}{}{\@latex@error{Failed to patch \string\tnotemark}}
\makeatother
\newcommand{\tnotemarksymbol}{\dag}
\begin{document}
\begin{frontmatter}
\title{This is a specimen title\tnoteref{t1}\tnoteref{t2}\tnoteref{t3}\tnoteref{t4}}
\author{M. Author}
\tnotetext[t1]{This document is a collaborative effort.}
\tnotetext[t2]{Another title note.}
\tnotetext[t3]{One more title note.}
\tnotetext[t4]{Yet another title note.}
\end{frontmatter}
\section{Paper Material}
Some Text.
\end{document}
答案2
elsarticle
用于\ding{73}
将注释放置在标题内,如宏所标识的那样,\tnoteref
并\tnotetext
在内部elsarticle.dtx
:
\def\tnotemark[#1]{\textsuperscript{\@for\@@tmark:=#1\do{%
\edef\tnotenum{\@ifundefined{X@\@@tmark}{1}{\elsRef{\@@tmark}}}%
\ifcase\tnotenum\or\ding{73}\or,\ding{73}\ding{73}\fi}}%
\def\tnotetext[#1]#2{\g@addto@macro\@tnotes{%
\refstepcounter{tnote}\elsLabel{#1}%
\def\thefootnote{\ifcase\c@tnote\or\ding{73}\or\ding{73}\ding{73}\fi}%
\footnotetext{#2}}}
您可以在这里进行干预,并确定是否\ding{<num>}
提供73
:
\documentclass{elsarticle}
\let\oldding\ding% Make a copy of \ding called \oldding
% Update \ding to condition on 73 or otherwise
\renewcommand{\ding}[1]{\ifnum#1=73 $\star$\else\oldding{#1}\fi}
\begin{document}
\begin{frontmatter}
\title{This is a specimen title\tnoteref{t1}}
\author{M. Author}
\tnotetext[t1]{This document is a collaborative effort.}
\end{frontmatter}
\section{Paper Material}
Some Text.
\end{document}
这取决于您是否\tnote...
在里面使用一个或两个\title
(但删除了在其他地方使用的能力\ding{73}
)。