诗句环境不会设置为斜体

诗句环境不会设置为斜体

有人能帮我解决以下问题吗?我想用斜体排版缩进的段落。使用该verse包,段落排版没有问题,但当我尝试添加强调或斜体字体时,会出现错误消息。这是一个最小工作示例:

示例 1:正确设置(尽管除了信纸以外,其他纸张上也可以更好地居中)

\documentclass[11pt]{memoir}
\usepackage{geometry}   
\geometry{letterpaper}  
\usepackage{verse}
\begin{document}

As porcelain and cast iron beat out their clanging melody in Mrs. Dreyfus' kitchen, I
could hear the ineluctable screech of the saintly concertina, I could actually see the 
obese silhouette of the now anonymous musician with his black and silver bandoneón, his
stubby hands inhaling and exhaling the pain of his own private tango: Come on, woman, 
a little more rum, and close your polyester dress, because I saw your heart, naked in 
the  crystal that was trembling as I listened to your song.


\begin{verse}
A song to murder my sadness,\\\

To put me to sleep, to silence me.\\\

And in the cold of this bar-room table, we are both drunk, both drunk.\\\

And in the sensible sorrow that my drunkenness gives me, \\\

I ask you to sing your song for me like before,\\\

slowly, yes slowly, \\\

just one more time.\\\

\end{verse}

\centerline{*****}
\bigskip

The tango invited me to yet another round, but as I reached for the bottle of Ricard,
I heard the tinkling of a porcelain bell:  faint, but obnoxious all the same.  I 
released my hold on the neck of the bottle, and wiping my nose, pretended that I had 
been reaching for a tissue.  Her head hoisted high like a lady peacock about to 
display her finery before a male suitor, Mrs. Dreyfus bestrode the dining-room table 
and shook the delicate artifact from side to side, apparently to signal that the roast 
chicken and fried potatoes were now ready.  "Please come and sit down, David."
\end{document}

示例 2:这将产生一条错误消息:

\documentclass[11pt]{memoir}
\usepackage{geometry}
\geometry{letterpaper}  
\usepackage{verse}    
\begin{document}

As porcelain and cast iron beat out their clanging melody in Mrs. Dreyfus' kitchen, I 
could hear the ineluctable screech of the saintly concertina, I could actually see the 
obese silhouette of the now anonymous musician with his black and silver bandoneón, 
his stubby hands inhaling and exhaling the pain of his own private tango: Come on, 
woman, a little more rum, and close your polyester dress, because I saw your heart, 
naked in the crystal that was trembling as I listened to your song.

\begin{verse}
\emph {A song to murder my sadness,\\\

To put me to sleep, to silence me.\\\

And in the cold of this bar-room table, we are both drunk, both drunk.\\\

And in the sensible sorrow that my drunkenness gives me, \\\

I ask you to sing your song for me like before,\\\

slowly, yes slowly, \\\

just one more time.}\\\

\end{verse}

\centerline{*****}
\bigskip

The tango invited me to yet another round, but as I reached for the bottle of Ricard, 
I heard the tinkling of a porcelain bell:  faint, but obnoxious all the same.  I 
released my hold on the neck of the bottle, and wiping my nose, pretended that I had 
been reaching for a tissue.  Her head hoisted high like a lady peacock about to 
display her finery before a male suitor, Mrs. Dreyfus bestrode the dining-room table 
and shook the delicate artifact from side to side, apparently to signal that the roast 
chicken and fried potatoes were now ready.  "Please come and sit down, David."

\end{document}

我正在使用 Texshop 和 MacTex 2009。

答案1

不要使用 ,而要\emph使用\itshape。后者会改变字体形状(斜体),不需要参数,并且可以覆盖整个环境范围verse而不影响文档的其余部分。此范围由verse环境的\begin和对定义\end- 称为分组。

如果你想让诗句居中,我建议使用centervarwidth环境的组合。后者由varwidth包裹与 minipage 环境非常相似:

\begin{varwidth}{<width>}
   ...
\end{varwidth}

也就是说,它将宽度作为强制参数,<width>但如果环境内容的自然宽度较窄,则会缩放至环境内容的自然宽度。

\documentclass[11pt]{memoir}
\usepackage{varwidth}% http://ctan.org/pkg/varwidth
\usepackage[letterpaper]{geometry}   % http://ctan.org/pkg/geometry
\begin{document}

As porcelain and cast iron beat out their clanging melody in Mrs. Dreyfus' kitchen, I could hear the ineluctable screech of the saintly concertina, I could actually see the obese silhouette of the now anonymous musician with his black and silver bandoneón, his stubby hands inhaling and exhaling the pain of his own private tango: Come on, woman, a little more rum, and close your polyester dress, because I saw your heart, naked in the crystal that was trembling as I listened to your song.

\begin{verse}
\emph{A song to murder my sadness,\\
To put me to sleep, to silence me.\\
And in the cold of this bar-room table, we are both drunk, both drunk.\\
And in the sensible sorrow that my drunkenness gives me,\\
I ask you to sing your song for me like before,\\
slowly, yes slowly,\\
just one more time.}
\end{verse}

\centerline{*****}
\bigskip

The tango invited me to yet another round, but as I reached for the bottle of Ricard, I heard the tinkling of a porcelain bell:  faint, but obnoxious all the same.  I released my hold on the neck of the bottle, and wiping my nose, pretended that I had been reaching for a tissue.  Her head hoisted high like a lady peacock about to display her finery before a male suitor, Mrs. Dreyfus bestrode the dining-room table and shook the delicate artifact from side to side, apparently to signal that the roast chicken and fried potatoes were now ready. ``Please come and sit down, David.''

\newpage

As porcelain and cast iron beat out their clanging melody in Mrs. Dreyfus' kitchen, I could hear the ineluctable screech of the saintly concertina, I could actually see the obese silhouette of the now anonymous musician with his black and silver bandoneón, his stubby hands inhaling and exhaling the pain of his own private tango: Come on, woman, a little more rum, and close your polyester dress, because I saw your heart, naked in the crystal that was trembling as I listened to your song.

\begin{center}
\begin{varwidth}{\linewidth}
\itshape A song to murder my sadness,\\
To put me to sleep, to silence me.\\
And in the cold of this bar-room table, we are both drunk, both drunk.\\
And in the sensible sorrow that my drunkenness gives me,\\
I ask you to sing your song for me like before,\\
slowly, yes slowly,\\
just one more time.
\end{varwidth}
\end{center}

\centerline{*****}
\bigskip

The tango invited me to yet another round, but as I reached for the bottle of Ricard, I heard the tinkling of a porcelain bell:  faint, but obnoxious all the same.  I released my hold on the neck of the bottle, and wiping my nose, pretended that I had been reaching for a tissue.  Her head hoisted high like a lady peacock about to display her finery before a male suitor, Mrs. Dreyfus bestrode the dining-room table and shook the delicate artifact from side to side, apparently to signal that the roast chicken and fried potatoes were now ready. ``Please come and sit down, David.''

\end{document}

居中 varwidth 与 verse

上述示例在两个页面上显示了相同的内容。左侧页面使用\emphverse环境(如其他答案中所建议的),而右侧页面使用\itshapevarwidth环境。单击图像以查看其全尺寸并进行比较。

答案2

在您的第一个例子中,诗行之间的空行(即段落)是多余的。在您的第二个例子中,它们是有害的,因为 的参数中不允许有段落\emph。删除它们,或者更好的做法(如 Werner 所建议的)使用\itshape代替\emph。此外,用 替换\\\\\实现正确的间距。

编辑:在verse环境中,空行(段落)表示节,而\\应使用 来表示节内的换行符。也就是说,使用\itshape\em适用于多节诗句,而使用单节诗句\emph则不适用。

\documentclass[11pt]{memoir}

\usepackage{geometry}   

\geometry{letterpaper}  

\usepackage{verse}

\begin{document}

As porcelain and cast iron beat out their clanging melody in Mrs. Dreyfus' kitchen, I could hear the ineluctable screech of the saintly concertina, I could actually see the obese silhouette of the now anonymous musician with his black and silver bandoneón, his stubby hands inhaling and exhaling the pain of his own private tango: Come on, woman, a little more rum, and close your polyester dress, because I saw your heart, naked in the crystal that was trembling as I listened to your song.

\begin{verse}
\emph{A song to murder my sadness,\\
To put me to sleep, to silence me.\\
And in the cold of this bar-room table, we are both drunk, both drunk.\\
And in the sensible sorrow that my drunkenness gives me,\\
I ask you to sing your song for me like before,\\
slowly, yes slowly,\\
just one more time.}
\end{verse}

\centerline{*****}
\bigskip

The tango invited me to yet another round, but as I reached for the bottle of Ricard, I heard the tinkling of a porcelain bell:  faint, but obnoxious all the same.  I released my hold on the neck of the bottle, and wiping my nose, pretended that I had been reaching for a tissue.  Her head hoisted high like a lady peacock about to display her finery before a male suitor, Mrs. Dreyfus bestrode the dining-room table and shook the delicate artifact from side to side, apparently to signal that the roast chicken and fried potatoes were now ready.  "Please come and sit down, David."

\end{document}

答案3

如果你想让诗歌居中,\versewidth使用包裹:

\settowidth{\versewidth}{And in the cold of this bar-room table, we are both drunk, both drunk.}
\begin{verse}[\versewidth]
\linespread{1.2}\itshape
A song to murder my sadness,\\
To put me to sleep, to silence me.\\
And in the cold of this bar-room table, we are both drunk, both drunk.\\
And in the sensible sorrow that my drunkenness gives me, \\
I ask you to sing your song for me like before,\\
slowly, yes slowly, \\
just one more time.
\end{verse}

您将其设置\versewidth为较长诗句的宽度。其\linespread{1.2}\itshape效果是将诗行分开并以斜体排版。如果您不想要斜体,请将其更改\itshape\selectfont(但我不建议将诗行分开)。

答案4

正如 Ulrike Fischer 在回答这个问题时所解释的那样\em 和 \emph 之间有什么区别?、命令\textit{}\emph{}\textbf{}(仅举几例)接受一个参数——字体更改适用的文本——而\itshape\em\bfseries是 switch 类型的命令,它们不接受参数;当当前环境或组结束时,它们的作用域也结束。对于大多数用户来说,主要的参数类型和开关类型字体命令之间的实质性区别在于前者可以不是可以跨段落应用,而后者则可以。

介绍完毕后,很明显,\emph{}示例代码中命令失败的原因是诗行之间有(不必要的?)空行;空行会造成段落中断。如果您不想删除空白输入行,则必须使用或命令\em\itshape斜体字体排版诗节。

相关内容