Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using wxMaxima for doing homework. I have extremely long mathematical equations. I exported my work to a .tex file. But now I have several overfull bad box warnings. I tried to use geometry package to reduce margin to almost nothing and even changed the paper to landscape. Still I am not able to make the equations fit. I am not able to figure out which LaTeX tag is preventing hyphenation from working in the math environment. Can someone suggest a solution smarter than manually fixing each of the overfull boxes?

My file looks like this:

\documentclass{article}

%% Created with wxMaxima 13.04.2

\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage{color}
\usepackage{amsmath}
\usepackage{geometry}
\geometry{legalpaper, landscape, margin=0.1in}

\definecolor{labelcolor}{RGB}{100,0,0}

\begin{document}

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i12) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
kill(all)$
u : A + (u0 - A)*exp(-x/%lambda);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o1) }
A+{e}^{−\frac{x}{\lambda}}\,\left( u0−A\right) 
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i2) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
assume(L > 0)$
I : (k/2)*(u/l)^2 + (%tau/2)*(diff(u,x))^2 + (%tau)*(u/l);
E : integrate(I,x,0,L);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o3) }
\frac{k\,{\left( A+{e}^{−\frac{x}{\lambda}}\,\left( u0−A\right) \right) }^{2}}{2\,{l}^{2}}+\frac{\tau\,\left( A+{e}^{−\frac{x}{\lambda}}\,\left( u0−A\right) \right) }{l}+\frac{\tau\,{e}^{−\frac{2\,x}{\lambda}}\,{\left( u0−A\right) }^{2}}{2\,{\lambda}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o4) }
({e}^{−\frac{2\,L}{\lambda}}\,(\left( \left( 2\,\lambda\,k\,{A}^{2}+4\,\lambda\,\tau\,l\,A\right) \,L+\left( \tau\,{l}^{2}−3\,{\lambda}^{2}\,k\right) \,{A}^{2}+\left( \left( 2\,{\lambda}^{2}\,k−2\,\tau\,{l}^{2}\right) \,u0−4\,{\lambda}^{2}\,\tau\,l\right) \,A+\left( \tau\,{l}^{2}+{\lambda}^{2}\,k\right) \,{u0}^{2}+4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{2\,L}{\lambda}}+\left( 4\,{\lambda}^{2}\,k\,{A}^{2}+\left( 4\,{\lambda}^{2}\,\tau\,l−4\,{\lambda}^{2}\,k\,u0\right) \,A−4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{L}{\lambda}}+\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{A}^{2}+\left( 2\,\tau\,{l}^{2}+2\,{\lambda}^{2}\,k\right) \,u0\,A+\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{u0}^{2}))/(4\,\lambda\,{l}^{2})
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i5) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
eq1 : diff(E,A) = 0;
eq2 : diff(E,%lambda) = 0;
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o5) }
\frac{{e}^{−\frac{2\,L}{\lambda}}\,\left( \left( \left( 4\,\lambda\,k\,A+4\,\lambda\,\tau\,l\right) \,L+2\,\left( \tau\,{l}^{2}−3\,{\lambda}^{2}\,k\right) \,A+\left( 2\,{\lambda}^{2}\,k−2\,\tau\,{l}^{2}\right) \,u0−4\,{\lambda}^{2}\,\tau\,l\right) \,{e}^{\frac{2\,L}{\lambda}}+\left( 8\,{\lambda}^{2}\,k\,A−4\,{\lambda}^{2}\,k\,u0+4\,{\lambda}^{2}\,\tau\,l\right) \,{e}^{\frac{L}{\lambda}}+2\,\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,A+\left( 2\,\tau\,{l}^{2}+2\,{\lambda}^{2}\,k\right) \,u0\right) }{4\,\lambda\,{l}^{2}}=0
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o6) }
({e}^{−\frac{2\,L}{\lambda}}\,(−\frac{2\,L\,\left( \left( 2\,\lambda\,k\,{A}^{2}+4\,\lambda\,\tau\,l\,A\right) \,L+\left( \tau\,{l}^{2}−3\,{\lambda}^{2}\,k\right) \,{A}^{2}+\left( \left( 2\,{\lambda}^{2}\,k−2\,\tau\,{l}^{2}\right) \,u0−4\,{\lambda}^{2}\,\tau\,l\right) \,A+\left( \tau\,{l}^{2}+{\lambda}^{2}\,k\right) \,{u0}^{2}+4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{2\,L}{\lambda}}}{{\lambda}^{2}}+\left( \left( 2\,k\,{A}^{2}+4\,\tau\,l\,A\right) \,L−6\,\lambda\,k\,{A}^{2}+\left( 4\,\lambda\,k\,u0−8\,\lambda\,\tau\,l\right) \,A+2\,\lambda\,k\,{u0}^{2}+8\,\lambda\,\tau\,l\,u0\right) \,{e}^{\frac{2\,L}{\lambda}}−\frac{\left( 4\,{\lambda}^{2}\,k\,{A}^{2}+\left( 4\,{\lambda}^{2}\,\tau\,l−4\,{\lambda}^{2}\,k\,u0\right) \,A−4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,L\,{e}^{\frac{L}{\lambda}}}{{\lambda}^{2}}+\left( 8\,\lambda\,k\,{A}^{2}+\left( 8\,\lambda\,\tau\,l−8\,\lambda\,k\,u0\right) \,A−8\,\lambda\,\tau\,l\,u0\right) \,{e}^{\frac{L}{\lambda}}−2\,\lambda\,k\,{A}^{2}+4\,\lambda\,k\,u0\,A−2\,\lambda\,k\,{u0}^{2}))/(4\,\lambda\,{l}^{2})+(L\,{e}^{−\frac{2\,L}{\lambda}}\,(\left( \left( 2\,\lambda\,k\,{A}^{2}+4\,\lambda\,\tau\,l\,A\right) \,L+\left( \tau\,{l}^{2}−3\,{\lambda}^{2}\,k\right) \,{A}^{2}+\left( \left( 2\,{\lambda}^{2}\,k−2\,\tau\,{l}^{2}\right) \,u0−4\,{\lambda}^{2}\,\tau\,l\right) \,A+\left( \tau\,{l}^{2}+{\lambda}^{2}\,k\right) \,{u0}^{2}+4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{2\,L}{\lambda}}+\left( 4\,{\lambda}^{2}\,k\,{A}^{2}+\left( 4\,{\lambda}^{2}\,\tau\,l−4\,{\lambda}^{2}\,k\,u0\right) \,A−4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{L}{\lambda}}+\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{A}^{2}+\left( 2\,\tau\,{l}^{2}+2\,{\lambda}^{2}\,k\right) \,u0\,A+\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{u0}^{2}))/(2\,{\lambda}^{3}\,{l}^{2})−({e}^{−\frac{2\,L}{\lambda}}\,(\left( \left( 2\,\lambda\,k\,{A}^{2}+4\,\lambda\,\tau\,l\,A\right) \,L+\left( \tau\,{l}^{2}−3\,{\lambda}^{2}\,k\right) \,{A}^{2}+\left( \left( 2\,{\lambda}^{2}\,k−2\,\tau\,{l}^{2}\right) \,u0−4\,{\lambda}^{2}\,\tau\,l\right) \,A+\left( \tau\,{l}^{2}+{\lambda}^{2}\,k\right) \,{u0}^{2}+4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{2\,L}{\lambda}}+\left( 4\,{\lambda}^{2}\,k\,{A}^{2}+\left( 4\,{\lambda}^{2}\,\tau\,l−4\,{\lambda}^{2}\,k\,u0\right) \,A−4\,{\lambda}^{2}\,\tau\,l\,u0\right) \,{e}^{\frac{L}{\lambda}}+\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{A}^{2}+\left( 2\,\tau\,{l}^{2}+2\,{\lambda}^{2}\,k\right) \,u0\,A+\left( −\tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{u0}^{2}))/(4\,{\lambda}^{2}\,{l}^{2})=0
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i7) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
eq1 : expand(eq1/L);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o7) }
\frac{2\,\lambda\,k\,A\,{e}^{−\frac{L}{\lambda}}}{{l}^{2}\,L}−\frac{\lambda\,k\,u0\,{e}^{−\frac{L}{\lambda}}}{{l}^{2}\,L}+\frac{\lambda\,\tau\,{e}^{−\frac{L}{\lambda}}}{l\,L}−\frac{\lambda\,k\,A\,{e}^{−\frac{2\,L}{\lambda}}}{2\,{l}^{2}\,L}−\frac{\tau\,A\,{e}^{−\frac{2\,L}{\lambda}}}{2\,\lambda\,L}+\frac{\lambda\,k\,u0\,{e}^{−\frac{2\,L}{\lambda}}}{2\,{l}^{2}\,L}+\frac{\tau\,u0\,{e}^{−\frac{2\,L}{\lambda}}}{2\,\lambda\,L}−\frac{3\,\lambda\,k\,A}{2\,{l}^{2}\,L}+\frac{\tau\,A}{2\,\lambda\,L}+\frac{\lambda\,k\,u0}{2\,{l}^{2}\,L}−\frac{\tau\,u0}{2\,\lambda\,L}−\frac{\lambda\,\tau}{l\,L}+\frac{k\,A}{{l}^{2}}+\frac{\tau}{l}=0
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i8) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
assume(%lambda > 0)$
eq1 : limit(eq1,L,inf);
eq2 : limit(eq2,L,inf);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o9) }
\frac{k\,A}{{l}^{2}}+\frac{\tau}{l}=0
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o10) }
−\frac{\left( \tau\,{l}^{2}+3\,{\lambda}^{2}\,k\right) \,{A}^{2}+\left( \left( −2\,\tau\,{l}^{2}−2\,{\lambda}^{2}\,k\right) \,u0+4\,{\lambda}^{2}\,\tau\,l\right) \,A+\left( \tau\,{l}^{2}−{\lambda}^{2}\,k\right) \,{u0}^{2}−4\,{\lambda}^{2}\,\tau\,l\,u0}{4\,{\lambda}^{2}\,{l}^{2}}=0
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i11) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
eq2 : expand(eq2);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o11) }
−\frac{3\,k\,{A}^{2}}{4\,{l}^{2}}−\frac{\tau\,{A}^{2}}{4\,{\lambda}^{2}}+\frac{k\,u0\,A}{2\,{l}^{2}}+\frac{\tau\,u0\,A}{2\,{\lambda}^{2}}−\frac{\tau\,A}{l}+\frac{k\,{u0}^{2}}{4\,{l}^{2}}−\frac{\tau\,{u0}^{2}}{4\,{\lambda}^{2}}+\frac{\tau\,u0}{l}=0
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i12) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
facsum_combine : false$
eq2 : facsum(eq2,A,%lambda);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o13) }
−\frac{3\,k\,{A}^{2}}{4\,{l}^{2}}−\frac{\tau\,{A}^{2}}{4\,{\lambda}^{2}}+\frac{\left( k\,u0−2\,\tau\,l\right) \,A}{2\,{l}^{2}}+\frac{\tau\,u0\,A}{2\,{\lambda}^{2}}−\frac{\tau\,{u0}^{2}}{4\,{\lambda}^{2}}+\frac{u0\,\left( k\,u0+4\,\tau\,l\right) }{4\,{l}^{2}}=0
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i14) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
solve(eq1,A);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o14) }
[A=−\frac{\tau\,l}{k}]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i15) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
eq2 : subst(−(%tau*l)/k,A,eq2);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o15) }
−\frac{\tau\,{u0}^{2}}{4\,{\lambda}^{2}}+\frac{u0\,\left( k\,u0+4\,\tau\,l\right) }{4\,{l}^{2}}−\frac{\tau\,\left( k\,u0−2\,\tau\,l\right) }{2\,k\,l}−\frac{{\tau}^{2}\,l\,u0}{2\,{\lambda}^{2}\,k}−\frac{{\tau}^{3}\,{l}^{2}}{4\,{\lambda}^{2}\,{k}^{2}}−\frac{3\,{\tau}^{2}}{4\,k}=0
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i16) 
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
solve(eq2,%lambda);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o16) }
[\lambda=−\sqrt{\frac{\tau}{k}}\,l,\lambda=\sqrt{\frac{\tau}{k}}\,l]
\end{math}
%%%%%%%%%%%%%%%

\end{document}
share|improve this question
    
You either need to split the content manually (and use some of the alignment techniques/environments provided by amsmath), or you could consider looking into breqn. –  Werner Apr 24 at 19:24
    
@Werner: I tried breqn. I got an "memory exceeded" fatal error. Seems I cannot avoid the hard work of manually splitting the lines. I am worried because the \left and \right will not work properly if I insert a newline in between –  Amit Singh Apr 24 at 23:02
    
    
@Werner Please make an answer here, perhaps including the fact it's really not a technical issue (things are too long => make them shorter!). –  Joseph Wright Sep 7 at 6:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.