Summary: This module is a beginner's guide to using and troubleshooting the LaTeX to CNXML importer. It can be used a companion to the Connexions LaTeX Importer tutorial at http://cnx.org/help/UsingLaTeX .
Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
One of the first lessons learned when using the LaTeX importer is to abide by the rules. The importer is a rather faithful utility, but it will not function properly unless the LaTeX file is properly prepared. So, the first step to importing your LaTeX document is preparation.
Connexions has created a template that will aid you in this process. The template is available for download here.
The importer uses Tralics to translate LaTeX to CNXML. Tralics supports a large number of LaTeX packages and commands, but not all of them. Using the Connexions LaTeX Template will increase your chances for a successful import. Follow the steps below to prepare your document.
\begin{document} and \end{document} commands in the template. \usepackage{} commands required by your LaTeX document. These are located in the preamble of the Connexions LaTeX template. \usepackage{} commands. \usepackage{} commands allowed by the template. Once you have successfully completed the steps above, your document should be properly prepared for import in to the Connexions depository. Follow the steps below:
![]() |
This section of the module will serve as a consistently updated resource documenting typical importer issues and errors as well as known solutions.
<image mime-type="image/png" src="fig15.png" id="uid4_onlineimage" width="500"/><image mime-type="application/postscript" src="fig15.eps" id="uid4_printimage"/>,
you can change the size of the image by adjusting the number. \begin{equation} and \end{equation} tags in the LaTeX file, the text will often be interpreted as an "identifier" <m:mi></m:mi>). The result of this error will look like the equation below.
<m:mtext>your text here</m:mtext>. These errors are much more difficult to remedy. As of right now, the error message received when a file does not import is generic and gives very little information about what actually caused the import to fail, but this section will provide you with a few known issues that might result in failure.
\sqrt{} command without braces, as in \sqrt\pi instead of \sqrt{\pi}. The latter usage is the only supported technique. \includegraphics{} statements than are used in the actual files they reference in the .zip folder. Though this may work in development on a Windows platform, it will cause an error in the Linux-based importer.\usepackage{} commands are actually required by your document. If you locate any that are not necessary comment them out, save your file and attempt to import the file again. \mbox{} command is known to cause issues, especially when more than of these commands occurs in close succession. For example the following lines of LaTeX resulted in the a module's failure to import, even though it was possible to successfully build the file on a Windows platform.
\be
n\phi = 2K_1i \ \ \ \mbox{for i = 0, 1,
\dots}
\label{cc24}\ee
From (\ref{cc15}), this gives
\be
\omega_{zi} = sn [2K_1i/n,k] , \ \ \ \mbox{i =
0,1,\dots}
\label{cc25}\ee
This can be reformulated using (\ref{cc18}) so that $n$ and $K_1$ are not
needed. For $N$ odd, the zero locations are
\be
\omega_{zi} = sn [2Ki/N,k] , \ \ \ \mbox{i = 0,1,\dots}
\label{cc26}\ee
\section{your text here} command, but lacks any content following it. This sort of empty section is permitted anywhere inside the document except as the final section if the section is followed by a bibliography file. This will break the importer. There is a simple remedy for this issue. If you do not need the section, simply comment it out and attempt to import again, but if you do need the section header resulting from the command, add text following the marker but before the bibliography. Once you import the file, you can manually delete the text from the paragraph under the section marker, but you can not delete the paragraph. This is prohibited by Connexions. A section must contain something. Hopefully this short guide has been helpful. Obviously, this list does not cover all of the possible issues, but this module will serve as a living document continuing to be updated and refined as new issues and solutions become known. If you come across an error that you think is a Tralics based error, please let Connexions know using the bug submission form.