在诗歌环境中分隔和编号诗节

在诗歌环境中分隔和编号诗节

有没有 LaTeX 中可以排版诗歌的软件包?我参考了这个链接排版诗歌但它没有帮助我!

答案1

  1. 标准 LaTeX 提供了一个基本的verse环境。

  2. 下面是一个示例(来自文档),使用verse包裹:

    \documentclass{article}
    \usepackage{verse}
    
    \newcommand{\attrib}[1]{%
    \nopagebreak{\raggedleft\footnotesize #1\par}}
    \renewcommand{\poemtitlefont}{\normalfont\large\itshape\centering}
    
    \begin{document}
    
    \poemtitle{Mathematics}
    \settowidth{\versewidth}{Than Tycho Brahe, or Erra Pater:}
    \begin{verse}[\versewidth]
    In mathematics he was greater \\
    Than Tycho Brahe, or Erra Pater: \\
    For he, by geometric scale, \\
    Could take the size of pots of ale;\\ \settowidth{\versewidth}{Resolve by}
    Resolve, by sines \\>[\versewidth] and tangents straight, \\
    If bread or butter wanted weight; \\
    And wisely tell what hour o’ the day \\
    The clock does strike, by Algebra.
    \end{verse}
    \attrib{Samuel Butler (1612--1680)}
    
    \end{document}
    

    在此处输入图片描述

  3. 使用的示例poemscol

    \documentclass{article}
    \usepackage{fancyhdr}
    \usepackage{poemscol}
    \usepackage{lmodern}
    
    \begin{document}
    
    \sequencetitle{Kentucky Mountain Farm}
    \sequencefirstsectiontitle{I. Rebuke of the Rocks}
    \begin{poem}
    \begin{stanza}
    Now on you is the hungry equinox,\verseline
    \index{Now on you is the hungry equinox}
    O little stubborn people of the hill,\verseline
    \accidental{hill,] \sameword--- {\em Nation,\/} {\em Literary Digest\/}
    \sameword, {\em Vanderbilt\/} (I include the reading
    from {\em Vanderbilt\/}
    even though it is the same as in TSP, because
    {\em Vanderbilt\/} was published
    after the other magazine versions but before TSP.)}
    The season of the obscene moon whose pull\verseline
    Disturbs the sod, the rabbit, the lank fox,\verseline
    Moving the waters, the boar’s dull blood,\verseline
    And the acrid sap of the ironwood.\end{stanza}
    \begin{stanza}
    But breed no tender thing among the rocks.\verseline
    Rocks are too old under the mad moon,\verseline
    \accidental{old\missingpunct] \sameword, {\em Vanderbilt\/}}
    Renouncing passion by the strength that locks\verseline
    The eternal agony of fire in stone.\end{stanza}
    \begin{stanza}
    Then quit yourselves as stone and cease\verseline
    \accidental{stone\missingpunct] \sameword, {\em Vanderbilt\/}}
    To break the weary stubble-field for seed;\verseline
    Let not the naked cattle bear increase,\verseline
    Let barley wither and the bright milkweed.\verseline
    \accidental{milkweed.] milk-weed. {\em Vanderbilt\/}}
    43
    Instruct the heart, lean men, of a rocky place\verseline
    That even the little flesh and fevered bone\verseline
    May keep the sweet sterility of stone.\end{stanza}
    \end{poem}
    
    \end{document}
    

    在此处输入图片描述

  4. memoir类提供了内置的写诗功能。请参阅章节14 诗歌手册memoir

  5. 这部分Poetry and DramaCTAN 提供了其他可能性。

答案2

在诗歌环境中分隔和编号诗节

诗句经常被编号(因此,作为 Gonzalo Medina 回答第一部分的补充说明),你可以在手册中找到诗句.pdf此解释:

在诗句环境中,必须在诗句的每一行末尾使用宏 \\,但每节的最后一行除外。如果要对诗歌中的行进行编号,则必须在每节最后一行末尾使用 \\!(\\ 宏会增加行号)。

\documentclass{article}
\usepackage{url,verse}

\newcommand{\attrib}[1]{%
  \nopagebreak{\vspace{2ex}\raggedleft #1\par}}

\begin{document}
\poemtitle{Crossing the Bar}

\begin{verse}[13em]
\poemlines{2}
\begin{altverse}
Sunset and evening star, \\
  And one clear call for me! \\
And may there be no moaning of the bar, \\
  When I put out to sea, \\!

But such a tide as moving seems asleep, \\
  Too full for sound and foam, \\
When that which drew from out the boundless deep \\
  Turns again home. \\!

Twilight and evening bell, \\
  And after that the dark! \\
And may there be no sadness of farewell, \\
  When I embark; \\!

For tho' from out our bourne of Time and Place \\
  The flood may bear me far, \\
I hope to see my Pilot face to face \\
  When I have cross'd the bar. \\
\end{altverse}
\end{verse}

\attrib{Alfred, Lord Tennyson (1809\textendash 1892)}

\end{document}

跨越界限

这里我可以省略最后一句!,但如果有第五节,它的编号就会被打乱。

答案3

值得注意的是,你可以将 gmverse 包添加到 verse 包中:

\usepackage{verse, gmverse}

如果你将此添加到 Gonzalo Medina 从诗歌文献中摘取的上述示例中,则会获得三大好处:

  1. 每首诗自动居中,无需计算诗句示例中的长度
  2. 可以在每行结尾不使用双反斜杠,以便于输入。
  3. 在诗歌中,行的长度可能会有所不同,无法容纳在页边距中,gmverse 会自动将部分行设置为左侧参差不齐(靠在右边距上)。其他解决方案需要手动调整。

所有这些效果都很难通过其他软件包实现,而在文字处理工具中则很难甚至不可能实现。

视觉居中会平均行长来确定中心,并且\vocweigh3在第一首诗触发之前是必需的。(这是默认的权重方案,其他方案请参见 gmverse 手册。根据手册,它不是​​明确需要的,但我发现它是需要的。)

缺点?据我所知,如果包含 gmverse,诗歌手册(在诗歌数学中)中给出的部分行的幻影解决方案将不起作用。更新我现在使用回忆录作为文档类型(仍然包括诗句和给予者)并且 \vinphantom{text} 和 \vleftofline{left} 和 \flagverse{left} 都按预期工作。

答案4

Koma 脚本包含一个诗歌环境,其工作方式与诗歌包相同。

相关内容