![更改腳註符號會中斷 \ref](https://rvso.com/image/370285/%E6%9B%B4%E6%94%B9%E8%85%B3%E8%A8%BB%E7%AC%A6%E8%99%9F%E6%9C%83%E4%B8%AD%E6%96%B7%20%5Cref.png)
我正在使用 XeLaTex 和 Memoir 類別。我重新定義了腳註符號,如下所示:
\renewcommand{\thefootnote}{{\ding{\numexpr171+\value{footnote}}}}
但是,當我在腳註中放置標籤時,這會破壞 \ref 編號。請參閱下面的 MWE。應該說「請參閱第 1 頁註 1」而不是「請參閱第 1 頁註 2」。我還使用了 perpage 套件和選項,但是無論有沒有它都會發生錯誤。
正確的做法是什麼?任何幫助表示讚賞。
\documentclass[11pt]{memoir}
\usepackage{pifont} %Need circled numbers for Chinese style footnote
\usepackage{perpage} %Renumber footnote on each new page
\usepackage{layouts} %To check page layout
%%% Book Layout %%%
\setstocksize{5in}{4in}
\settrimmedsize{5in}{4in}{*}
\setlength{\trimtop}{0pt}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{3in}{3in}{*}
\setulmargins{1in}{*}{*}
\setlrmargins{0.5in}{*}{*}
\setmarginnotes{0pt}{0pt}{0pt}
\checkandfixthelayout
%%% Footnote rule %%%
\MakePerPage{footnote}
\renewcommand{\thefootnote}{{\ding{\numexpr171+\value{footnote}}}}
\begin{document}
This is the first line\footnote{This is the first footnote.\label{ftn:first}}.
This is the second line\footnote{See page \pageref{ftn:first} footnote \ref{ftn:first}.}.
\end{document}
答案1
\makeatletter
\newcommand{\@fnding}[1]{\ding{\number\numexpr#1+171\relax}}
\newcommand{\fnding}[1]{\expandafter\@fnding\csname c@#1\endcsname}
\makeatother
\renewcommand{\thefootnote}{\fnding{footnote}}