MarTeX


MarTeX is a versitale TeX to HTML interpreter. It comes with a few basic modules, but can easily be expanded upon. It was written by Thijs Miedema for use with marie-curie.nl.

Modules

Module Document

The document module exposes the basic commands that are designed to mimick the LaTeX main environment.

Implemented commands

Special characters

MarTeX has some special characters you need to escape to render:
Command Result
\, Small non-breaking space
\& &
\% %
\$ $
\copy ©
\> >
\< <
\} }
\{ {
\cdot ·
\pm ±
\euro
\pound £
\tm
\deg °
\"AaEeIiOoUuyÄäËëÏïÖöÜüÿ
\'AaEeIiOoUuZÁáÉéÍíÓóÚú´
\`AaEeIiOoUuÀàÈèÌìÒòÙù
\^AaEeIiOoUuÂâÊêÎîÔôÛû
\~AaIiOoNnUuÃãĨĩÕõÑñŨũ
\.AaUuÅåŮů
\-O\-oØø
\ssß
\Alpha\alphaΑα
\Beta\betaΒβ
......
\Phi\phiΦφ
\Omega\omegaΩω
\backslash\

Implemented environments

In MarTeX an environment is defined as the area between a begin and matching end command:

\begin{Environment}
    Environment content
\end{Environment}
\end{verbatim}
\end{code}

\begin{itemize}
    \item{\envdescriptor{document}{Does basically nothing right now, but might do in the future. For now it is there for the TeX code-style idea.}}
    \item{\envdescriptor{paragraph}{Does the same as the command 'paragraph', but now with begin and end commands. Works better for multiline paragraphs.}}
    \item{\envdescriptor{code}{Wrapper for the html 'pre' environment. Stuff in this environment is displayed with all whitespace intact (tabs, newlines, etc)}}
\end{itemize}


\subsubsection{Example}
\begin{code}{latex}
\begin{verbatim}
    \define{marie}{cool}
    \title{My Website}
    \begin{document}
        \section{Chapter One}
        \subsection{Whoarewe}
        \begin{paragraph}
            \textbf{Marie Curie!} \\
            \textit{An association for students of Physics!}
        \end{paragraph}
        \subsubsection{Code!}
            \begin{code}
                    We love tabs in code!
            \end{code}
        \ref{NotDefinedLabel}
    \end{document}
After rendering this results in:

My Website

Chapter One

Whoarewe

Marie Curie!
An association for students of Physics!

Code!

                    We love tabs in code!
            
?

Module Marie

The marie module exposes the marie-specific commands.

Implemented commands

Module Figure

The figure module exposes commands that are designed to mimick the LaTeX package graphicx, with a few exceptions. Maybe the most notable exception is that most of these commands only work inside a figure environment, and will result in "command not found" errors if you use them elsewhere.

Implemented commands

Settings

Reference labels are used to point to your image from the text. They put the following text in your caption: Figure N, where N is replaced with the number of your image. However, you might want to use a different text. For this you can access the global variable 'figureheader'. For example, you could do: \define{figureheader}{image}. Now, the caption wil read: Image N. You should put the \define above all figure environments.

Example

    \define{figureheader}{image}
    \begin{figure}
        \includegraphics{test.png}
        \caption{This is a test image}
        \label{testimage}
        \width{120px}
        \height{30%}
        \alttext{A mouse!}
    \end{figure} 

Module Itemize

The itemize module exposes commands to help make fancy lists.

Implemented commands

Implemented environments

The itemize module implements two environments. They are equivalent, but have a different default marker type.

Example

 \begin{itemize}
    \item{Akcie}
    \item{Ambicie}
    \item{Batavieren}
    \item{Boson}
\end{itemize}
\begin{itemize}
    \setmarker{square}
    \item{Brouwcommissie}
    \item{Colloquiumcommissie}
    \item{Excurcie}
\end{itemize}
\begin{enumerate}
    \item{Impuls}
    \item{Lustrumcie}
    \item{M\"unchencie}
\end{enumerate}
\begin{enumerate}
    \setmarker{letters}
    \item{Ouderdagcie}
    \item{Particie}
    \item{PR-cie}
    \item{Reunistencie}
\end{enumerate}
\begin{enumerate}
    \setmarker{ROMAN}
    \item{Sponsorcommissie}
    \item{Symposiumcie}
    \item{Vakancie}
    \item{Weekendcommissie}
    \item{WWW-cie}
    \item{Co\"ordinatiecommissie}
\end{enumerate} 
After rendering this results in:
  1. Impuls
  2. Lustrumcie
  3. Münchencie
  1. Ouderdagcie
  2. Particie
  3. PR-cie
  4. Reunistencie
  1. Sponsorcommissie
  2. Symposiumcie
  3. Vakancie
  4. Weekendcommissie
  5. WWW-cie
  6. Coördinatiecommissie

Module Tabular

{type}

Tabulars in LaTeX are not the most well defined things. This implementation is basic and subject to change.

Implemented commands

Implemented Environments

The only environment implemented by this module is the tabular environment. It works just like the tabular in LaTeX:
\begin{tabular}[ l | c || r | ]
    \hline
    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\ \hline
    7 & 8 & 9 \\
    \hline
\end{tabular}
This results in:
123
456
789