I want to export my Mathematica code to Latex, so I saved the mathematica notebook as LaTeX document. Copying this latex code to overleaf, I get the attention message "\hbox too wide" and the text crosses the page borders. How could I fix this?
My code is the following:
\documentclass{article}
\usepackage{amsmath, amssymb, graphics, setspace}
\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}
\newcounter{mathematicapage}
\begin{document}
\begin{doublespace}
\noindent\(\pmb{w[2]\text{:=}3*(\text{Pi}{}^{\wedge}2)/2;}\)
\end{doublespace}
\begin{doublespace}
\noindent\(\pmb{w[3]\text{:=}4*(\text{Pi}{}^{\wedge}2);}\)
\end{doublespace}
\begin{doublespace}
\noindent\(\pmb{\text{k222}[\text{x$\_$},\text{t$\_$}]\text{:=}-
\text{Sqrt}[2/3]*\text{Pi}{}^{\wedge}2*(\text{Sin}
[\text{Pi}*x]+4*\text{Sin}[2*x*\text{Pi}]*\text{Exp}
[I*w[2]*t]+9*\text{Sin}[3*x*\text{Pi}]*\text{Exp}[I*w[3]*t])}\)
\end{doublespace}
\end{document}
lstlistingwhere auto newline can be easily done.\pmbcomes from and read its documentation to see if it supports having new lines inside.verbatimorlistingsormintedenvironment (verbatim is simplest and requires no packages, do that first)