从 Maple 导出的 LaTeX 代码生成了超页方程

从 Maple 导出的 LaTeX 代码生成了超页方程

我想在 LaTeX 文档中排版 Maple 代码。导出基本顺利,但长方程式页面过大。有人知道如何修复吗?我看到了 同样的问题没有答案所以我会尝试再问一次。

排版需要两个文件: mapleenv 文件 maplestd2e.sty

在此处输入图片描述

有一个来源:

\documentclass[pdftex]{article}
\usepackage{maplestd2e}
\begin{document}
\pagestyle{empty}
\DefineParaStyle{Maple Heading 1}
\DefineParaStyle{Maple Text Output}
\DefineParaStyle{Maple Dash Item}
\DefineParaStyle{Maple Bullet Item}
\DefineParaStyle{Maple Normal}
\DefineParaStyle{Maple Heading 4}
\DefineParaStyle{Maple Heading 3}
\DefineParaStyle{Maple Heading 2}
\DefineParaStyle{Maple Warning}
\DefineParaStyle{Maple Title}
\DefineParaStyle{Maple Error}
\DefineCharStyle{Maple Hyperlink}
\DefineCharStyle{Maple 2D Math}
\DefineCharStyle{Maple Maple Input}
\DefineCharStyle{Maple 2D Output}
\DefineCharStyle{Maple 2D Input}
\DefineParaStyle{Maple Plot}
\begin{Maple Normal}{
\begin{Maple Normal}{
\mapleinline{inert}{2d}{}{\[\displaystyle \]}
}\end{Maple Normal}
}\end{Maple Normal}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{restart:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{tn:=45:
kn:=5.12:
Rn:=1500:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{f:=unapply((256*(134.974933+13.87254679*t+0.3750534939e-1*t\symbol{94}2))* k/(R+67.48746650+6.936273395*t+ +0.1875267470e-1*t\symbol{94}2), t,k,R);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{f := proc (t, k, R) options operator, arrow; (256*134.974933+256*13.87254679*t+256*0.3750534939e-1*t^2)*k/(R+67.48746650+6.936273395*t+0.1875267470e-1*t^2) end proc}{\[\displaystyle f\, := \,( {t,k,R} )\mapsto {\frac { \left(  34553.58285+ 3551.371978\,t\\
\mbox{}+ 9.601369444\,{t}^{2} \right) k}{R+ 67.48746650+ 6.936273395\,t\\
\mbox{}+ 0.01875267470\,{t}^{2}}}\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{s1_3:=(R-Rn)*subs(\{t=tn, k=kn, R=Rn\}, diff(f(t,k,R), R));
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{s1_3 := -.2977013542*R+446.5520313}{\[\displaystyle {\it s1\_3}\, := \,- 0.2977013542\,R+ 446.5520313\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{ft:=unapply(s0_1 + s1_1 + s1_2 + s1_3 + s2_1 + s2_2 + s2_3 + s2_4 + s2_5 + s2_6, t,k,R);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}{\[\displaystyle
{\it ft}\, := \,( {t,k,R} )\mapsto  31.5599036+ 9.222047288\,t\\
\mbox{}+ 111.4981076\,k- 0.2977013542\,R\\
\mbox{}- 0.02142132334\, \left( t-45 \right) ^{2}+ 1.801181112\, \left( t-45 \right)  \left( k- 5.12 \right) \\
\mbox{}- 0.003470321056\, \left( t-45 \right)  \left( R-1500 \right) - 0.05814479572\, \left( k- 5.12 \right)  \\ 
\mbox{} \left( R-1500 \right) \\
\mbox{}+ 0.0001552473382\, \left( R-1500 \right) ^{2}\]}
\end{maplelatex}
\end{maplegroup}
\end{document}

答案1

您需要手动注释 4 行,然后它才能工作。不要问我为什么。Maple 生成的 Latex 代码是我见过的所有系统中最糟糕的。

这是新的 pdf

Mathematica 图形

以下是您需要评论的 4 行。

..... as before.....
\begin{maplegroup}
%\begin{mapleinput}    ======> THIS LINE
\mapleinline{active}{1d}{ft:=unapply(s0_1 + s1_1 + s1_2 + s1_3 + s2_1 + s2_2 + s2_3 + s2_4 + s2_5 + s2_6, t,k,R);
}{}
%\end{mapleinput}  ======> THIS LINE
\mapleresult
\begin{maplelatex}
%\mapleinline{inert}{2d}{}{    ======> THIS LINE
\[\displaystyle
{\it ft}\, := \,( {t,k,R} )\mapsto  31.5599036+ 9.222047288\,t\\
\mbox{}+ 111.4981076\,k- 0.2977013542\,R\\
\mbox{}- 0.02142132334\, \left( t-45 \right) ^{2}+ 1.801181112\, \left( t-45 \right)  \left( k- 5.12 \right) \\
\mbox{}- 0.003470321056\, \left( t-45 \right)  \left( R-1500 \right) - 0.05814479572\, \left( k- 5.12 \right)  \\ 
\mbox{} \left( R-1500 \right) \\
\mbox{}+ 0.0001552473382\, \left( R-1500 \right) ^{2}
\]
%}  ======> THIS LINE
\end{maplelatex}
\end{maplegroup}
\end{document}

相关内容