Is it possible to generate only one page per chapter(or section) without splitting the document file?

The page width is fixed but the page height should be automatically adjusted by the content length of each chapter(or section), so each page height may differ depending on each chapter.

For instance, the PDF result woud look like:

enter image description here

Note that there should be no page break in each chapter.

My document class is memoir and I'm using pdflatex but, if I have to change class or compiler to accomplish this, I will.

Thank you.

  • Your question is unclear
    – user31729
    Commented May 11, 2015 at 14:38
  • @ChristianHupfer Thank you for comment. I want each page broken at end of each chapter only and never broken in the middle of chapter. What information do you want to know more?
    – slyx
    Commented May 11, 2015 at 14:41
  • tex.stackexchange.com/questions/6834/… is related.
    – pst
    Commented May 11, 2015 at 14:47
  • @pst Thank you. In order to use the method in your link, do I have to adjust page size for each chapter whenever the content changed? Or, can I calculate the chapter content height within LaTeX?
    – slyx
    Commented May 11, 2015 at 14:59
  • So, what you want is more or less the idea of a web page, that is, only ends when the text ends.
    – Sigur
    Commented May 11, 2015 at 15:02

1 Answer 1


Since standalone class doesn't define things like chapters, you will have to do your own formatting.


\setlength{\textwidth}{5in}% constant width document
\newcommand{\chapter}[1]{% Chapter title
  \centerline{\large\textbf{Chapter \thechapter}}%
  \parbox{\textwidth}{\centering\Large #1}%

  • standalone with multi option worked for me. Thank you!
    – slyx
    Commented May 12, 2015 at 3:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .