Download TeXdown 0.2, and Markdown * TeXdown 0.1.2 * See source of this file


TeXdown 0.2

Markdown is a simple textual (i.e. human readable) markup that can be translated to html.

<code>TeXdown</code> is a pre-filter for Markdown. It introduces two new syntax elements:

Syntax

Inline math is enclosed in a pair of backticks and percent signs, whereas display math is signalled by a sequence of lines containing two percent signs preceded by at least five (!) spaces or a tab. (So you can escape a math block for both TeXdown and Markdown by preceding it with only four spaces.)

Ooh, that was complicated!

See what your source looks like: `%inline latex code%` for inline code and

%% block 
%% of 
%% latex     
%% commands

for display mode, where the %% signs are preceded by at least five spaces or a tab.

Usage

  1. Copy texdownrc-dist to your home directory, rename into .texdownrc, change settings according to your needs. (The defaults should be reasonable -- you can safely skip this step.)
  2. Put TeXdown.pl, Markdown.pl where your shell can find them.
  3. Try out: TeXdown.pl TeXdown-Readme.text | Markdown.pl > TeXdown-Readme.html
  4. Be patient! If it's fast, something went wrong.
  5. Read the HTML file with your favourite browser.

Requirements

Philosophy

Keep in mind that TeXdown actually breaks the ideas of Markdown. If you really need much mathematics, write a LaTeX file and convert it with LaTeX2html.

But if you just want to embed some equations in an email, for example, this might be what you have been looking for.

Why this complicated syntax?

The idea of this syntax is that the source remains a valid Markdown document where the TeX code is simply taken as an arbitrary code block. So if you do not have TeXdown, you can still translate the text file to an HTML file but instead of a cool image, the tex code will be displayed.

See this file processed by Markdown alone.

To Do

History

"v1.0" will be the name of the first stable version. But v0.2 already works pretty good. (I.e. it will not crunch your files and should reliably output nice images unless you start to do dirty TeX tricks.)

v0.2

v0.1.1

v0.1beta

Examples

The real strength is of course simple inline <code>a^2+b^2=c^2</code> equations.

But to show off, here are some pretty examples from latexrender a very nice PHP interface to LaTeX.

Simple numbered display

The following code

%% \sum_{\substack{0<i<n \\ 1<j<m}} P(i,j) =
%% \sum_{i,j} Q(i,j)

creates

<code>sum_substack0<i<n 1<j<m P(ij) = sum_ij Q(ij)</code>

Entering the same command again yields:

<code>sum_substack0<i<n 1<j<m P(ij) = sum_ij Q(ij)</code>

Escaping the {align} Environment

Wow, a table:

<code>c r l Pi expression multicolumn2cValue hline pi 31416 pi^pi</code>

If for whatever reasons you want to leave math mode, but cannot start with a "\begin", simply insert it as a comment:

%% %\begin
%% \setlength{\unitlength}{1mm}
%% \begin{picture}(60,40)
%% \put(30,20){\vector(1,0){30}}
%% \put(30,20){\vector(4,1){20}}
%% \put(30,20){\vector(3,1){25}}
%% \put(30,20){\vector(2,1){30}}
%% \put(30,20){\vector(1,2){10}}
%% \thicklines
%% \put(30,20){\vector(-4,1){30}}
%% \put(30,20){\vector(-1,4){5}}
%% \thinlines
%% \put(30,20){\vector(-1,-1){5}}
%% \put(30,20){\vector(-1,-4){5}}
%% \end{picture}

which yields:

<code>setlengthunitlength1mm(6040)put(3020)vector(10)30put(3020)v</code>

If you do not like the auto-numbering:

%% \sum_{\substack{0<i<n \\ 1<j<m}} P(i,j) =
%% \sum_{i,j} Q(i,j)
%% \tag{**}

yields

<code>sum_substack0<i<n 1<j<m P(ij) = sum_ij Q(ij)</code>

And \notag produces

<code>sum_substack0<i<n 1<j<m P(ij) = sum_ij Q(ij) notag</code>


License and Copyright

Short form: It's free. Long form: see below.

Files covered by License

MIT License

Copyright (c) 2005 Johannes Große jgrosse@physik.hu-berlin.de

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bye Bye

Hope you had fun reading the legal stuff.