
我正在寫一本金融數學書。這本書顯然充滿了方程式,編號如下:
第1章
公式1.1
公式1.2
…
第2章
公式2.1
公式2.2
…
有些方程式的證明比較困難或比較乏味,所以我只在正文中給出公式,而將形式證明放在腳註中。不過,我在腳註中對方程式進行編號時遇到問題。如果我讓 LaTeX 自動對它們進行編號,它將分配一個雙重編號方案,就像在文本中一樣(章節編號 + 章節中方程式的序號)。我想重置每個腳註的編號,例如:
- 註腳文本
公式1
公式2
…
或者:
- 註腳文本
方程式一
方程式二
…
我嘗試使用\setcounter{equation}{0}
,但不幸的是它只是將兩個數字方案重置為 1.1, 1.2...
有沒有辦法在註腳中使用不同的編號方案? 1、2、3...、I、II、III...、A、B、C... 之一?
答案1
您可能會對以下解決方案感興趣:腳註中的方程式編號為(<footnote>-<alphabetic-fneq-counter-rendered-in-smallcaps>)
,其中fneq
是與計數器分開的計數器equation
。請注意使用“連接”數字-
而不是.
“連接”數字。
我建議您在腳註中僅使用未編號的顯示數學環境,並\dotag
在您希望看到編號的方程式中提供說明。\dotag
採用強制參數-要套用的標籤,以啟用交叉引用。
\documentclass[oneside]{book}
\usepackage{amsmath}
\newcounter{fneq}
\counterwithin{fneq}{footnote}
\renewcommand\thefneq{\thefootnote-\textsc{\alph{fneq}}}
\newcommand\dotag[1]{\refstepcounter{fneq}\label{#1}\tag{\thefneq}}
\usepackage[noabbrev]{cleveref} % optional
\begin{document}
\chapter{Uno}
\setcounter{footnote}{4} % just for this example
\begin{equation} 1+1=2 \label{eq:1_1}\end{equation}
aaa.\footnote{%
A moment's reflection shows that
\begin{align*}
0+0&=0 \dotag{fneq:aa_1} \\
\intertext{and}
0-0&=0\,. \dotag{fneq:aa_2}
\end{align*}
}
bbb.\footnote{%
Pythagoras showed that
\[ a^2+b^2=c^2\,. \dotag{fneq:bb_1} \]
}
\begin{equation} 2+2=4 \label{eq:1_2}\end{equation}
\chapter{Due}
Cross-references to \cref{fneq:aa_1,fneq:aa_2,,fneq:bb_1,eq:1_2,eq:1_1}.
\end{document}