MTOTEX(1)

NAME
mtotex - turn Miranda(tm) literate scripts into LaTeX files

SYNOPSIS
mtotex [-] [-e] [file...]

DESCRIPTION
Mtotex processes one or more `.m' files containing mira literate scripts and creates from each a `.tex' file of the same name. If no files are given mtotex will act as a filter from its standard input to its standard output. The -e option disables the `\' escaping in comments. You won't want this to be done if your comments already have LaTeX embedded in them. The - option suppresses inclusion of the prologue and afterword. This is useful if you are using mtotex from vi as a filter to format a block of code.

The processing done by mtotex is as follows:-

Put `\' characters in front of all the things that LaTeX would otherwise interpret as metacharacters. These are:
    %, &, _, {, }, #, $

Put \verb"^" around metacharacters that can't be escaped with `\'. These are:
    |, ~, ^, \

Put \begin{miranda} \end{miranda} around blocks of code

Add a prologue and an afterword to keep LaTeX happy. The default prologue and afterword are:-
	\documentstyle[11pt]{article}
	\newenvironment{miranda}{
	\tt
	\nopagebreak[3]
	\begin{tabbing}
	12345678\= 12345678\= 12345678\= 12345678\= 12345678\= \
		12345678\= 12345678\= 12345678\kill
	}{
	\end{tabbing}
	}
	\begin{document}
and
	\end{document}
These can be altered by creating in your home directory files called `.motex1' and `.mtotex2' containing the desired prologue and afterword.

Turn tabs into \>s, spaces into ~ and newlines into \\ inside blocks of code.

Put \underline around all the reserved words in code. Don't underline inside quotes or subwords in identifiers (eg. where_is_it).

Remove any `_\h' sequences in comments.

BUGS
This is a quick hack! It is very slow and clumsy and should probably be rewritten.

AUTHOR
John Cupitt