Knowledge Base
PressPrimer Quiz

Adding Math and Formulas to Quizzes

PressPrimer Quiz can render mathematical notation in question stems, answer options, and per-answer feedback. You write standard LaTeX and the plugin renders it as properly formatted math using KaTeX, a fast math rendering library that is bundled with the plugin. Math rendering is off by default and takes one setting to enable.

Enabling Math Notation

  1. Navigate to PressPrimer Quiz > Settings > General in /wp-admin/.
  2. Turn on Enable math notation (LaTeX).
  3. Save your settings.

The rendering assets are lightweight and only load on pages where a quiz actually contains math notation, so there is no performance cost for quizzes without math.

Writing Math Notation

Wrap LaTeX expressions in delimiters to mark them as math:

DelimitersStyleBehavior
\( ... \)InlineFlows within a line of text
\[ ... \]DisplaySits centered on its own line
$$ ... $$DisplaySits centered on its own line

For example, typing The area of a circle is \( A = \pi r^2 \) in a question stem renders the formula inline with the sentence.

The Insert Math Button

You do not need to remember the delimiters. With math notation enabled, an Insert math button appears in the toolbar of the question stem and answer editors. Clicking it opens a dialog where you can:

  • Type or paste a LaTeX expression
  • Choose Inline or Block placement
  • See a live preview of the rendered math before inserting it
Insert math

The dialog inserts the expression with the correct delimiters at your cursor position.

Examples

Here are some common expressions to get you started:

You typeStudents see
\( x^2 \)x with a superscript 2
\( x_1 \)x with a subscript 1
\( \frac{a}{b} \)A fraction with a over b
\( \sqrt{x} \)The square root of x
\( \pi \), \( \theta \), \( \Delta \)Greek letters pi, theta, and delta
\( \sum_{i=1}^{n} i \)A summation with limits
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]The quadratic formula, centered on its own line

KaTeX supports a large subset of LaTeX. For the complete list of what you can use, see the official KaTeX supported functions documentation and the KaTeX support table.

Where Math Renders

Once enabled, math notation renders everywhere question content is shown:

  • The live quiz as students take it
  • The results page and question review
  • Attempt details in reports

Report screens added by the premium add-ons render math as well.

Invalid Expressions

If an expression contains a LaTeX error, the raw source is displayed in red instead of rendered math. The rest of the page continues to work normally. Fix the expression in the question editor and save to resolve it. The live preview in the Insert math dialog is the easiest way to catch mistakes before they reach students.

Privacy and Performance Notes

  • KaTeX is bundled with the plugin and rendering happens in the browser. No external services or CDN requests are made.
  • Math assets load only when the feature is enabled and the content on the page actually contains math notation.

Get Tips, news & Discounts to your inbox

Get your own demo site

Get Tips, news & Discounts to your inbox