MarTeX-Cpp is a flexable, extendable and fast TeX-to-HTML converter by fully tokenizing-lexing-parsing-interpreting the TeX source. It can be compiled to serve as a module for different languages, like PHP or JavaScript. It's goal is to provide a way to allow users to write TeX they are familiar with to produce nice looking pages like this one, but without allowing code injection.


Special Characters

Command Result Command Result
\& & \"AaEeIiOoUuy ÄäËëÏïÖöÜüÿ
\% % \'AaEeIiOoUuZ ÁáÉéÍíÓóÚúŹ
\$ $ \`AaEeIiOoUu ÀàÈèÌìÒòÙù
\copy © \^AaEeIiOoUu ÂâÊêÎîÔôÛû
\> > \^AaEeIiOoUu ÂâÊêÎîÔôÛû
\< < \~AaIiOoNnUu ÃãĨĩÕõÑñŨũ
\} } \.AaUu ÅåŮů
\{ { \-Oo Øø
\cdot · \ss ß
\euro \Alpha\alpha Αα
\pound £ \Beta\beta Ββ
\deg ° ...
\backslash \ \Omega\omega Ωω


Images are pretty. Normally the images try to fill the page width, you can control this behaviour with the provided sizing options. If you add a caption to an image it will put "Figure 1: caption" under it. You can change "Figure" to , for example, "Picture" by setting the header with a \define{header}{Picture }.

    \caption{This is a test image}
    \alttext{A mouse!}


Note that there are two different list environments: enumerate and itemize with a different default markers, respectively numbers and bullets.

    \item Apple
    \item Banana
    \item Kiwi 
    \item Pear


Tables are a good way to represent content in a neat way. In MarTeX they behave pretty similar to the LaTeX tabulars. The tabular format accepts '|' for vertical lines, 'l' for left aligned column, 'c' for a centered column and 'r' for a right aligned column.

\begin{tabular}[|| l | c | r ||]
    \hline \hline
    1 & 2 & 3 \\\hline
    4 & 5 & 6 \\\hline
    7 & 8 & 9 \\\hline
    \multicolumn{3}{| c |}{0} \\


Please feel free to submit anything! The only thing I ask is that you include at least one test that verifies the behaviour of your change.

Bug Bounty Program

If you find a way insert arbitrary html tags and/or get javascript execution from a certain input string then first I'd like to congratualate you on a job well done! Please contact me privately with said input and we'll work on pushing out a fix as quickly as possible. Because I'm still a student there is unfortunately no hard cash to be made here, but certainly there is coffee and cake in it for you!




Thanks to my committee for their endless patience and enthusiasm while listening to me whining on about this.
Thanks to Diego Perini for writing a nifty regex-based URL validator.


This project is licensed under the MIT License - see the file for details