Skip to content

Instantly share code, notes, and snippets.

@shakthimaan
Last active December 12, 2022 17:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakthimaan/f76d8b034a6cf26f5f30 to your computer and use it in GitHub Desktop.
Save shakthimaan/f76d8b034a6cf26f5f30 to your computer and use it in GitHub Desktop.
LaTeX poem style
\documentclass{article}
\usepackage{verse}
\begin{document}
\begin{verse}
\poemlines{3}
\setverselinenums{1}{3}
In a cavern, in a canyon, \\
Lived a miner, forty-niner, \\
And his daughter, Clementine. \\ % Produces 3. Required 1.
Oh my darling, Oh my darling, \\
Thou art lost and gone forever, \\
Oh my darling Clementine. \\ % Produces 6. Required 2.
\end{verse}
\end{document}
In a cavern, in a canyon,
Lived a miner, forty-niner,
And his daughter, Clementine. 1.
Oh my darling, Oh my darling,
Thou art lost and gone forever,
Oh my darling Clementine. 2.
\documentclass{article}
\usepackage{verse}
\begin{document}
\begin{verse}
In a cavern, in a canyon, \\
Lived a miner, forty-niner, \\
And his daughter, Clementine. \\ % Produces 3. Required 1.
Oh my darling, Oh my darling, \\
Thou art lost and gone forever, \\
Oh my darling Clementine. \\ % Produces 6. Required 2.
\end{verse}
\begingroup
\makeatletter \def\thepoemline{{\count1\c@poemline \divide\count1by3 \@arabic\count1}} \makeatother
\begin{verse}
\poemlines{3}
In a cavern, in a canyon, \\
Lived a miner, forty-niner, \\
And his daughter, Clementine. \\ % Produces 3. Required 1.
Oh my darling, Oh my darling, \\
Thou art lost and gone forever, \\
Oh my darling Clementine. \\ % Produces 6. Required 2.
\end{verse}
\endgroup
\end{document}
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{poemscol}
\begin{document}
\begin{poem}
\setverselinemodulo{1}
\begin{stanza}
In a cavern, in a canyon, \\
Lived a miner, forty-niner, \\
And his daughter, Clementine. % Produces 1.
\end{stanza}
\begin{stanza}
Oh my darling, Oh my darling, \\
Thou art lost and gone forever, \\
Oh my darling Clementine. % Produces 2.
\end{stanza}
\end{poem}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment