1

This is a simple MWE including latexalpha2 package. I have Wolfram Engine installed on my PC and added the WolframScript into the path.

\documentclass{article}
\usepackage{latexalpha2}
\usepackage{amsmath}
\begin{document}
\[  \wolfram{Solve[x+1==0,x]} \]
\end{document}

I get the following error:

Package latexalpha2 Error: WolframScript cannot be found, which is required to use latexalpha2. \begin{document}


EDIT

The output is produced correctly but the error remains. enter image description here


EDIT 2

I tried to produce a 3D plot which took a while to be compile. During complilation I got the following messages before the error shows up

'command' is not recognized as an internal or external command, operable program or batch file.

'rm' is not recognized as an internal or external command, operable program or batch file.

Simon Dispa
  • 39,141
mac
  • 1,479
  • 1
    did you call pdflatex with --shell-escape? – Ulrike Fischer Feb 15 '20 at 14:31
  • Yes. The command is pdflatex.exe -shell-escape -synctex=1 -interaction=nonstopmode --enable-write18 %.tex – mac Feb 15 '20 at 14:34
  • 1
    You dont need both--shell-escapeand--enable-write18. That is the same option. Can you runwolframscript` on a command line? – Ulrike Fischer Feb 15 '20 at 14:43
  • the package uses \immediate\write18{command -v wolframscript; echo $? > latexalpha2_check.tmp}% to check that the command works, but I'm not sure if the echo $? syntax does anything useful if you are not using a unix style shell? – David Carlisle Feb 15 '20 at 14:43
  • @Ulrike Fischer WolframScript is fully functionable on a command line. – mac Feb 15 '20 at 14:45
  • All the shell escape calls are assuming a bash style shell, so command, rm etc if you are using windows cmd shell you probably need to make some edits to the syntax in the write18 calls – David Carlisle Feb 15 '20 at 14:47
  • @David Carlisle How can I do that?Do I need to edit the package? – mac Feb 15 '20 at 15:02
  • yes take a copy of the the package and change the unix shell calls by whatever you would use on the windows commandline, I don't have wolframscript or a windows tex, so I can't help further sorry – David Carlisle Feb 15 '20 at 15:04
  • Were you able to solve it? – Diaa Jan 09 '21 at 00:07
  • @UlrikeFischer I hope you could take a look at my follow-up question here https://tex.stackexchange.com/q/578144/2288. – Diaa Jan 09 '21 at 00:26

1 Answers1

1

This result can be obtained c

running this code (tested with windows, pdflatex and lualatex)

\documentclass[12pt,a4paper]{article}
\RequirePackage{float}% 
\RequirePackage{booktabs}%

\RequirePackage[nocache]{latexalpha2wlua} % option cache (faster the second run) or nocache (recalculate always)

\begin{document}

\begin{figure}[H] \wolframgraphics{Plot3D[Sin[x]Cos[y],{x,-2Pi,2Pi},{y,-2Pi,2Pi}]}{Plot3Db} \includegraphics{Plot3Db.pdf} \caption{Plot 3D of $f(x,y)=\sin(x)\cos(y)$} \centering \end{figure}

Laplace Transform of $t^4 sin(t)$

$$ \wolfram{LaplaceTransform[t^4 Sin[t],t,s]} $$

Generates a power series expansion

$$ \wolfram{Series[Exp[x],{x,0,5}]} $$

\bigskip

Compton scattering for electron \bigskip

$\wolframalpha{Compton scattering for electron}$

\bigskip

Solve the equation $a x^2+b x+c=0$ and display the corresponding results

\wolframsolve{a x^2+b x+c==0}{x}

\newpage \begin{table}[H] \centering \begin{tabular}{ccc} \toprule \wolframtable{Join[{{x,x^2,x^3}}, Table[{i,i^2,i^3},{i,5}]]} \bottomrule \end{tabular} \caption{Generate a table of $x$, $x^2$, $x^2$} \end{table}

\bigskip

The population of Shanghai is $\wolframalpha{Shanghai population}$, which is $\wolframalpha{ratio of Shanghai population and NYC population}$ times the population of New York City.

\bigskip

Solve differential equations $y'(x) + y(x) = a sin(x)y(x)*x $

\wolframdsolve{y'[x]+y[x]==a Sin[x]}{y[x]}{x}

\end{document}

The code for the package latexalpha2wlua and some comments can be found in

https://tex.stackexchange.com/a/579254/161015

Simon Dispa
  • 39,141