Skip to main content

Section 9.1 Solution Manual

An author may include a <hint>, <answer>, and/or <solution> as part of each <exercise> or <project>. Some of these may be designed for the reader, while some may designed for the instructor. A separate conversion is available to make a PDF containing just these items.

In the usual way, execute

xsltproc pretext-solution-manual-latex.xsl fauna.xml

with suitable paths in front of the stylesheet and the source file. The result will be a file like fauna.tex, which can be processed with a engine such as pdflatex. By default, the result will include all <statement>, <hint>, <answer>, and <solution> for every <exercise> or <project> anywhere in your <book>. Note that this conversion is explicitly designed only for <book>, so send a request for support for an <article>. Division headings (<chapter>, <section>, …) will be present, if and only if they have content. Page headers will help locate chapters and sections. Exercise numbers will be complete, to make it easier to locate individual problems. In other words, Exercise 3 from Exercises 5.6 will be labeled as 5.6.3, not just 3, as in the original text.

Any cross-reference that exists inside a solution will be honored and displayed faithfully. By that, we mean that if the author includes an <xref> as part of a solution to, say, Theorem 10.6, then that cross-reference will be rendered visibly as “Theorem 10.6” in the solution manual. However, it will not be live (clickable) since the target (the <theorem> itself) is not part of the solution manual. We have not, and do not expect to, determine if a cross-reference points to part of another exercise which is visible in the remainder of the solution manual and then elect to make it live/clickable. In other words, all cross-references are static, even if there is the possibility to be more dynamic for a select few. If this is a severe shortcoming, consider producing an Instructor's Version (Chapter 8), enhanced with additional solutions, where all cross-references are live, and targets are more likely to be available.

A set of switches allows a publisher to control including <statement>, <hint>, <answer>, or <solution>–for inline exercises, divisional exercises, worksheet exercises, reading questions, projects, and tasks within a project. So there is a total of \(4\times 5 = 20\) yes/no switches, for \(2^{20} = 1\,048\,576\) supported scenarios. Find these switches documented as comments early on in the stylesheet. The preamble is the same as for the full document, so besides being excessive, it should support any of the styling options. You will likely want to place these switches, and any customizations, into a thin XSL file (read about customizations in the Author's Guide).

In practice, you will discover that the conversion will reproduce all of your <frontmatter> and <backmatter> exactly as if it was part of the entire text itself. The reason for this is that you may actually want a little bit of front matter, perhaps some back matter, and maybe a new title page that makes it clear that you have created a solution manual. Best practice would be to have each of your chapters in its own file, and incorporated into your document via a master file using the <xi:include> mechanism. (Read about modularity in the Author's Guide if this is new to you.) So make a new “master” file for the solution manual, maybe with a new title, a new preface, and acknowledgements of any help creating exercises and solutions. Be sure to include all of the main matter, even if you know some parts may not have any <exercise>. You want numbering to be correct for your cross-references and this means having all the content available to be counted, even if it is not visible in the end product. This new master file is really the only overhead involved in getting a quality, reliable solution manual together.

The philosophy behind this conversion is that a publisher may wish to create a different range of solutions for instructors, for limited distribution in ways that students are unlikely to find. Thus, we have tried to produce a functional document by default, without too much attention to making a beautiful document. Of course, improvements and suggestions are always welcome, though here the priority will be ease-of-use.


This conversion illustrates some advantages of including all the content of your project in one source document, and then selecting a subset of that content for different audiences. The advantage of authoring <hint>, <answer>, and <solution> in close proximity to the <statement> should mean a higher probability that changes to one part of an exercise will be reflected in the other parts. And with standard processing tools, and provided switches, an author and publisher can easily decide which parts to show, and when.

By including all of your project's content in one monolithic source document, it is possible to confidently reference supporting parts of the main text via cross-references from solutions. When a new edition is released, any variations in numbering will automatically be reflected in a new solution manual, created with no additional editing or proofreading.