## 5696 Reputation

8 years, 295 days

## MaplePrimes Activity

### These are replies submitted by nm

Thanks for checking.

The only difference in setting, is that you had interface(prettyprint) set to 2, while my default is 3. But I change it to 2, and it made no difference.

The other non setting difference, is that I have Latest Physics package and you do not?

 > restart: Physics:-Version();

 > interface(version);

 > interface(typesetting);

 > interface(prettyprint);

 > latex:-Settings();

 > sol:= u(r,t) =     invlaplace(         BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))*s/(s^2+1),         s, t      )      - invlaplace(            BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))/s,            s, t      )      - cos(t) + 1 : latex(sol);

u \! \left(r , t\right) =
\mathit{Typesetting}\mcoloneq \mathit{msup}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mi}\! \left(\text{$\mathcal\{L\}$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mrow}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mo}\! \left(\text{$-$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mn}\! \left(1"\right)\right), \mathit{Typesetting}\mcoloneq \mathit{msemantics}=\text{atomic"}\right)\! \left(\frac{J_{0}\! \left(10 \sqrt{-s}\, r \right) s}{J_{0}\! \left(20 \sqrt{-s}\right) \left(s^{2}+1\right)}, s , t\right)-\mathit{Typesetting}\mcoloneq \mathit{msup}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mi}\! \left(\text{$\mathcal\{L\}$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mrow}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mo}\! \left(\text{$-$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mn}\! \left(1"\right)\right), \mathit{Typesetting}\mcoloneq \mathit{msemantics}=\text{atomic"}\right)\! \left(\frac{J_{0}\! \left(10 \sqrt{-s}\, r \right)}{J_{0}\! \left(20 \sqrt{-s}\right) s}, s , t\right)-\cos \! \left(t \right)+1

 > interface(prettyprint=2);

 > interface(prettyprint);

 > latex(sol);

u \! \left(r , t\right) =
\mathit{Typesetting}\mcoloneq \mathit{msup}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mi}\! \left(\text{$\mathcal\{L\}$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mrow}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mo}\! \left(\text{$-$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mn}\! \left(1"\right)\right), \mathit{Typesetting}\mcoloneq \mathit{msemantics}=\text{atomic"}\right)\! \left(\frac{J_{0}\! \left(10 \sqrt{-s}\, r \right) s}{J_{0}\! \left(20 \sqrt{-s}\right) \left(s^{2}+1\right)}, s , t\right)-\mathit{Typesetting}\mcoloneq \mathit{msup}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mi}\! \left(\text{$\mathcal\{L\}$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mrow}\! \left(\mathit{Typesetting}\mcoloneq \mathit{mo}\! \left(\text{$-$"}\right), \mathit{Typesetting}\mcoloneq \mathit{mn}\! \left(1"\right)\right), \mathit{Typesetting}\mcoloneq \mathit{msemantics}=\text{atomic"}\right)\! \left(\frac{J_{0}\! \left(10 \sqrt{-s}\, r \right)}{J_{0}\! \left(20 \sqrt{-s}\right) s}, s , t\right)-\cos \! \left(t \right)+1

 >

THanks. I included the packages that I thought I needed. After all, I am only exporting some math and text, so I thought that is what needed is.

\usepackage{amsmath}
\usepackage{array}
\usepackage{maple}

But now I exported the latex file itself. i.e. I typed in new worksheet the following

restart;
Student:-Calculus1:-ShowSolution(Int(x^3,x=0..1));


Then did file->export as->Latex after evaluating the above.

Two issues:  The latex file does not compile. it gives error

>pdflatex t.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./t.tex
.............
! Undefined control sequence.
<argument> $\begin {array}{ccc} & & \textrm {Integration Steps} \\ & & \int _{0}^{1}x^{3}dx \\ \textrm {▫} & & \textrm {1. Apply the}\boldsymbol {\textrm {power}}\textrm {rule to the term}\intx ^{3}dx \\ & \textrm {◦} & \textrm {Recall the defini... l.75 \end{array}$}

?


I am using current texlive.

Second issue: Maple generates \usepackage{breqn}

This package breqn is known to cause massive problems as it redfined many things. I stopped using it long time ago as it could break latex compilation due to conflict with other package. There are many post about this in tex forum. It will be best if Maple latex export does not use this package at all.

Please see worksheet attached.  I wonder if the above latex file generated compiles OK for others. Here is the latex file generated by Maple.

%% Created by Maple 2021.0, Windows 10
%% Source Worksheet: t
%% Generated: Sun Mar 28 15:07:48 CDT 2021
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{mathtools}
\usepackage{maple}
\usepackage[utf8]{inputenc}
\usepackage[svgnames]{xcolor}
\usepackage{amsmath}
\usepackage{breqn}
\usepackage{textcomp}
\begin{document}
\lstset{basicstyle=\ttfamily,breaklines=true,columns=flexible}
\pagestyle{empty}
\DefineParaStyle{Maple Bullet Item}
\DefineParaStyle{Maple Warning}
\DefineParaStyle{Maple Dash Item}
\DefineParaStyle{Maple Error}
\DefineParaStyle{Maple Title}
\DefineParaStyle{Maple Ordered List 1}
\DefineParaStyle{Maple Text Output}
\DefineParaStyle{Maple Ordered List 2}
\DefineParaStyle{Maple Ordered List 3}
\DefineParaStyle{Maple Normal}
\DefineParaStyle{Maple Ordered List 4}
\DefineParaStyle{Maple Ordered List 5}
\DefineCharStyle{Maple 2D Output}
\DefineCharStyle{Maple 2D Input}
\DefineCharStyle{Maple Maple Input}
\DefineCharStyle{Maple 2D Math}
\begin{lstlisting}
> interface(version);
Physics:-Version();
\end{lstlisting}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{$\mathit{Standard\,Worksheet\,Interface,\,Maple\,2021.0,\,Windows\,10,\,March\,5\,2021\,Build\,ID\,1523359\,}$}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{$\mathit{The\,Physics\,Updates"\,version\,in\,the\,MapleCloud\,is\,938\,and\,is\,the\,same\,as\,the\,version\,installed\,in\,this\,computer,\,created\,2021,\,March\,27,\,12:39\,hours\,Pacific\,Time.\,}$}
\end{maplelatex}
\begin{lstlisting}
> restart;

\end{lstlisting}
\begin{lstlisting}
> Student:-Calculus1:-ShowSolution(Int(x^3,x=0..1));
\end{lstlisting}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{$\begin{array}{ccc} & & \textrm{Integration Steps} \\ & & \int_{0}^{1}x^{3}dx \\ \textrm{▫} & & \textrm{1. Apply the}\boldsymbol{\textrm{power}}\textrm{rule to the term}\intx^{3}dx \\ & \textrm{◦} & \textrm{Recall the definition of the}\boldsymbol{\textrm{power}}\textrm{rule, for n}\textrm{≠} \\ \textrm{-1} \\ & & \intx^{n}dx =\frac{x^{n +1}}{n +1} \\ & \textrm{◦} & \textrm{This means:} \\ & & \intx^{3}dx =\frac{x^{3+1}}{3+1} \\ & \textrm{◦} & \textrm{So,} \\ & & \intx^{3}dx =\frac{x^{4}}{4} \\ & \textrm{◦} & \textrm{Apply limits of definite integral} \\ & & \frac{x^{4}}{4}{\raisebox{-0.36em}{\Big |}}{\mstack{}{_{x \hiderel{=}1}}}-\left(\frac{x^{4}}{4}{\raisebox{-0.36em}{\Big |}}{\mstack{}{_{x \hiderel{=}0}}}\right) \\ & & \textrm{We can rewrite the integral as:} \\ & & \frac{1}{4} \end{array}$}
\end{maplelatex}
\begin{lstlisting}
>
\end{lstlisting}
\begin{lstlisting}
>
\end{lstlisting}
\end{document}


t.mw

where when you type a bracket, it creates a grey closing bracket and the cursor stays between them.

Ok, this explains it a little more clearly.

But this is trivial to do.  I do this all the time. I always type () myself to start with, then go back to fill the stuff in between the brackets. I guess it is by habit I do this all the time.

So what you are asking for, is for maple to automatically add   )  when you first type  ( but leaving the mouse after the first (

The difference between this and manually typing () first yourself, is that you do not need to move the mouse back to the front of the first (

I myself do not like this. I've seen it in other text editors. I turn this feature off in every editor I use which does this automatically.

Since I like to add () explicitly myself each time, I find I get   (  ))  if I keep this feature on. But this a preference ofcourse.

when I type "sin(pi" it would automatically create a closing bracket

I must be missing something. How is Maple supposed to know you want to put closing after you typed Pi ?

What if someone wanted to type  sin(Pi+2) ?  Then the code will come out sin(Pi)+2 instead?

Maple has auto bracket matching already. So all what you have to do, is insert ) and maple will flash quickly the corressponding on the line, which is very useful.

Thanks for checking. In Maple 2020.2 it also shows the dots, just like in Maple 2021. So this seems to have changed sometime after Maple 2018?

Thanks. I just checked. I have no Maple profile and I do not use any startup code at all.

I also updated Physics package to latest now, and copy as latex still does not work. Copies nothing. the clipboard is empty.

May be something with the window 10 version I have. oh well. I could always just do latex() and then copy the output of the command. That always worked.

"that I had som custom startup profile code and in that code I had re-bounded the latex command to the physics package version of the command and the consequence was that latex now was inert and gave the behaviour you are seeing where "Copy as latex" does nothing."

I do not have any of the above. I never changed latex command myself. latex() works find in the worksheet. But not as "save as".

But I will loolk. Where is this start up profile file that I should look for? Where would be it located in the systems? I am using windows 10.

Hello;

libname gives
"C:\Program Files\Maple 2021\lib", "C:\Users\me\maple\toolbox\DirectSearch\lib",        "C:\Users\me\maple\toolbox\OrthogonalExpansions\lib"

I have not changed anything with libname after installing Maple 2021 a week or so ago.

I have not had chance to install Physics package yet. So Maple is still in same state as installed.

I updated the movie also to show the above. I made sure window clipboard is clear. Then did the above copy as latex, but window says clip board is empty and I get beep when pasting.

Will play more with it to see why. I tried few times, restarted maple few times. it is not working for me. Do not know why.

I can't even get copy as latex to work. (First time I tried it also in Maple 2021)

Could you show step by step what you did? I tried in worksheet and in document.

Nothing gets copied. I show Maple document. I selected the math output, did copy as latex. Then moved over to the right, to my open latex editor, and pasted it there (Ctrl-V on windows). Nothing shows up. the clipboard is empty.  I check windows 10 system and it shows the clipboard is empty also.  I also tried to paste back into Maple worksheet, I just get a beep. Nothing gets copied to clipboard.

Do you have to do something else to make this work?

windows 10. Maple 2021.  My windows 10 version:

Sure. One can always do manual sorting (but it is little tricker than just calling sort, as one has to use same sort order for the eigenvalues to keep the corresponding eiegvectors in same order in the matrix as the now new order of the eigenvalues after sorting).

This is all possible. I could write a wrapper function and call it my_eigenvectors(matrix) and put all this code inside it, so not to have to do it each time.

But my question if there is a way for Maple to keep same order each time the command is used. I do not understand why it gives a different order each time it is called (or may be every other time), as there are no random numbers involved in finding eigenvectors and eigenvalues.

So why does the order change?

I do not know anything about "components". I only know about worksheet and document mode.

I would imagine that the vast majority of Maple users use one of these two modes?  So using Latex to generate PDF will solve this problem for the majority of users.

Direct PDF export from document is always going to have some formating issues, specially with graphics and different fonts used, and will never look as good as using Latex as the source to generate PDF.

Btw, similar issues happen in Mathematica when using direct export to PDF. Not all formating will be exported as it shows on the screen using direct export to PDF.

The best long term solution is to convert the document first to Latex, then convert the generated Latex to PDF.