For completeness I will add my solution here.
I use memoir as the class and verse and gmverse packages. Gmverse is great and gives you:
- automatic visual centering of each poem. (no need to enter the longest line and calc its length)
- No need for \ at the end of each line (but NOT last line) if each stanza. This makes copy and paste from emails or text, word etc files much easier.
Then I use subfiles package which acts like include but each subfile also knows the name of the major doc file and can read the preamble (before \begin{document}) and therefore be compiled independently.
This makes editing, assembling and creating several collections (ie journal submissions) simpler than one big file. It also keeps the single poem template quite small. Reordering is also easier.
So I re-use a template for each poem (on the Mac you set the file to be stationery in the info panel, and then a double click will give a new copy of the file) and rename them as needed.
Template for a single poem:
\documentclass[older_poems_40.tex]{subfiles}
\begin{document}
\vocweigh3 %needed for gmverse package, must be here not
% in preamble
\thispagestyle{empty} %remove before using as subfile
\PoemTitle{TITLE} %%%% this will be numbered * version is not numbered
%\epigraph{}{}
\begin{verse}
\index{FIRST_LINE}FIRST_line of poem
line 2
line 3
new stanza 1
line 2
\end{verse}
\end{document}
The main file of course has lots of formatting stuff in so I will add a truncated version here. (But note I have kept the list of poems (contents) and also the index of first lines (which needs you to re-run make index after you add a new subfile) for your pleasure.
%file = older_poems_40.tex
\documentclass[12pt, twoside]{memoir}
%\usepackage[utf8]{inputenc} % I use Xetex so I don't need this anymore
\usepackage{epigraph}
% set a note, subtitle quote or source under the poem title
\setlength{\epigraphwidth}{.45\textwidth} % Was 0.4
\usepackage{makeidx}
\makeindex
\usepackage{verse, gmverse}
\usepackage{currfile} %% to get a compile date for records/sanity
\usepackage{hyperref}
\renewcommand{\PoemTitlefont}{\Large\slshape\centering}
\title{Your poetry book name here}
\author{Your name here!}
\date{}
\hypersetup{
pdftitle={poems of blah},
pdfsubject={blah},
pdfauthor={David J. Garbutt},
pdfkeywords={poetry}
}
% or set to blank for anonymous submissions
\usepackage{subfiles}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. DOCUMENT%%%%%%%%%%%%%%
\begin{document}
\maketitle
\epigraph{street }{town, postcode, country}
\clearpage
\tableofcontents
\vfill
Compiled from \texttt{\currfilepath} on \today{}.
\clearpage
\subfile{poem1}
\clearpage
\subfile{poem2} %.tex is assumed
%% repeat lots of poems…
%% here I have clear pages only in the master file this makes it easier
%% to create a more compact version if wanted.
%%%%% end poems
\renewcommand\indexname{Index of First Lines}
\onecolindex
\printindex
\end{document}
It is up to you to make sure the file pointed to in the single poem template is the one with the subfile statements in!
LaTeX
.awk
, say, to add the\title{}
\author{}
\date{}
\maketitle
and whichever environment you end up using. You can do it with LaTeX. But I don't see the point.gawk -f makeitemizelist.awk FirstPoetry.txt
But, the execution results displayed in the command window. How to make it as a LaTeX file?