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`
LaTeXMathStyle
​
LaTeXMathStyle
[boxes]
restyles the box tree boxes - as produced by
LaTeXMathParse
- into a Computer-Modern look matching LaTeX / MaTeX, auto-detecting the best installed Computer-Modern font.
​
​
LaTeXMathStyle
[boxes,font]
wraps boxes in the named family font and restyles to it;
LaTeXMathStyle
[boxes,
None
]
returns boxes unchanged.
​
Details and Options
▪
The parser is font-agnostic:
LaTeXMathParse
tags every math-italic identifier as
StyleBox[
letter
,"TI"]
(the front end's default Times-based math italic).
LaTeXMathStyle
rewrites those style tags into the chosen family's math look and wraps the whole tree in a
StyleBox
carrying
FontFamily
font.
▪
With an OpenType math font (a family whose name contains
"Math"
, such as
"Latin Modern Math"
), each italic letter is remapped to its math-italic (cmmi) codepoint -
StyleBox["x","TI"]
becomes
StyleBox["𝑥"]
- because a math font carries the italic letterforms at the math-alphanumeric codepoints rather than via
FontSlant
.
▪
With a text font (
"Latin Modern Roman"
,
"CMU Serif"
), each italic letter instead gets
FontSlantItalic
.
▪
It recognizes the front end's short math style tags and rewrites each:
"TI"
(italic),
"TBI"
(bold italic),
"TB"
(bold), and
"TR"
(roman).
▪
Double-struck
\mathbb
letters (
ℝℂℤℕℚ…
) render in the AMS blackboard font: when
MSBM10.otf
is installed they are wrapped in the
"MSBM10"
family to match real LaTeX; otherwise they stay in the outer family.
▪
With no font argument the family is auto-detected, trying
"Latin Modern Math"
, then
"Latin Modern Roman"
, then
"CMU Serif"
. If none is installed the detected font is
None
and boxes is returned unchanged.
▪
A
Failure
(for example the tagged
"ParseError"
from an unparseable
LaTeXMathParse
call) or
$Failed
is returned unchanged, so
LaTeXMathStyle
@LaTeXMathParse[s]
is safe to write over input that may not parse.
​
Examples  
(12)
Basic Examples  
(2)
LaTeXMathParse
produces font-agnostic boxes, with identifiers tagged
"TI"
:
In[1]:=
frac=
LaTeXMathParse
["\\frac{a}{b}"]
Out[1]=
FractionBox[StyleBox[a,TI],StyleBox[b,TI]]
Restyle to an OpenType math font - italic letters are remapped to their math-italic codepoints and the whole tree is wrapped in the family:
In[2]:=
LaTeXMathStyle
[frac,"Latin Modern Math"]
Out[2]=
StyleBoxFractionBoxStyleBox[𝑎],StyleBox[𝑏],FontFamilyLatin Modern Math
​
Restyle to a text font instead - here italic letters get
FontSlant->Italic
:
In[1]:=
LaTeXMathStyle
[frac,"CMU Serif"]
Out[1]=
StyleBox[FractionBox[StyleBox[a,FontSlantItalic],StyleBox[b,FontSlantItalic]],FontFamilyCMU Serif]
Scope  
(6)

Properties & Relations  
(2)

Possible Issues  
(1)

Neat Examples  
(1)

SeeAlso
LaTeXMathParse
 
▪
LaTeXMathParser
 
▪
StyleBox
 
▪
RawBoxes
 
▪
DisplayForm
 
▪
FractionBox
RelatedGuides
▪
Parsing in the Wolfram Language
""

© 2026 Wolfram. All rights reserved.

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