Section9Everything you ever wanted to know about PTX
¶Just kidding. I do definitely want to leave time to do stuff too! But there were a fair number of things that kept coming up in email and conversation. So first I will mention the most important tags. Then we will talk about some of the most common questions you had, largely by referring to the documentation.
Subsection9.1The most wanted
Here are the most-needed tags for you, I think. We can refer to the sample article and its source for these, or I can do stuff ‘live’.
-
We are mathematicians. So use the following two tags instead of dollar signs.
We get \(\int_0^\infty e^{-x}dx=1\) with
<m>\int_0^\infty e^{-x}dx=1</m>-
We get
\begin{equation*} \int_0^\infty e^{-x}dx=1 \end{equation*}with
<me>\int_0^\infty e^{-x}dx=1</me>
Nearly always, when you want text, you should put it in the
<p>tag. Enough said. (Thetitletag is a notable exception, but lots and lots of code that doesn't make it into output can be attributed to a missingpor an extra one. Also, keep in mind thattheorem,exercise, etc. require astatement.Get familiar with the section naming scheme. Always nest them! See the sample article and author guide for the full list, down to
<subsubsection>and even<paragraphs>, which is not the same thing as<p>.If you want to put code in, use something like this.
<c>Some code</c>Separate content and presentation. There is no way in PreTeXt to bold text, for instance. Think about why you want to bold text? Is it a term you are defining? Use
term. Is it to alert the reader to something? Usealert. Is it for emphasis? Useem.
Subsection9.2The most frequently asked questions
Here they are! I'll take them each in turn.
WeBWorK – see the author's guide.
Tables – here, the sample article has every option conceivable.
Sage – the syntax just requires input and output, but learning Sage itself is beyond the scope of this minicourse (though people who ask nicely might get a demo of how to make something interactive).
Images – the key is having the right path to the figure (and see the side-by-side stuff in the sample article too).
As a scholium, there were two less common questions that nonetheless are worth addressing because I won't have to say anything about them.
You can generate cool images with Sage. See info in the sample article about
<sageplot>; however, this requires the use of thembxscript, which is (slightly) beyond the scope of a four-hour minicourse. Use the help Google group!Did somebody say
tikz? Search the sample article for<latex-image-code>, as well as the Graphics section. It turns out you can basically drop it right in – but need some setup code at the beginning of your document, and once again the mysteriousmbxscript.