文档类中章节内(以及跨章节)脚注中示例的连续编号

文档类中章节内(以及跨章节)脚注中示例的连续编号

我在课堂上写作[report],并使用包linguex在正文和脚注中编号示例。我需要对脚注中的例子进行连续编号。问题是,目前它们甚至在同一章内都不连续编号,更不用说跨章了。我找到了一个针对该包的相同问题的解决方案gb4e(此处:gb4e 示例在脚注中连续编号),但它涉及我的包中没有的计数器:fnx,因此它不适用于我的问题(至少我不清楚如何)。提前致谢。这是我第一次问问题,如果我可以问得更好,请告诉我。请注意,对于那些不使用该包的人linguex:它基于编号列表环境。因此解决方案可能取决于这一事实。

下面是说明该问题的最小代码,以及其编译的图片:

\documentclass[12pt]{report}

\usepackage{linguex} %for glossed examples


\counterwithout{ExNo}{chapter} % for continuous numbered examples
\counterwithout{footnote}{chapter} % for continuous numbered footnotes


\begin{document}


\chapter{This is Chapter 1}

bla 


\section{Section 1}

Here is some text.\footnote{Here is a footnote with two examples. 

\ex.\label{bla} bla

\ex.\label{blabla} blabla

As you can see in example \ref{bla} and \ref{blabla}, we got an issue. 
}

\ex. main bla

\ex. main blabla


Here is MORE text.\footnote{Here is ANOTHER footnote with ANOTHER couple of examples. 

\ex.\label{boom} boom

\ex.\label{boom2} boom boom

As you can see in example \ref{boom} and \ref{boom2}, we got an issue within chapters. 

}



\chapter{This is Chapter 2}

 bla 

\section{Section 1 of Ch2}

Here is some text.\footnote{Here is a footnote with two examples. 

\ex.\label{bla2} bla2

\ex.\label{blabla2} blabla2

As you can see in example \ref{bla2} and \ref{blabla2}, we got an issue. 
}


Here is MORE text.\footnote{Here is ANOTHER footnote with ANOTHER couple of examples. 

\ex.\label{boom-ch2} boom2

\ex.\label{boom2-ch2} boom2 boom2

As you can see in example \ref{boom-ch2} and \ref{boom2-ch2}, we got an issue not only within chapters, but also across chapters. 

}

\ex. main bla

\ex. main blabla


\end{document}

图片章节1 图片章节2

从图中可以看出,这些命令解决了正文中例子的编号问题和跨章节脚注的编号问题,但没有解决章节内或跨章节脚注中例子的编号问题。

针对脚注示例问题,章节内部分的解决方案是可以接受的,而跨章节部分的解决方案则更好。提前谢谢您,希望该解决方案也能帮助其他人。

答案1

我真的不知道你为什么要这样做,这绝对不是该领域的标准做法,但是脚注示例计数器是linguexFnExNo所以你可以添加:

\counterwithout{FnExNo}{footnote} % for continuous numbered examples in footnotes

使脚注中的示例连续编号。由于该\counterwithout命令会重置计数器的输出格式,因此您需要将其重新设置:

\renewcommand{\theFnExNo}{\theFnExLBr\Exroman{FnExNo}\theFnExRBr} 

由于格式假设使用小罗马数字而不是大罗马数字,您需要更改脚注示例编号的格式,否则您将得到如下所示的内容:

愚蠢的罗马例子

这是一个完整的示例,间距已调整以适应较大的罗马数字示例数字。间距总是会有点妥协,因为罗马数字的长度不会像阿拉伯数字那样线性增加。

如果你的审查委员会坚持要求每个示例都使用唯一的编号,那么更好的解决方案可能是使用阿拉伯数字加前缀对脚注示例进行编号F例如。这将使编号更加合理,但仍能满足唯一性问题。您可以使用此处的相同代码轻松完成此操作,但重新定义\Exroman

\renewcommand\Exroman{F\arabic}

这将在编号为 F1、F2 等的脚注中给出示例。

\documentclass[12pt]{report}

\usepackage{linguex} %for glossed examples


\counterwithout{ExNo}{chapter} % for continuous numbered examples
\counterwithout{footnote}{chapter} % for  continuous numbered footnotes
\counterwithout{FnExNo}{footnote} %  for continuous numbered footnote examples
\renewcommand{\theFnExNo}{\theFnExLBr\Exroman{FnExNo}\theFnExRBr}
\setcounter{FnExNo}{37}
\usepackage{etoolbox}
% adjust these next values[![enter image description here][2]][2] as needed depending on how many fn examples you end up with
\patchcmd{\NormalEx}{\else}
{\else\renewcommand{\philarge}{3em}\renewcommand{\philmiddle}{2em}\renewcommand{\philsmall}{2em}}{}{}
\begin{document}


\chapter{This is Chapter 1}

bla 


\section{Section 1}

Here is some text.\footnote{Here is a footnote with two examples. 

\ex.\label{bla} bla

\ex.\label{blabla} blabla

As you can see in example \ref{bla} and \ref{blabla}, we got an issue. 
}

\ex. main bla

\ex. main blabla


Here is MORE text.\footnote{Here is ANOTHER footnote with ANOTHER couple of examples. 

\ex.\label{boom} boom

\ex.\label{boom2} boom boom

As you can see in example \ref{boom} and \ref{boom2}, we got an issue within chapters. 

}



\chapter{This is Chapter 2}

 bla 

\section{Section 1 of Ch2}

Here is some text.\footnote{Here is a footnote with two examples. 

\ex.\label{bla2} bla2

\ex.\label{blabla2} blabla2

As you can see in example \ref{bla2} and \ref{blabla2}, we got an issue. 
}


Here is MORE text.\footnote{Here is ANOTHER footnote with ANOTHER couple of examples. 

\ex.\label{boom-ch2} boom2

\ex.\label{boom2-ch2} boom2 boom2

As you can see in example \ref{boom-ch2} and \ref{boom2-ch2}, we got an issue not only within chapters, but also across chapters. 

}

\ex. main bla

\ex. main blabla


\end{document}

第一章的脚注

相关内容