Math & ScienceLATEX-AMS generated from MathType fails to compile

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
4fingers
Posts: 12
Joined: Fri Jul 03, 2009 11:57 am

LATEX-AMS generated from MathType fails to compile

Post by 4fingers »

Hi,

I have created a simple equation using MathType 6.9 and exporting it to "AMSLaTeX" or "AMSTeX" results in errors from my LaTeX document. However, exporting it as "LaTeX 2.09 and later" works perfectly.

Before I start complaining to MathType that they might have a bug in their program I wanted to make sure I wasn't doing anything silly.

A basic example of the AMS LaTeX breaking is shown in the following document:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\begin{document}

% The following LaTeX from MathType Works
% MathType!Translator!2!1!LaTeX.tdl!LaTeX 2.09 and later!
% MathType!MTEF!2!1!+-
% feaagGart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn
% hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr
% 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq-Jc9
% vqaqpepm0xbba9pwe9Q8fs0-yqaqpepae9pg0FirpepeKkFr0xfr-x
% fr-xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaWaaSaaaeaaca
% qGqbaabaGaaeyWdiaabwhadaahaaWcbeqaaiaabkdaaaaaaaaa!39FA!
$\frac{{\rm{P}}}{{{\rm{\rho }}{{\rm{u}}^{\rm{2}}}}}$% MathType!End!2!1!


% The following AMSLaTeX from MathType fails with errors
% MathType!Translator!2!1!AMS LaTeX.tdl!AMSLaTeX!
% MathType!MTEF!2!1!+-
% feaagGart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn
% hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr
% 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq-Jc9
% vqaqpepm0xbba9pwe9Q8fs0-yqaqpepae9pg0FirpepeKkFr0xfr-x
% fr-xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaWaaSaaaeaaca
% qGqbaabaGaaeyWdiaabwhadaahaaWcbeqaaiaabkdaaaaaaaaa!39FA!
$\frac{{\text{P}}}{{{\text{\rho }}{{\text{u}}^{\text{2}}}}}$% MathType!End!2!1!


% The following AMSTeX from MathType fails with errors
% MathType!Translator!2!1!AMSTeX.tdl!AMSTeX!
% MathType!MTEF!2!1!+-
% feaagGart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn
% hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr
% 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq-Jc9
% vqaqpepm0xbba9pwe9Q8fs0-yqaqpepae9pg0FirpepeKkFr0xfr-x
% fr-xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaWaaSaaaeaaca
% qGqbaabaGaaeyWdiaabwhadaahaaWcbeqaaiaabkdaaaaaaaaa!39FA!
$\frac{{\text{P}}}{{{\text{\rho }}{{\text{u}}^{\text{2}}}}}$% MathType!End!2!1!

\end{document}
The attached simple.log file shows the errors generated from the above LaTeX file.

Any idea how I can get the AMS LaTeX to correctly generate the Equation?

Thanks
Attachments
simple.log
(20.43 KiB) Downloaded 477 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LATEX-AMS generated from MathType fails to compile

Post by localghost »

The command \rho for the Greek small letter ρ (or \varrho for ϱ) requires math mode. But your example tries to typeset it in text mode.

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}
  $\frac{\text{P}}{\rho}{\text{u}^2}$

  $\frac{P}{\rho}{u^2}$
\end{document}
Somethings is wrong with the export from MathType.


Thorsten
4fingers
Posts: 12
Joined: Fri Jul 03, 2009 11:57 am

Re: LATEX-AMS generated from MathType fails to compile

Post by 4fingers »

Thanks Thorsten, that reply was very helpful. Now that I know I am not doing anything wrong in my LaTeX document I will try focus my attention on fixing it within MathType.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LATEX-AMS generated from MathType fails to compile

Post by localghost »

4fingers wrote:[…] Now that I know I am not doing anything wrong in my LaTeX document I will try focus my attention on fixing it within MathType.
Perhaps you should type your mathematical stuff directly in LaTeX instead of relying on problematic export by third party tools. What you presented was very basic and if there are already problems with such basics, fixing problems in more complicated expressions can become very time consuming. Writing math in LaTeX is no sorcery. Furthermore the exported code in your example has many superfluous braces which can make longer code very messy so that its more difficult to spot errors.
Post Reply