On Thursday 04 February 2010 10:49:59 Leo Butler wrote:
> On Thu, 4 Feb 2010, ndlopes at gmail.com wrote:
>
> < Hi all:
> <
> < Is there a way of forcing multi-ilne latex output (with line
> breaking). < Right now I use:
> <
> < set_tex_environment_default ("\\begin{multline}\\displaystyle
> < ", "
> < \\end{multline}");
> < tex(expr);
> <
> < No line breaking is included, thus, we get a latex compilation with
> errors < in each \begin{multline}.
>
> Do you have an example, including the output?
>
> Leo
Take the following maxima code:
set_tex_environment_default ("\\vskip0.2in\\begin{multline}\\displaystyle
", "
\\end{multline}\\vskip0.2in");
expr:sum(a[i],i,1,100)$
tex(expr)$
and the following tex file (with the output.tex):
\documentclass[a4paper]{article}
\begin{document}
\vskip0.2in\begin{multline}\displaystyle
a_{100}+a_{99}+a_{98}+a_{97}
+a_{96}+a_{95}+a_{94}+a_{93}+a_{92}+a_{91}+a_{90}+a_{89}+a_{88}+a_{87
}+a_{86}+a_{85}+a_{84}+a_{83}+a_{82}+a_{81}+a_{80}+a_{79}+a_{78}+a_{77
}+a_{76}+a_{75}+a_{74}+a_{73}+a_{72}+a_{71}+a_{70}+a_{69}+a_{68}+a_{67
}+a_{66}+a_{65}+a_{64}+a_{63}+a_{62}+a_{61}+a_{60}+a_{59}+a_{58}+a_{57
}+a_{56}+a_{55}+a_{54}+a_{53}+a_{52}+a_{51}+a_{50}+a_{49}+a_{48}+a_{47
}+a_{46}+a_{45}+a_{44}+a_{43}+a_{42}+a_{41}+a_{40}+a_{39}+a_{38}+a_{37
}+a_{36}+a_{35}+a_{34}+a_{33}+a_{32}+a_{31}+a_{30}+a_{29}+a_{28}+a_{27
}+a_{26}+a_{25}+a_{24}+a_{23}+a_{22}+a_{21}+a_{20}+a_{19}+a_{18}+a_{17
}+a_{16}+a_{15}+a_{14}+a_{13}+a_{12}+a_{11}+a_{10}+a_{9}+a_{8}+a_{7}
+a_{6}+a_{5}+a_{4}+a_{3}+a_{2}+a_{1}
\end{multline}\vskip0.2in
\end{document}
if we compile the above tex code it will give errors at each multline but,if
we force the compilation to jump the errors, a good dvi output is produced
(not so good if the expression has fractional terms or something like that).
If we replace "multline" by "equation" or if we use the amsmath package then
we have a unreadable very long single line.
In summary, what is the best form to output long lines?
Nuno David Lopes