Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section2.3Processing

At a command prompt in your terminal or console adjust the pathnames for the two files and execute:

xsltproc /path/to/mathbook/xsl/mathbook-html.xsl /path/to/quickstart.xml

In the current working directory you should now find the file article-1.html which you can view in a web browser. (You will want an internet connection since various parts of the page come from the network. Someday we will create output for the offline situation.) It will look very plain, but you should be able to read the sentence.

Now, try the following, again with adjusted paths:

xsltproc /path/to/mathbook/xsl/mathbook-latex.xsl /path/to/quickstart.xml

In the current working directory you should now find the file article-1.tex which you can process with pdflatex or xelatex at the command line as below. If you do not have installed on your system, you could process this file within a variety of online services, and CoCalc would be an obvious choice.

pdflatex article-1.tex

In the current working directory you should now find the file article-1.pdf which you can view or print with standard PDF viewing software. You could even send it to a print-on-demand service to get nice hardback books, though I suspect sales will not be great.

That's it. You now know all the basics of authoring with PreTeXt, since you have produced two radically different output formats with identical content from the exact same structured input, via two different command lines. Everything you need to author a complete article or textbook, and produce it in many different formats, is just an extension or variation on what you just did. Let us look at a few simple extensions right away before being more methodical.