LaTeX in Markdown

Johannes Grosse jgrosse at mppmu.mpg.de
Thu Sep 22 05:27:59 EDT 2005



Hi,

I wrote a small filter program which allows
the inclusion of arbitrary LaTeX commands in
a Markdown document by extracting them to
separate TeX files, calling a conversion script
(by default textogif by John Walker) and replacing
the TeX commands by a suitable image link in
Markdown syntax. (I.e. the output of my filter
is a regular Markdown document.)

So full conversion works like this

TeXdown.pl mydoc.text | Markdown.pl > mydoc.html

(Its a perl program but at the moment it depends
on Linux.)

I know it's against the design goals of Markdown,
but it's completely separated from Markdown and
I definitely wanted to have the possibility of sending
inline equations in emails. (So please don't skin me! ;)

At the moment the syntax is as follows, though
this may change:
For inline TeX commands in mathmode just surround
the commands like this: %% a^2+b^2 %%.
If you want to have a math display (actually its
an AMSmath {align*} block) simply write two percent
signs at the beginning of a line without closing %%.
Like this:

%% a < b \quad \wedge \quad b < c
%% \Rightarrow a < c

which will just produce an image containing

a < b ^ b < c => a < c

(Okay, I should have chosen an example where
a textual representation breaks down.)

Anyway, here is an example page:
http://www.physik.hu-berlin.de/~jgrosse/texdown/

(Actually the examples are a bit towards the bottom of
the page.)

Regards
Johannes


More information about the Markdown-Discuss mailing list