Developer documentation

Generate PDF and LaTeX

Produce a print-ready PDF or LaTeX fragment/document with optional answers.

Audience
Publishers, teachers’ tools, and book authors
Before you start
Valid generation entries and a plan with enough remaining capacity

Print-ready PDF

POST /worksheets/pdf generates the problems and returns the binary file in one request. Use the common body plus layout and showAnswerKey.

PDF layout options
FieldSupported valuesDefault
titleStringEmpty
columns1 | 22
workspacecompact | normal | roomynormal
fontSizesmall | normal | largenormal
showDifficultybooleantrue
showScorebooleanfalse
showAnswerKeybooleanfalse
curl -X POST "https://overthemathwall.com/api/public/v1/worksheets/pdf" \
  -H "Authorization: Bearer $OTMW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "seed": 20260720,
    "locale": "en",
    "entries": [
      {"id":"division-1","grade":"grade3","topic":"division","difficulty":"easy","count":10}
    ],
    "layout": {
      "title": "Division practice",
      "columns": 2,
      "workspace": "normal",
      "fontSize": "normal",
      "showDifficulty": true,
      "showScore": false
    },
    "showAnswerKey": true
  }' \
  --output worksheet.pdf

Check Content-Type before saving the body. If the response is not 2xx, parse the JSON error instead of saving those bytes as a PDF. Use only documented option values; do not depend on current tolerance of invalid options.

LaTeX

POST /worksheets/latex returns data.latex. document: false (the default) produces a fragment for inclusion in another work; document: true produces a complete documentclass file. showAnswerKey appends answers.

curl -X POST "https://overthemathwall.com/api/public/v1/worksheets/latex" \
  -H "Authorization: Bearer $OTMW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "seed": 20260720,
    "locale": "en",
    "entries": [
      {"id":"multiplication-1","grade":"grade3","topic":"multiplication","difficulty":"hard","count":8}
    ],
    "title": "Practice set",
    "document": true,
    "showAnswerKey": true
  }'
{
  "data": {
    "latex": "\\documentclass{article} ... \\end{document}"
  }
}

You can submit the value as encoded_snip to Overleaf’s documented integration. Review and compile output in a controlled environment before adding it to a publication.

Branding and usage

PDF output applies the partner’s configured API-output branding where applicable. API branding does not change educator-created worksheets in the app, and Clerk organization branding is separate. LaTeX preserves the mathematical content but does not promise to reproduce every visual element of the PDF.

Credit or quota is settled only after output is generated successfully; generation or rendering failures are reversed.