Skip to content

[TeX] Escape $ in equation #1804

Closed
Closed
@inkydragon

Description

@inkydragon

md: "echo `$(nothing)` "

```echo `$(nothing)` ```

tex:

  • \(echo `$(nothing)`\)

should be:

  • \(echo `\$(nothing)`\)

Related code:

function latexinline(io, math::Markdown.LaTeX)
# Handle MathJax and TeX inconsistency since the first wants `\LaTeX` wrapped
# in math delims, whereas actual TeX fails when that is done.
math.formula == "\\LaTeX" ? _print(io, math.formula) : _print(io, "\\(", math.formula, "\\)")
end

TODO:

  • Add a test case

Background: JuliaLang/julia#45034 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Format: LaTeXRelated to the LaTeX / PDF output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions