Skip to main content

POST v3/converter

POST api.mathpix.com/v3/converter

Convert an MMD (Mathpix Markdown) document to other formats. Returns a conversion_id for polling status and downloading results. Maximum JSON body size: 10 MB.

See the document conversion guide for step-by-step examples.

Request parameters

mmd string

MMD document that needs to be converted into other formats

formats object

Specifies output formats. See Conversion Formats.

conversion_options object (optional)

Specifies options for specific output formats. Each key corresponds to a format enabled in formats, and the associated object contains format-specific settings. See Conversion Options.

Response body

conversion_id string

Tracking ID for status and downloads

GET v3/converter/{conversion_id}

GET api.mathpix.com/v3/converter/{conversion_id}

Check conversion status.

status string

completed for an existing mmd document

conversion_status ConversionStatus (object) (optional)

Status of each requested conversion format.

GET v3/converter/{conversion_id}.{ext}

GET api.mathpix.com/v3/converter/{conversion_id}.{ext}

Download results once the format's conversion status is completed.

ExtensionDescription
mmdReturns Mathpix Markdown text file
mdReturns plain Markdown text file
docxReturns a docx file
htmlReturns a HTML file with the rendered Mathpix Markdown content
latex.pdfReturns a PDF file with LaTeX rendering
pdfReturns a PDF file with HTML rendering
pptxReturns a pptx file
tex.zipReturns a LaTeX zip file containing a .tex file and any images that appear in the document
mmd.zipReturns a MMD zip file containing a Mathpix Markdown text file and any images that appear in the document
md.zipReturns a MD zip file containing a Markdown text file and any images that appear in the document
html.zipReturns a HTML zip file containing a HTML file and any images that appear in the document
note

For ZIP formats, images will be referenced as follows:

  • tex.zip: \includegraphics[max width=\textwidth]{image-name}
  • mmd.zip and md.zip: ![](./images/image-name.jpg)
  • html.zip: <img src="./images/image-name.jpg" alt="">

ConversionStatus object

A map from format name to its conversion state. Each key is a format name (e.g. docx, pdf) and the value is an object with the following fields:

status string

One of processing, completed, or error.

error_info object (optional)

Present when status is error. Contains id (error identifier) and error (human-readable message).

Example

{
"docx": {"status": "completed"},
"pdf": {"status": "error", "error_info": {"id": "conversion_error", "error": "..."}}
}

Conversion Formats

info

This parameter is called formats for v3/converter and conversion_formats for v3/pdf.

FormatDescription
mdPlain Markdown
docxMicrosoft Word document
tex.zipLaTeX zip with images
htmlHTML file
pdfPDF with HTML rendering
latex.pdfPDF with LaTeX rendering
pptxPowerPoint presentation
mmd.zipMathpix Markdown zip with images
md.zipMarkdown zip with images
html.zipHTML zip with images

Conversion Options

Conversion options used for v3/pdf conversion_options and v3/converter conversion_options.

Specifies options for specific output formats. Each key corresponds to a format enabled in formats, and the associated object contains format-specific settings.

Conversion options for docx

font string (optional), default value is Georgia

Specifies the name of the font that will be used in the document.

fontSize integer (optional), default value is 22

Specifies the font size in half-points (e.g. 22 = 11pt).

language string (optional), default value is auto

Specifies the document language for spelling and grammar checking. When auto, the language is detected automatically. See supported values below.

orientation string (optional), default value is portrait

Specifies the page orientation portrait or landscape.

margins object (optional)

Specifies page margins. All values are in twips (1 twip = 1/20 of a point).

FieldTypeDefaultDescription
topinteger1440Top margin
rightinteger1800Right margin
bottominteger1440Bottom margin
leftinteger1800Left margin
gutterinteger (optional)0Extra space for binding
htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Supported language values: auto, Afrikaans, Arabic, Basque (Basque), Bosnian, Bulgarian, Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish, Dutch, English (AUS), English (CAN), English (UK), English (US), Estonian, Finnish, French, French (Canada), French (Switzerland), Galician, Georgian,German, German (Austria), German (Switzerland), Greek, Gujarati, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Irish, isiXhosa, isiZulu, Italian, Japanese, Kannada, Kazakh, Kiswahili, Korean, Latvian, Lithuanian, Macedonian, Malaysian, Marathi, Norwegian Borkmal, Norwegian Nynorsk, Persian, Polish, Portuguese, Portuguese (Brazil), Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Sesotho Sa Leboa, Setswana, Slovak, Slovenian, Spanish, Spanish (Traditional Sort), Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Welsh.

Conversion options for tex.zip

fontSize string (optional), default value is 10pt

Specifies the font size as a LaTeX size string. Numeric values are treated as pt.

Values

10pt, 11pt, 12pt

font string (optional), default value is CMU Serif

Specifies the name of the font that will be used in the document. Used only for XeLaTeX1.

Values

CMU Serif, Open Sans, Crimson Text, Arimo, Noto Sans, Noto Serif

imagesFolder string (optional), default value is images

Specifies the folder name for images.

load_external_fonts bool (optional), default value is false

Specifies that all used fonts should be included in the tex.zip. Used only for XeLaTeX1.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

warning

Note: The XeLaTeX compiler will be used if the document contains text in languages such as Bengali, Gujarati, Hindi, Hebrew, Tamil, Thai, Arabic, Japanese, Korean, Traditional Chinese, or Simplified Chinese.

Conversion options for html

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for md

math_inline_delimiters [string, string] (optional), default value is ["$", "$"]

Specifies begin inline math and end inline math delimiters.

math_display_delimiters [string, string] (optional), default value is ["$$", "$$"]

Specifies begin display math and end display math delimiters.

escape_ampersand bool (optional), default value is true

Specifies whether to escape the & character in the source content.

escape_dollar bool (optional), default value is true

Specifies whether to escape the $ character in the source content.

escape_hash bool (optional), default value is true

Specifies whether to escape the # character in the source content.

escape_percent bool (optional), default value is false

Specifies whether to escape the % character in the source content.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for latex.pdf

fontSize string (optional), default value is 10pt

Specifies the font size as a LaTeX size string. Numeric values are treated as pt.

Values

10pt, 11pt, 12pt

font string (optional), default value is CMU Serif

Specifies the name of the font that will be used in the document. Used only for XeLaTeX2.

Values

CMU Serif, Open Sans, Crimson Text, Arimo, Noto Sans, Noto Serif

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

warning

Note: The XeLaTeX compiler will be used if the document contains text in languages such as Bengali, Gujarati, Hindi, Hebrew, Tamil, Thai, Arabic, Japanese, Korean, Traditional Chinese, or Simplified Chinese.

Conversion options for pdf

fontSize integer (optional), default value is 17

Specifies the font size in px. Clamped to the range 8–128.

text_color string (optional), default value is #1E2029

Specifies the text color, can be name, hex, or rgb.

background_color string (optional), default value is not set

Specifies the background color, can be name, hex, or rgb.

disable_footer bool (optional), default value is false

Enable or disable footer such as page numbers.

margin integer (optional), default value is 70

Specifies the margin size. Minimum value is 40, maximum is 200.

custom_css string (optional), default value is not set

Specifies custom CSS styles to be applied to the document.

footnote_compact_refs bool (optional), default value is false

Specifies the option to hide repeat indexes for Markdown footnotes.

resource_load_timeout_sec number (optional), default value is 60

Specifies the timeout in seconds (can be fractional) for loading external resources (such as images or fonts). If a resource does not load within this time, it will be excluded from the output. Must be greater than zero.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for pptx

fontSize integer (optional), default value is 16

Specifies the font size in px.

text_color string (optional), default value is #000000

Specifies the text color, can be name, hex, or rgb.

background_color string (optional), default value is not set

Specifies the background color, can be name, hex, or rgb.

margin integer (optional), default value is 48

Specifies the margin size in px.

custom_css string (optional), default value is not set

Specifies custom CSS styles to be applied to the document.

footnote_compact_refs bool, default value is false

Specifies the option to hide repeat indexes for Markdown footnotes.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for md.zip

math_inline_delimiters [string, string] (optional), default value is ["$", "$"]

Specifies begin inline math and end inline math delimiters.

math_display_delimiters [string, string] (optional), default value is ["$$", "$$"]

Specifies begin display math and end display math delimiters.

escape_ampersand bool (optional), default value is true

Specifies whether to escape the & character in the source content.

escape_dollar bool (optional), default value is true

Specifies whether to escape the $ character in the source content.

escape_hash bool (optional), default value is true

Specifies whether to escape the # character in the source content.

escape_percent bool (optional), default value is false

Specifies whether to escape the % character in the source content.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for html.zip

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Footnotes

  1. See XeLaTeX note below. 2

  2. See XeLaTeX note below.