![poetryscol:如何使用 \startverseline 修复轻微缩进?](https://linux22.com/image/418084/poetryscol%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20%5Cstartverseline%20%E4%BF%AE%E5%A4%8D%E8%BD%BB%E5%BE%AE%E7%BC%A9%E8%BF%9B%EF%BC%9F.png)
我用它\startverseline
来将行号与溢出行的开头对齐(如 poetryscol 手册 3.3.2 中所述)。行号现在位于正确的位置,但行略微缩进。有人知道解决这个问题的办法吗?下面是 MWE:
\documentclass{article}
\usepackage{fancyhdr, poemscol}
\setverselinemodulo{2}
\begin{document}
\begin{poem}
\begin{stanza}
Short line\verseline
Long line without startverseline --- long long long long
long long long long long long long long line\verseline
Short line\verseline
\startverseline Long line with startverseline, numbered ---
long long long long long long long long long long line\verseline
Short line\verseline
Short line\verseline
\startverseline Long line with startverseline, not numbered ---
long long long long long long long long long long line\verseline
Short line\end{stanza}
\end{poem}
\end{document}
\startverseline
我遇到了这个问题:无论是否有行号,带有的溢出行都会稍微缩进:
我正在使用最新版本的 xelatex 和 poemscol:
XeTeX 3.14159265-2.6-0.999992 (TeX Live 2020)
Package: poemscol 2020/06/12 v3.141592 poemscol file
答案1
这个包在行尾添加了几十个%,但是却遗漏了几个需要它们的地方:
\documentclass{article}
\usepackage{fancyhdr, poemscol}
\makeatletter
\renewcommand{\verseline}{\ifspeciallinelock%
\relax\else%
\nolinebreak\incrementverselinenumber%
\fi%
\speciallinelockfalse%
\nolinebreak\\%<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
\renewcommand{\incrementverselinenumber}{%
\nolinebreak\addtocounter{verselinenumber}{1}%
%%NO! \makeatletter
\@ifundefined{marksthe}{\relax}{\marksthe{verselinemark}{\theverselinenumber}}%<<<<<<<<<<<<<<<<<<<<<<
%%NO! \makeatother
\addtocounter{printlineindex}{1}%
\ifnum\theprintlineindex>\thelineindexrepeat%
\ifverselinenumbers\nobreak%
\putverselinenumber\nobreak%
\fi\nobreak%
\setcounter{printlineindex}{0}%
\fi%
}
\makeatother
\setverselinemodulo{2}
\begin{document}
\begin{poem}
\begin{stanza}
Short line\verseline
Long line without startverseline --- long long long long
long long long long long long long long line\verseline
Short line\verseline
\startverseline Long line with startverseline, numbered ---
long long long long long long long long long long line\verseline
Short line\verseline
Short line\verseline
\startverseline Long line with startverseline, not numbered ---
long long long long long long long long long long line\verseline
Short line\end{stanza}
\end{poem}
\end{document}