web analytics
Skip to main content

The PreTeXt Guide

Section 30.6 Page Shape

The conversion to defaults to US Letter paper with reasonable margins. However, the geometry package 1  has numerous options for paper sizes and margins. The publication file can be used to insert any configuration the package supports. See Subsection 44.3.4 for the exact syntax.
Note that if you change the paper size, you may want to change the text width computed by PreTeXt, and the more changes you make, the more default settings you may need to adjust. However, if you are producing your book for print-on-demand (Chapter 43) getting the page size and margins just right is a key step of the process.
Note also that when you use the <geometry> element of the publication file, the content of the element (text between the opening and closing tags) will be duplicated exactly into a source file. Being careless here is a good explanation for the compilation step to fail.
Here is an example:
<latex>
  <page>
    <geometry>a4paper,total={16cm,25cm}</geometry>
  </page>
</latex>
twhich will produce in the output
\geometry{a4paper,total={16cm,25cm}}
An electronic PDF may be printed on physical paper, but perhaps you want to make a version that works well on a portable device that naturally supports a portrait orientation, such as an Android tablet, an iPad, a Kindle (device or application), smart phone, Sony Digital Paper, or a ReMarkable tablet. Aspect ratios vary across these devices, but once you settle on a target ratio, we have had good luck with the following algorithm and parameters:
  1. Specify 10 point text
  2. Text width of about 4.5 inches
  3. Add quarter-inch left/right margins to compute text width
  4. Use aspect ratio to compute an overall height (about 6.5 inches)
  5. Subtract quarter-inch top and bottom margins to obtain text height
Then you can provide the geometry package the overall size as the papersize and the text width and text height as the total size of the body, resulting in equal (tight) margins all around, and good use of limited screen real estate. These parameters create a PDF that is very legible on a larger smart phone, and for fine detail, rotating the device to landscape works well. Really.

Best Practice 30.6.1. Avoid Too Much Text on a Printed Page.

With freedom comes responsibility. Resist the temptation to pack in as much text on the page as you can. PreTeXt varies the width of the text in reaction to the font size and is already very close to the maximum number of characters per line for comfortable reading by humans. Similarly, very narrow margins can be uncomfortable for reading (or holding a printed book).
ctan.org/pkg/geometry