Skip to main content

Section 6.1 First steps

Now is a good time to try creating your own PTX document. The easiest way to do this is to first follow the instructions in the “A Careful, Quick Minimal Example,” chapter in [2] to create your first PTX document.
The next step might then be to choose a PTX (or XML) file from the mathbook/examples folder and use it as a template. A good template to start with is mathbook/examples/sample-article/sample-article.xml: the HTML version of the sample article,, provides some instruction for writing in PTX, while the XML code itself demonstrates actual PTX coding.
Remember that when you compile, you will always need to be sure you are including the correct path to the style file, based on your PTX file’s location.
Changing your output file names: By default, your PTX will compile to an HTML (respectively, LaTeX) file called index.html (resp., index.tex). If you are writing an <article> and you wish your output files to have,say, the title “ducks” preceding the extension, add the attribute xml:id="ducks" to your <article> element using the following code: <article xml:id="ducks">.
Take some time playing with whichever template(s) you choose. Experiment with creating lists, using <theorem> and <example> elements, etc. (For now you can think of “elements” in PreTeXt as playing the role which environments play in LaTeX.) Try not to worry about the appearance of your HTML or PDF at the moment; you can customize appearances later.