问题更改 LaTeX 中脚注标记的颜色,如何将颜色“转移”到尾注标记?具体来说,当使用
\usepackage{endnotes}
\let\footnote=\endnote?
使用 XeLaTeX 时需要特别注意什么?
答案1
我认为最好的选择是重新定义\@makeenmark
,这样做的好处是可以修复由 造成的笨拙定义endnotes
:
\documentclass{article}
\usepackage[paperheight=5cm]{geometry}% just for the example
\usepackage{xcolor}
\usepackage{endnotes}
%%% Customizations
\let\footnote\endnote
\makeatletter
\renewcommand\@makeenmark{%
\textsuperscript{\normalfont\textcolor{red}{\@theenmark}}%
}
\newcommand{\uncolormarkers}{%
\renewcommand\@makeenmark{%
\textsuperscript{\normalfont\@theenmark}%
}%
}
\makeatother
\begin{document}
PHP, Java, C\footnote{It has been many years since I've
used this in a project}, Python
\uncolormarkers
\theendnotes
\end{document}
\uncolormarkers
如果您希望结尾注释部分的标记也为红色,只需将其删除即可。
这是一种可能的使用方式enotez
:
\documentclass{article}
\usepackage[paperheight=5cm]{geometry}% just for the example
\usepackage{xcolor}
\usepackage{enotez}
%%% Customizations
\let\footnote\endnote
\NewDocumentCommand{\colorendnotemark}{m}{%
\textsuperscript{\textcolor{red}{#1}}%
}
\setenotez{
mark-cs = \colorendnotemark
}
\begin{document}
PHP, Java, C\footnote{It has been many years since I've
used this in a project}, Python
\printendnotes
\end{document}
答案2
由于您没有透露您想要哪种情况(Gonzalo 在链接答案中讨论的不同选项),这里有一个入门:
\documentclass{article}
\usepackage[paperheight=3cm]{geometry}% just for the example
\usepackage{xcolor}
\usepackage{endnotes}
\let\footnote=\endnote
\renewcommand{\makeenmark}{\hbox{\color{red}$^\theenmark$}}
% or
% \makeatletter
% \renewcommand{\makeenmark}{\textcolor{red}{\@makeenmark}}
% \makeatother
\begin{document}
PHP, Java, C\footnote{\label{a}It has been many years since I've used this in a project}, Python
As was mentioned in~\ref{a}
\theendnotes
\end{document}