2

I would like to be able to add a bit of text below the title on a part page. Based on this answer to this question, I came up with

\documentclass{memoir}

\usepackage{lipsum}
\usepackage{ragged2e}

\makeatletter
\def\@parttext{}
\newcommand{\parttext}[1]{\gdef\@parttext{\normalsize\normalfont\justify #1}}
\renewcommand{\printparttitle}[1]{\parttitlefont #1\vfil\@parttext\vfil\gdef\@parttext{}}
\makeatother

\begin{document}

\parttext{\lipsum[1-2]}
\part{This is part one}

\end{document}

which gives:

enter image description here

but I must admit that I do not fully understand what is going on, so I would be glad for feedback on how to improve the new and renewed commands.

EDIT: One aspect of the renewed command that bothers me is that even if I do not add any text, the part number and title are moved up. How can I avoid this?

  • I don't understand what problem there is with using a command that works, even if you don't understand how it does, but if this obfuscates you, a simple option is the article class: \documentclass{article} \usepackage{lipsum} \begin{document} \part{This in part one} \lipsum[1-2] \end{document} – Fran Oct 6 '19 at 10:27
  • @Fran: I did not say there is a problem; I just want to understand whether it can be improved. Getting feedback from more experienced people is one way to learn. Switching to the article class is not an option; my entire document is in memoir. – user1362373 Oct 6 '19 at 11:41
2

There is another way to do this by redefining the \partpageend macro but I'm not going to go into that.

In the solution you presented the \parttext macro creates the \@parttext macro holding the formatted text to be printed after the part title.

The \printparttitle macro, which prints the part number and title, is extended to call \@parttext to print the after-title text. The \vfil macros vertically center the text between the title and the bottom of the textblock, and then finally emptying \@parttext.

I'm not sure that it can be improved; it works.

  • Hi Peter, thanks for the answer - and thanks for putting the memoir package together, I like using it a lot! – user1362373 Oct 6 '19 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.