Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Parser

Tutorials

  • Building Language Front-Ends
  • Inside CodeAnalysis - How CodeStructure Parses C
  • Design and Compilation Strategy
  • Implementing the LaTeX Math Parser
  • MaTeX Comparison Showcase
  • The Parser Landscape - a Survey of What Exists Today
  • The Parser Zoo - language front-ends over a shared algebra
  • Parsing BNF Grammars (and bootstrapping a TPTP parser)
  • Parsing GrammarRules Locally
  • A Markdown Inline Parser in Parser Combinators
  • ParsingOpenQASM
  • Parsing TPTP, Auto-Generated from the Published BNF
  • PrattVsPEG
  • The Wolfram Box Typesetting Reference

Guides

  • Parsing in the Wolfram Language

Symbols

  • ASTAddSource
  • ASTAlgebra
  • ASTContainer
  • ASTLeafQ
  • ASTNodeQ
  • ASTStripSource
  • BinaryNode
  • BrainfuckAST
  • BrainfuckGrammar
  • BrainfuckRun
  • BrainfuckSemantic
  • CalculatorAST
  • CalculatorEval
  • CalculatorGrammar
  • CalculatorSemantic
  • CallNode
  • ContainerNode
  • EBNFParse
  • EBNFRules
  • ErrorNode
  • ExportLaTeX
  • GroupNode
  • InfixNode
  • JSONAST
  • JSONGrammar
  • JSONImport
  • JSONSemantic
  • LambdaAST
  • LambdaEval
  • LambdaGrammar
  • LambdaSemantic
  • LaTeXMathParse
  • LaTeXMathParser
  • LaTeXMathStyle
  • LeafNode
  • LispAST
  • LispGrammar
  • LispRead
  • LispSemantic
  • LispSymbol
  • MarkdownInlineParse
  • MarkdownInlineParser
  • MarkdownParse
  • MarkdownParser
  • ParseAction
  • ParseBetween
  • ParseChainLeft
  • ParseChainRight
  • ParseCharacter
  • ParseChoiceLongest
  • ParseChoice
  • ParseFail
  • ParseLiteral
  • ParseLookahead
  • ParseMany
  • Parse
  • ParseNotFollowedBy
  • ParseOperatorTable
  • ParseOptional
  • ParsePartial
  • ParsePosition
  • ParserCombinator
  • ParserCombinatorQ
  • ParserCompile
  • ParseRecursive
  • ParseRegex
  • ParseSepBy1
  • ParseSepBy
  • ParseSequence
  • ParseSome
  • ParseSucceed
  • ParseTry
  • PostfixNode
  • PrefixNode
  • RecCell
  • RecRef
  • SetRec
  • SpannedToken
  • TernaryNode
  • ToCodeParser
  • TPTPExport
  • TPTPImport

Overviews

  • WolframParser
Wolfram`Parser`
LaTeXMathParser
​
LaTeXMathParser
is the
ParserCombinator
that recognizes LaTeX math-mode source and builds a tree of Wolfram boxes (
FractionBox
,
SuperscriptBox
,
RadicalBox
,
GridBox
,
RowBox
,
StyleBox
). It is the reusable parser object that
LaTeXMathParse
runs.
​
Details and Options
▪
LaTeXMathParser
is the parser object;
LaTeXMathParse
is the one-shot call.
LaTeXMathParse
[s]
preprocesses s, evaluates
Parse
[LaTeXMathParser,s]
, then runs a set of post-passes over the boxes. Running the object directly with
Parse
[LaTeXMathParser,s]
gives the raw grammar output, without the wrapper's pre- and post-processing.
▪
It is an ordinary
ParserCombinator
:
Head
is
ParserCombinator
, its type tag is
"Action"
, and
ParserCombinatorQ
returns
True
. Every
Parse*
operation that accepts a parser accepts it.
▪
Run it on one input with
Parse
[LaTeXMathParser,s]
; reuse it across many inputs by compiling once with
ParserCompile
[LaTeXMathParser,
Method
"PEGVM"]
and applying the returned object.
▪
The paclet ships a precompiled PEG-VM form of
LaTeXMathParser
as an asset.
LaTeXMathParse
loads it on first use only when the stored grammar
Hash
matches the current object, so a stale asset is ignored and the interpreter is used instead.
▪
The interpreted object handles the full Unicode grammar; the compiled PEG-VM form lowers character classes to ASCII ranges, so
LaTeXMathParse
routes any input carrying a non-ASCII codepoint back through the interpreted
LaTeXMathParser
.
▪
Preprocessing done only by
LaTeXMathParse
(not by a raw
Parse
): delimiter-sizing macros such as
\bigl
,
\Big
,
\biggr
are stripped before parsing.
▪
Post-processing done only by
LaTeXMathParse
(not by a raw
Parse
): line breaks
\\
fold into a
GridBox
, Dirac
\langle
/
\rangle
bra-ket rewrites to a
TemplateBox
, pasted Unicode symbols are unwrapped to upright glyphs, and empty rows are pruned.
​
Examples  
(13)
Basic Examples  
(2)
The object itself is a
ParserCombinator
, shown as a summary box:
In[1]:=
LaTeXMathParser
Out[1]=
ParserCombinator
Type: Action
Arity: 2
Compiled: False

Run it on a source string with
Parse
- a fraction:
In[2]:=
Parse

LaTeXMathParser
,"\\frac{a}{b}"
Out[2]=
FractionBox[StyleBox[a,TI],StyleBox[b,TI]]
​
A subscript-superscript combination:
In[1]:=
Parse

LaTeXMathParser
,"x_i^2"
Out[1]=
SubsuperscriptBox[StyleBox[x,TI],StyleBox[i,TI],2]
Scope  
(3)

Properties & Relations  
(5)

Possible Issues  
(2)

Neat Examples  
(1)

SeeAlso
LaTeXMathParse
 
▪
LaTeXMathStyle
 
▪
Parse
 
▪
ParserCompile
 
▪
ParserCombinator
 
▪
ParserCombinatorQ
RelatedGuides
▪
Parsing in the Wolfram Language
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com