Skip to main content

Getting Started with PreTeXt

Section Getting Started

What exactly is PreTeXt?
PreTeXt is a semantic markup language for writing textbooks, notes, and lessons. You write a plain-text source file that describes the structure of your content (definition, theorem, example, exercise) and a build tool converts it into HTML, PDF, ePub, or Braille. It is closer in spirit to than to a word processor, but the markup describes what something is rather than how it should look.
Do I need to know ?
Only for mathematics. PreTeXt uses syntax inside the <m> and <md> tags, so if you can write x^2 + 1 or \frac{a}{b}, you have enough. Prose, lists, definitions, examples, and exercises all use PreTeXt’s own tags.
Do I need to know XML?
You need to follow two rules: every tag that opens must close (<p>...</p>), and tags must nest properly. That is the practical extent of it. No schemas, namespaces, or DTDs.
What do I need to install?
For today, nothing. PreTeXt.Plus runs entirely in your browser. For longer-term use, a GitHub Codespace (covered in this hub) gives you more room to grow, and a local install via pip install pretext is available when you’re ready for it.
Is PreTeXt free?
Yes. PreTeXt is open-source software released under the GPL. PreTeXt.Plus has a free tier with up to ten projects, and hosting on GitHub Pages is free as well.