使用「verse」調節第一節和前段之間的距離

使用「verse」調節第一節和前段之間的距離

使用環境在給定散文文本中插入詩歌verse會在第一節和前一段之間以及最後一節和下一段之間引入距離。

在此輸入影像描述

是否可以調節這兩個差距?

答案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.但是,您可以新增這些預設值,或以and/ormyverse的形式將它們指定為可選參數,其中是某個長度。skipabove=<len>skipbelow=<len><len>

相關內容