为什么感叹号会在第一行索引中造成换行?(诗歌包)

为什么感叹号会在第一行索引中造成换行?(诗歌包)

我正在使用 Poetry 包创建一本诗集。该包自动创建了首行索引,效果很好——但事实是,当首行包含感叹号时,就会出现这种情况。这会在索引中创建一个换行符(尽管不会在诗歌本身的排版中创建换行符)。

我认为问题在于 ! 被用于 MakeIndex,但类似的问题似乎可以通过在 ! 前面添加 " 来解决。这在这种情况下似乎不起作用(并且在排版文本中包含引号,这当然不是我想要的)。

诗歌包的文档可以在以下位置找到:https://ctan.org/pkg/poetry

最小工作示例:

\documentclass[]{article}
\usepackage{poetry}\poemlinenumsfalse

\begin{document}
\subsection*{The man from Nantucket}
\begin{poem}
\iofl{There once was a man from Nantucket}\\
Who kept all his cash in a bucket\\
Has daughter, named Nan\\
Ran away with a man\\
And as for the bucket, Nan tuck'it\\-
\end{poem}

\subsection*{Clementine}
\begin{poem}
\iofl{In a canyon}\\
In a cavern\\
Excavating from a mine\\
Lived a miner,\\
Forty-niner\\
And his daughter, Clementine\\-
\end{poem}


\subsection*{Marvin's lullaby}
\begin{poem}
\iofl{Now the world! has gone to bed},\\
Darkness won't engulf my head,\\
I can see by infrared,\\
How I hate the night.\\!

Now I lay me down to sleep,\\
Try to count electric sheep,\\
Sweet dream wishes you can keep,\\
How I hate the night.\\-
\end{poem}

\printiofl

\end{document}

还有另一种方法可以将内线添加到索引中,但它会产生相同的结果。

我感谢所有的帮助!

答案1

!默认情况下是 makeindex 用于分隔嵌套条目的特殊字符。

因此,您可以使用并输入带引号\poemfirsline的索引条目 ,或者您可以使用自定义索引样式!"!

\documentclass[]{article}
\usepackage{poetry}\poemlinenumsfalse

\begin{document}
\subsection*{The man from Nantucket}
\begin{poem}
\iofl{There once was a man from Nantucket}\\
Who kept all his cash in a bucket\\
Has daughter, named Nan\\
Ran away with a man\\
And as for the bucket, Nan tuck'it\\-
\end{poem}

\subsection*{Clementine}
\begin{poem}
\iofl{In a canyon}\\
In a cavern\\
Excavating from a mine\\
Lived a miner,\\
Forty-niner\\
And his daughter, Clementine\\-
\end{poem}


\subsection*{Marvin's lullaby}
\begin{poem}
\poemfirstline{Now the world"! has gone to bed}
Now the world! has gone to bed,\\
Darkness won't engulf my head,\\
I can see by infrared,\\
How I hate the night.\\!

Now I lay me down to sleep,\\
Try to count electric sheep,\\
Sweet dream wishes you can keep,\\
How I hate the night.\\-
\end{poem}

\printiofl

\end{document}

相关内容