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

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. (The title tag is a notable exception, but lots and lots of code that doesn't make it into output can be attributed to a missing p or an extra one. Also, keep in mind that theorem, exercise, etc. require a statement.

  • 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? Use alert. Is it for emphasis? Use em.

Subsection9.2The most frequently asked questions

Here they are! I'll take them each in turn.

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 the mbx script, 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 mysterious mbx script.