0

I had no problem getting maple code into latex, the issue I am having is that the equations are running off page. I was wondering if anyone had suggestions to fix this.

\documentclass{article}
\usepackage{maplestd2e}
\def\emptyline{\vspace{12pt}}
\usepackage{lscape}
\newcommand{\maplebreak}{\hfill\break}
\allowdisplaybreaks
\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}

\mapleinline{inert}{2d}{U := m[1]m[2]/[(u[1]-u[2])^2+(v[1]-v[2])^2+(w[1]-w[2])^2]^(1/2)+m[1]M[1]/[(u[1]+aM[2]/M)^2+v[1]^2+w[1]^2]^(1/2)+m[1]M[2]/[(u[1]-aM[1]/M)^2+v[1]^2+w[1]^2]^(1/2)+m[2]M[1]/[(u[2]+aM[2]/M)^2+v[2]^2+w[2]^2]^(1/2)+m[2]M[2]/[(u[2]-a*M[1]/M)^2+v[2]^2+w[2]^2]^(1/2); 1}{[\displaystyle ]}

\mapleinline{inert}{2d}{U := m[1]m[2]/[(u[1]-u[2])^2+(v[1]-v[2])^2+(w[1]-w[2])^2]^(1/2)+m[1]M[1]/[(u[1]+aM[2]/M)^2+v[1]^2+w[1]^2]^(1/2)+m[1]M[2]/[(u[1]-aM[1]/M)^2+v[1]^2+w[1]^2]^(1/2)+m[2]M[1]/[(u[2]+aM[2]/M)^2+v[2]^2+w[2]^2]^(1/2)+m[2]M[2]/[(u[2]-aM[1]/M)^2+v[2]^2+w[2]^2]^(1/2); 1}{[\displaystyle ]} \begin{maplegroup} \mapleresult \begin{maplelatex} \mapleinline{inert}{2d}{m[1]m[2]/sqrt([(u[1]-u[2])^2+(v[1]-v[2])^2+(w[1]-w[2])^2])+m[1]M[1]/sqrt([(u[1]+aM[2]/M)^2+v[1]^2+w[1]^2])+m[1]M[2]/sqrt([(u[1]-aM[1]/M)^2+v[1]^2+w[1]^2])+m[2]M[1]/sqrt([(u[2]+aM[2]/M)^2+v[2]^2+w[2]^2])+m[2]M[2]/sqrt([(u[2]-aM[1]/M)^2+v[2]^2+w[2]^2])}{[\displaystyle {\frac {m_{{1}}m_{{2}}}{ \sqrt{[ \left( u_{{1}}-u_{{2}} \right) ^{2}+ \left( v_{{1}}-v_{{2}} \right) ^{2}+ \left( w_{{1}}-w_{{2}} \right) ^{2}\ \mbox{}]}}}+m_{{1}}M_{{1}} \left( \sqrt{[ \left( u_{{1}}+{\frac {aM_{{2}}}{M}} \right) ^{2}+{v_{{1}}}^{2}+{w_{{1}}}^{2}]} \right) ^{-1}+m_{{1}}M_{{2}} \left( \sqrt{[ \left( u_{{1}}-{\frac {aM_{{1}}}{M}} \right) ^{2}+{v_{{1}}}^{2}+{w_{{1}}}^{2}]} \right) ^{-1}\ \mbox{}+m_{{2}}M_{{1}} \left( \sqrt{[ \left( u_{{2}}+{\frac {aM_{{2}}}{M}} \right) ^{2}+{v_{{2}}}^{2}+{w_{{2}}}^{2}]} \right) ^{-1}+m_{{2}}M_{{2}} \left( \sqrt{[ \left( u_{{2}}-{\frac {aM_{{1}}}{M}} \right) ^{2}+{v_{{2}}}^{2}+{w_{{2}}}^{2}]} \right) ^{-1}]} \end{maplelatex} \end{maplegroup} \end{document}

This is a section of the code that I am using that was imported from Maple. Minus the fact that the other latex files needed to run it have not been included, it should run.

Any tips would be appreciated.

  • maplestd2e doesn't seem to be a standard TeX file, so that's a pretty big "minus the fact" that keeps me from being able to see what you're talking about. – Teepeemm Sep 10 '21 at 20:17
  • How would I share that file with the community? It is quite a bit larger then the code that I even posted above. – NewbieMather Sep 10 '21 at 20:18
  • @NewbieMather: Perhaps consider Pastebin. – Werner Sep 10 '21 at 20:20
  • The first hit with Google can be useful. Not sure it's the same copy as yours. But I don't think there is a provision for \mapleinline to break formulas across lines. The output is awful anyway. – egreg Sep 10 '21 at 20:23
  • I posted the code for it. Let me know if there is anything else needed – NewbieMather Sep 10 '21 at 20:25
  • I did try Googling it first before coming here. I tried several different things but they weren't working. I even tried flipping to landscape to see if it would help, but it ended up give an even weirder pdf then the first. That being said I have cut out an enormous amount of latex for this post since it was just a massive file in the first place. – NewbieMather Sep 10 '21 at 20:25
  • 1
    how come some of the square roots are marked up as \sqrt but others are just as text sqrt which wil be set as a product of variables s q r t – David Carlisle Sep 10 '21 at 20:32
  • tbh I have no idea. Like I said this was code that was imported from Maple. Even if I go in and change that by hand it still does not display in a way that is useful. If I could show you the PDF I would. But since this is my first post on this side of stack exchange it won't let me. – NewbieMather Sep 10 '21 at 20:35
  • yes it will be all on one line, there are some posts on this site showing how to modify code from similar systems to allow line breaking (I'll find a link) but you need the inut tex to be at least slightly reasonable but this does not look that way. I suspect issues in teh original maple code, its output isn't normally that bad I think – David Carlisle Sep 10 '21 at 21:48
  • see also https://tex.stackexchange.com/a/358073/1090 – David Carlisle Sep 10 '21 at 21:52
  • Awesome! Thank you – NewbieMather Sep 11 '21 at 17:18

0 Answers0