Skip to main content

The PreTeXt Guide

Section 29.10 Single Page HTML

Sometimes you would like a shorter work to be a single file in HTML format. Perhaps it is something self-contained, like a course syllabus, or you desire to attach it easily to an email or other post. This section contains advice and procedures you can use to achieve this.
  • Design your source as an <article>, with or without <section>.
  • Set the chunking option to zero (see Subsection 44.1.1). This will prevent making a separate page for each <section> (or worse).
  • If you set the level for the Table of Contents to zero, there will be no sidebar Table of Contents at all. This does not affect the number of files, but will make the page simpler. Your call. See Subsection 44.1.2.
  • You might want to number some objects consecutively for the whole page, even if you choose to have <section>. And if you do this, you might want to not even number the <section>. None of this affect the number of files, but may make a single page look simpler. See Section 44.2 to see how to accomplish these options.
  • Items that are “born hidden” as knowls, either automatically (<answer>, <fn>, …) or electively (<example>, <warning>, …) are contained in the page, so also do not affect the number of files.
  • Cross-references (<xref>) should be set to never be rendered as knowls. This will force them to render as HTML links to the target instead of as knowls that will attempt to load contents from a separate file. See Subsection 44.4.18 for documentation of the relevant publisher variable.
  • You will likely get a subdirectory called knowls. Assuming you have set cross-references to never be knowled you can delete this directory.
  • An HTML build always makes a index.html file which will cause a webserver to redirect to a page of the publisher’s choosing. You can safely delete it.