[Download TeXdown 0.2, and Markdown](bundle-latest.tar.gz) * [TeXdown 0.1.2](texdown-0.1.2.tar.gz) * [See source of this file](./TeXdown-Readme.text) ----------------------------------------------------------------------------- TeXdown 0.2 =========== [Markdown](http://daringfireball.net/projects/markdown/) is a simple textual (i.e. human readable) markup that can be translated to html. `%\TeXdown%` is a pre-filter for Markdown. It introduces two new syntax elements: * inline LaTeX code (in math mode) * display LaTeX code This is also in math mode by default. To be precise it is in an `{align}` block from `amsmath`, but a `\begin` as the first command in the first line of the LaTeX block switches this off. 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 ------------ * Perl 5.6 or later * [Markdown](http://daringfireball.net/projects/markdown/) * LaTeX2eps * [dvipng](http://sourceforge.net/projects/dvipng/) - `libgd` - `FreeType2` or `T1lib` (optional, improves processing) - `libpng` and `libz` - `kpathsea` (you'll have it if you have latex) - `texinfo` (for building the docs) * You *do not* need Ghostscript! 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.](http://www.physik.hu-berlin.de/~jgrosse/texdown/TeXdown-Readme-Markdown.html) To Do ----- * Wait for the flame war. * Test recovery from LaTeX errors. 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 * decided to use `latex` and `dvipng` for image generation. Estimated speedup: factor 10 to 100. Please test it! This page's translation took less than a second. It might even be fast enough for translation on-the-fly. ### v0.1.1 * Changed syntax to: - percent plus backtick for inline - at least 5 spaces or tab plus double percent for block ### v0.1beta * This is a beta -- no history produced, yet. Examples -------- The real strength is of course simple inline `%a^2+b^2=c^2%` equations. But to show off, here are some pretty examples from [latexrender](http://www.mayer.dial.pipex.com/latexrender/latexrender.htm) a very nice PHP interface to LaTeX. ### Simple numbered display The following code %% \sum_{\substack{0{align} Environment Wow, a table: %% \begin{tabular}{c r @{.} l} %% Pi expression & \multicolumn{2}{c}{Value} \\ %% \hline %% $\pi$ & 3&1416 \\ %% $\pi^{\pi}$ & 36&46 \\ %% $(\pi^{\pi})^{\pi}$ & 80662&7 \\ %% \end{tabular} 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: %% %\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} If you do not like the auto-numbering: %% \sum_{\substack{0 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.