行号不会通过开关选项重置

行号不会通过开关选项重置

当我使用带有选项 [switch] 的 lineno 包时,行号在被要求重置时不会重置(我的设置:最新的 TL 2012)。

梅威瑟:

\documentclass{article}
\usepackage[switch]{lineno}
\usepackage{lipsum}
\begin{document}
\begin{linenumbers}
 \lipsum[1-2]
\end{linenumbers}\clearpage
\begin{linenumbers}\resetlinenumber
 \lipsum[3-4]
\end{linenumbers}
\end{document}

忽略 [switch] 将导致重置行号,但这不是所需的双边设置中的选项。

答案1

使用 lineno 无法做到这一点。请查看手册:http://texdoc.net/texmf-dist/doc/latex/lineno/ulineno.pdf

它说有两种模式,运行和分页。

如果您使用选项switch,而不是使用 pagewise 选项,则可以切换显示数字的边距,但由于行号的处理方式,无法再重置行号。

正如手册中所述:

Pagewise line numbers. The lines on each page are numbered from one.
Automatic margin switching is possible.

Running mode can be simulated in pagewise mode, to get automatic
margin switching with continuous line numbers, but without the ability
to reset/preset the line numbers anywhere in the document.

基本上,switch没有pagewise在分页模式下模拟运行模式,如第二段所述。

您要么必须停止使用switch,要么包含pagewise从 1 开始对每页进行编号。

答案2

你可以一起使用它们:) 就像

\usepackage[switch, pagewise]{lineno}

相关内容