Markdown Editor with LaTeX — Math & Code Blocks

Write Markdown with LaTeX equations and syntax-highlighted code. KaTeX for math, Shiki for code. Free and offline.

How it works

  1. Create a document in Lexon or convert Word to Markdown.
  2. Use $...$ for inline math and $$...$$ for block math.
  3. Add code blocks with triple backticks and a language tag (e.g. ```python).
  4. Export to MD, HTML, or PDF.

LaTeX math with KaTeX

KaTeX is a fast math typesetting library. Lexon uses it to render LaTeX in the preview and in exported HTML/PDF. Example inline: $E = mc^2$. Block:

$$
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

Most common LaTeX math commands work: fractions, integrals, matrices, Greek letters, etc.

Code blocks

Lexon uses Shiki for syntax highlighting. Add a code block and specify the language:

```python
def hello():
    print("Hello, Markdown!")
```

Supported languages include Python, JavaScript, TypeScript, Bash, SQL, HTML, CSS, JSON, and many more.

Use cases

  • Academic notes and papers
  • Technical documentation
  • Tutorials with code snippets
  • Math-heavy reports

Lexon works offline, so you can write and edit without an internet connection. For more on the editor, see the blog.

Frequently asked questions

What LaTeX syntax does Lexon support?
Lexon uses KaTeX. Inline math: $...$. Block math: $$...$$. Most common LaTeX commands work.
Which programming languages are supported for code highlighting?
Shiki supports many languages: JavaScript, Python, Bash, SQL, HTML, CSS, and more.
Can I write LaTeX and Markdown in the same document?
Yes. Mix headings, paragraphs, math, and code blocks freely.
Does LaTeX work offline?
KaTeX loads on first use. After that, math renders offline.
Is there a WYSIWYG mode?
Yes. Lexon has a rich editor (TipTap) with live preview. You can also edit raw Markdown.
Can I export documents with LaTeX to PDF?
Yes. Print to PDF and the rendered math is included. See the Markdown to PDF page.

Related pages

Import DOCXOpen Editor