Obrigado, Helge!
I will have that look at the "listings" package!
I also found that the {verse} environment also does the trick. I only
have to open a space where the line should break, and it even indents
the next line:
-------------
\begin{verse}
very+long+code+that+should+break+here and+that+really+does\\
more code\\
and even more code.
\end{verse}
-------------
This code outputs:
-------------
very+long+code+that+should+break
and+that+really+does
more code
and even more code.
-------------
It makes sense as, as someone said, "code is poetry". :-)
Thanks again,
Roberto
--------------------
Helge Hafting wrote:
Hi!
I have an article set with the APA class and two columns. In this
article I need to write some amount of javascript code. The problem
is that sometimes this code lines get too long, without any spaces,
so lines extend beyond the columns width. How can I set those
paragraphs to break when they reach the end of the column?
First, you can add explicit hyphenation points (ctrl minus)
in lyx-code too. Well, perhaps not what you want for
computer code, as hyphens could be mistaken for
minus signs. It breaks the lines nicely though, and I think
you can tell latex to use "nothing" instead of a hyphen
when breaking lines. Reset this before continuing with
normal text though!
It would be perfect if broken lines of code got indented after the
break.
You should also have a look at the "listings" package,
which even have some support in newer versions of LyX.
I seem to remember that it can break lines if you want it to.
Helge Hafting
--
-------------------- Roberto Gorjão
freelance designer and web designer
personal site: www.castelosnoar.com
PORTUGAL / BRAGA / PÓVOA DE LANHOSO