2

MWE

\documentclass[a5paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{verse}
\usepackage{showframe}
\setlength{\leftmargini}{0em}
\begin{document}
\newcommand{\attrib}[1]{%
\nopagebreak{\raggedleft\footnotesize\textit{#1}\par}}

\poemtitle{Fleas}
%\settowidth{\versewidth}{You can’t tell a he from a she.}
\begin{verse}%[\versewidth]
What a funny thing is a flea. \\
You can’t tell a he from a she. \\
But he can. And she can. \\
Whoopee! \\
\end{verse}
\attrib{2015}

\end{document}

And output

enter image description here

That I want, \poemtitle center of the \versewidth. How is it changing macro in my MWE?

Özgür
  • 3,270

2 Answers2

4

\poemtitle uses \@vstypeptitle to do the printing (see verse.sty). I modified it to use a \parbox.

Note, \vspace is ignored at the top of a new page. Use \vspace* if you want the gap to be added there.

\documentclass[a5paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{verse}
\usepackage{showframe}
\setlength{\leftmargini}{0em}
\begin{document}
\newcommand{\attrib}[1]{%
\nopagebreak{\raggedleft\footnotesize\textit{#1}\par}}

\makeatletter
\renewcommand{\@vstypeptitle}[1]{%
  \vspace{\beforepoemtitleskip}%
  \noindent\parbox{\versewidth}{\poemtitlefont #1}%
  \vspace{\afterpoemtitleskip}%
}%
\makeatother

\settowidth{\versewidth}{You can’t tell a he from a she.}
\poemtitle{Fleas}
\begin{verse}%[\versewidth]
What a funny thing is a flea. \\
You can’t tell a he from a she. \\
But he can. And she can. \\
Whoopee! \\
\end{verse}
\attrib{2015}

\end{document}

fleas

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
1

Poemscol adjusts the horizontal placement of the title when the verse block is centered on a line. You can adjust how the horizontal placement works.

In the example below, the line \settowidth{\versewidth}{While the brass clock mumbled to itself like a nun.} takes the width of the phrase "While the brass clock mumbled to itself like a nun" (the longest line) and uses it to set the value of a length called \versewidth. The optional argument [\versewidth] to the \begin{poem} (start of the poem environment) centers the poem on the length \versewidth, which was just defined by the \settowidth command.

Alternatively, you can move the verse block in by using some length other than \versewidth as the optional argument to \begin{poem}, for instance \begin{poem}[3em].

Here is a working example:

\documentclass{article}
\usepackage{fancyhdr,geometry,keyval,ifthen,mparhack}
\usepackage{poemscol}
\stanzaatbottom{*}
\nostanzaatbottom{\relax}
\geometry{textwidth=4in,textheight=6.75in,headheight=14pt,paperwidth=6in,paperheight=9in}
\begin{document}
\centertitles
\poemtitle{The Funeral Day}

\settowidth{\versewidth}{While the brass clock mumbled to itself like a nun.}
\epigraph{Suffield, Connecticut, 1952\\ This is a long prose block 
which I have added to show that issuing  centertitles will 
move a large text block towards the center of the page, with an 
amount specified by you but not center it line by line.}

\begin{poem}[\versewidth]
\begin{stanza}
Later, we folded our hands in his tidy room.\verseline
Patience taught us nothing: we sat for hours\verseline
While the brass clock mumbled to itself like a nun.\verseline
The shadows in the eaves began\verseline
To knot up all the air. And then outside\verseline
This bird just sang and sang and sang.\verseline
What was it to him? Where did he get the right?\verseline
I got up to close the window\end{stanza}

\begin{stanza}
And there I saw the tobacco-fields\verseline
Moving their shrouds in the dusk.\verseline
The wind came thoughtlessly over the wide cloth\verseline
And lifted the white undersides of leaves.\verseline
I didn't close the window. When I sat back down,\verseline
I didn't say what I had seen.\end{stanza}
\end{poem}

\end{document}
John Burt
  • 446
  • 4
    How about providing code that supports your claim. It'll help people see exactly what you mean. – Werner May 07 '19 at 16:36
  • Thanks for the example. I tried very hard to get poemscol work with the \titlescenteredonleftverseblockscheme command in preamble, but it failed. It's very unclear in poemscol documentation how to use it, and there are too few examples of the usage at all in package's documentation. Anyway thanks for this answer, which works fine. – Yaroslav Nikitenko Oct 26 '20 at 11:10
  • If think you should put the in the body, not in the preamble. – John Burt Oct 27 '20 at 15:31