This packages parses a LaTeX file, looking for Macaulay2 code. The latter must follow the syntax of the LaTeX package "listings", namely, if must be enclosed in \begin{lstlisting}[language=Macaulay2]...\end{lstlisting}, or must be taken from an external M2 file via \begin{lstinputlisting}[language=Macaulay2]{filename.m2}; one can also insert inline code with \lstinline[language=Macaulay2]!...!, but it is not parsed. See the example file ex.tex.
It then produces a new file where the output of the code has been inserted in place of the input. The LaTeX file should contain \usepackage{listings} and should include a definition of the Macaulay2 language; this can be found in the auxiliary file lst-Macaulay2.tex.
It also replaces automatically commands of the form \macoutput{n} with the nth output of Macaulay2.
mergeTeX takes as input the TeX source as a string and returns the output as a string, whereas mergeTeXFile takes as arguments the names of the source LaTeX file and of the target LaTeX file (the two can be identical; mergeTeXFile acts idempotently).
This documentation describes version 0.6 of MergeTeX.
If you have used this package in your research, please cite it as follows:
|
The object MergeTeX is a package, defined in MergeTeX.m2, with auxiliary files in MergeTeX/.
The source of this document is in MergeTeX.m2:201:0.