LaTeX in Markdown

| | Comments (1) | TrackBacks (0)

In order to become more familiar with the implementation of Markdown, I spent my free time today extending the language with a new syntax for embedding mathematical notation. Extending Markdown was not entirely trivial, even though my new syntax did not conflict with any other Markdown syntax, but the results are pretty satisfying:

    $$ n! \equiv \prod_{i=1}^n i =
    $$ 1 \cdot 2 \cdot \ldots \cdot n

turns into

The in-line environment is also available. For instance, the sum , written

    1 + 2 + \ldots + n

has a well-known closed form (apocryphally due to Gauss):

Formatting often changes between environments to avoid ugly line spacing; for instance, here is the in-line version of that sum: .

0 TrackBacks

Listed below are links to blogs that reference this entry: LaTeX in Markdown.

TrackBack URL for this entry: http://benjamn.com/mt-tb.cgi/6

1 Comments

The more I think about it, the less sense parsing with regular expressions makes (lexing is a perfect application for regular expressions, but parsing and lexing are two different stages). I'm tempted to write a more principled, extensible markdown language, just to prove a point.

Leave a comment

About this Entry

This page contains a single entry by Ben Newman published on April 12, 2008 6:11 PM.

Where the water heater was was the previous entry in this blog.

Overgrown, outgrown is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Categories

Pages

Powered by Movable Type 4.25