Please excuse my lack of knowledge – I am completely new to LaTeX. I think I have a question regarding the height of a section… To be more specific, I am compiling a poetry book, using the verse package. Environment set up as follows:
\documentclass[12pt,a5paper,twoside]{article}
\pdfpageheight=210mm
\pdfpagewidth=148mm
\usepackage[a5paper]{geometry}
\geometry
{
portrait,
top=2.3cm,
left=2cm,
right=1.3cm,
bottom=2cm
}
\usepackage{verse}
I want to know if a particular poem will break over two pages, and depending on the answer (and whether I am on an odd page currently), introduce a page break.
Can this be done in a macro of some sort at the beginning of the poem, linked to the \poemtitle
?
If the current page is even, I want to leave it, and if the current page is odd (and the poem spans two pages), I want to introduce a page break, so that two-page poems do not have a page turn between them. Is this possible somehow? I notice a similar question here which I don't think was answered yet:
Best Answer
This solution manually performs the page breaks using
\vsplit
. Odd pages can only break betweenaddblock
environments. The drawback is that EVERYTHING must be written inaddblock
environments, otherwise it gets confused.Box
\pagebox
is used to store the page so far (global). It is merged with the contents of the new block and tested. If the combined blocks are more than 2 pages, or if they are more than one page and one is on an odd page, then\pagebox
is written to this page and we move to the next even page. When an even page is filled,\vsplit
performs the page break and the first page is written.Local registers \box0 and \box1 do not have to be saved globally. Their contents will be lost at
\end{addblock}
. Note:\stepcounter
changes counters globally (in this case, the section number), so we only want to expand\BODY
once.