GeneralDocument layout (book of poems)

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
AdrianM
Posts: 5
Joined: Sun Nov 28, 2010 10:42 am

Document layout (book of poems)

Post by AdrianM »

Hello everyone!

I am currently working on a book of poems and I recently discovered the key features that LaTeX provides for this kind of documents. Until now, I only have used it for scientific articles.

I have a bit of a problem, due to my lack of knowledge and experience.

I want my book to contain several sections, but not in the common sense of the word. For example, I want to divide my poems into "Love poems" and "Heroic poems", with the following askings:
- The TOC to contain a title "Love poems", like a chapter name, and then all the poems underneath it, like usual sections
- I want a new page on which to write "Love poems" only (just like blank pages that sepparate chapters), and afterwards the poems. Then after I wrote all the love poems, when entering the second part, I want again an allmost blank page, on which I only want "Heroic poems", and then the poems on the following pages.

Until now managed to supress the chapter numbers, but I don't know how to obtain this layout. I thought about using "Love poems" as a chapter and then the poems as sections of it, but then how can I get only the chapter's name written on a new page?

Thank you for your attention and help,
Adrian

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Document layout (book of poems)

Post by meho_r »

If you're sure about chapter-section divisions, it's easy to achieve what you want with titlesec package. Here's an example:

Code: Select all

\documentclass{book}

\usepackage{lipsum}% used for dummy text
\setcounter{secnumdepth}{-1}% removes numbering of sectioning units

\usepackage{titlesec}

\begin{document}

\tableofcontents

%%% Chapter formatting

\titleformat{\chapter}
	{\Huge\bfseries}% global formatting (title and number)
	{\thechapter.\,}% number formatting; if empty, it removes the number (but not from TOC)
	{0pt}% spacing between the number and the title
	{}% code/content between the number and the title
	[\clearpage]% code/content after the title; if you want sections to start on the next right page, use \cleardoublepage instead of \clearpage
	
\titlespacing{\chapter}
	{0pt}% left margin
	{5cm}% vertical spacing before the title
	{0cm}% vertical spacing after the title
	
%%%

\chapter{Love poems}

\section{First poem}

\lipsum[1-4]% dummy text

\chapter{Heroic poems}

\section{First poem}

\lipsum[1-4]% dummy text

\end{document}
You may also consider using memoir document class which provides some nice features regarding typesetting poetry (see memoir's documentation, chapter 14).
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Document layout (book of poems)

Post by frabjous »

You might also consider using the \part command for your primary divisions; it sounds like what what you have in mind.
AdrianM
Posts: 5
Joined: Sun Nov 28, 2010 10:42 am

Document layout (book of poems)

Post by AdrianM »

I find the example that you kindly offered a bit complicated and also I am not used to the \part command. But I managed to make some adjustments to my document and the only question that remains is:

How can I get the chapter's name written on a blank page, only by itself and then the following pages to contain the (sub)sections?

I intend to make "Love poems" & "Heroic poems" to be chapters and then the poems belonging to them, the sections.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Document layout (book of poems)

Post by meho_r »

Well, I don't know an easier way to manipulate sectioning units than by using titlesec package. However, if you don't want an automatic solution, and since there are only two chapters, you can simply clear the page after the chapter titles manually, e.g.:

Code: Select all

\documentclass{book}

\setcounter{secnumdepth}{-1}

\begin{document}

\tableofcontents

\chapter{Love poems}
\clearpage

\section{First poem}

Some text.

\chapter{Heroic poems}
\clearpage

\section{First poem}

Some text.

\end{document}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Document layout (book of poems)

Post by frabjous »

The starred version of \part* basically does what you want. However, like the other starred versions of sectioning commands (\chapter*, \section*) for creating unnumbered divisions, it doesn't add its contents to the table of contents, but you could do so manually using \addcontentsline. Another advantage of that you could then have it treat the parts as chapters in the TOC.

Still you'll need to change \thesection so it doesn't add chapter numbers to section numbers if you were going to treat the poems as sections. You'd also need to reset the chapter numbers with each part division.

Here's an example.

Code: Select all

\documentclass{book}
\usepackage{lipsum}% for adding filler text
\renewcommand{\thesection}{\arabic{section}}
\begin{document}
\tableofcontents

\part*{Funny Poems}
\addcontentsline{toc}{chapter}{Funny Poems}

\section{Hungry Mungry}

\lipsum[1]

\section{The Old Man From Nantucket}

\lipsum[2]

\part*{Serious Poems}
\setcounter{section}{0}
\addcontentsline{toc}{chapter}{Serious Poems}

\section{Ode to LaTeX}

\lipsum[3]
\end{document}
The lipsum stuff is just there for filler text. It's not part of the suggestion and can be removed.

If you want to do something more advanced, then definitely look at the documentation of the titlesec package. There isn't going to be another easy way.
AdrianM
Posts: 5
Joined: Sun Nov 28, 2010 10:42 am

Document layout (book of poems)

Post by AdrianM »

meho_r wrote:Well, I don't know an easier way to manipulate sectioning units than by using titlesec package. However, if you don't want an automatic solution, and since there are only two chapters, you can simply clear the page after the chapter titles manually, e.g.:
Thank you very much, that did the trick that I wanted, simple and effective. I only have to lower the title of the chapter, i.e. in the middle of thee page, but I think I can do this by myself.

Thanks again to all of you!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Document layout (book of poems)

Post by localghost »

Now that the problem seems to be solved, please be so kind and mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules. Otherwise please tell us what is missing. Please keep that in mind for the future so that further reminders will not be necessary.


Best regards and welcome to the board
Thorsten
Post Reply