`verse` を使用した最初の詩と前の段落の間の距離の調整

`verse` を使用した最初の詩と前の段落の間の距離の調整

アンビエントを使用して特定の散文テキストに詩を挿入すると、verse最初の詩節と前の段落の間、および最後の詩節と次の段落の間に距離が生じます。

ここに画像の説明を入力してください

これら2つのギャップを調整することは可能でしょうか?

答え1

の値は、適切な区切りを設定するようにしてください\topsep\partopsepの前に空白行がある場合には が追加されるのでverse、 の代わりに を設定するか、 と一緒に を設定するとよいことに注意してください\topsep

\documentclass{article}

\usepackage{xpatch}
\xpatchcmd\verse
  {\itemsep}
  {\topsep=0pt \partopsep=0pt \itemsep}
  {}{}

\begin{document}

In the beginning, when God created the heavens and the
earth, the earth was a formless wasteland, and darkness covered
the abyss, while a mighty wind swept over the waters.

\begin{verse}
  La vispa Teresa gridava sospesa: \\
  l'ho presa, l'ho presa, la vispa Teresa! \\
  Gridava sospesa: L'ho presa, l'ho presa, \\
  La vispa Teresa! Grida sospesa
\end{verse}

Then God said, Let there be light, and there was light. God
saw how good the light was. God then separated the light from
the darkness.

\end{document}

ここに画像の説明を入力してください

答え2

myverse詩の上/下の垂直間隔を調整する独自の環境を定義できます。

ここに画像の説明を入力してください

\documentclass{article}

\usepackage[paper=a5paper]{geometry}% Just for this example
\usepackage{mdframed,xkeyval}

\newlength{\mvskipabove}
\newlength{\mvskipbelow}
\makeatletter
\define@key{myverse}{skipabove}{\setlength{\mvskipabove}{#1}}
\define@key{myverse}{skipbelow}{\setlength{\mvskipbelow}{#1}}
\makeatother
\newenvironment{myverse}[1][]
  {\setkeys{myverse}{skipabove=0pt,skipbelow=0pt,#1}%
   \begin{mdframed}[
     leftmargin=1.5em,
     linewidth=0pt,
     innertopmargin=\mvskipabove,
     innerbottommargin=\mvskipbelow]}
  {\end{mdframed}}

\begin{document}

In the beginning, when God created the heavens and the
earth, the earth was a formless wasteland, and darkness covered
the abyss, while a mighty wind swept over the waters.

\begin{verse}
  La vispa Teresa gridava sospesa: \\
  l'ho presa, l'ho presa, la vispa Teresa! \\
  Gridava sospesa: L'ho presa, l'ho presa, \\
  La vispa Teresa! Grida sospesa
\end{verse}

Then God said, Let there be light, and there was light. God
saw how good the light was. God then separated the light from
the darkness.

\begin{myverse}
  La vispa Teresa gridava sospesa: \\
  l'ho presa, l'ho presa, la vispa Teresa! \\
  Gridava sospesa: L'ho presa, l'ho presa, \\
  La vispa Teresa! Grida sospesa
\end{myverse}

Then God said, Let there be light, and there was light. God
saw how good the light was. God then separated the light from
the darkness.

\begin{myverse}[skipabove=5\baselineskip,skipbelow=1pt]
  La vispa Teresa gridava sospesa: \\
  l'ho presa, l'ho presa, la vispa Teresa! \\
  Gridava sospesa: L'ho presa, l'ho presa, \\
  La vispa Teresa! Grida sospesa
\end{myverse}

Then God said, Let there be light, and there was light. God
saw how good the light was. God then separated the light from
the darkness.

\end{document}

上記のmyverse環境は実際にはmdframed環境であり、通常の を模倣するためにいくつかのデフォルト オプションがあります。ただし、これらのデフォルトに追加したり、 および/または の形式でverseへのオプションの引数として指定したりすることができます。ここで、は長さです。myverseskipabove=<len>skipbelow=<len><len>

関連情報