On 7/6/2010 5:38 AM, pierrickuk wrote:

Hi there,

I am posting this as 2 hours of searching got me nowhere so far.
I am writing some instructions manual to set up some software my company is
distributing.
For this I need to put some linux console commands for which I use the
LyX-code format. Everything is fine unless the line is too long and then get
wrapped. As some of our customer might not know much about linux, I am
afraid they might hit return at the end of the line.
So I am looking for a way to automatically indicate that the line is wrapped
to fit on a page (preferably by some special symbol not used in a
terminal/console).

Maybe there is some LaTeX package that would work, or some trick I am not
aware of... Or maybe I'm looking in the wrong direction here.


Step 1: Pick the glyph you want to use to indicate line wrapping. "The Comprehensive LATEX Symbol List" may help here. If necessary, install whatever font package it comes in, and add a \usepackage{...} to your preamble. Avoid symbols that occur only in math mode (which, sadly, accounts for most arrows); if there's a way to make them work, I haven't found it yet.

Step 2: Rather than using LyX-code, use Insert > Program Listing, which creates an inset using the listings package. Right-click the inset, click Settings ..., and on the Main Settings tab check "Break long lines". You can leave the language setting at "No language" unless you think what you're writing matches one of the languages on the list fairly well.

Step 3: Go to the advanced tab and, in the right pane, type 'prebreak=whatever', without the quotes and replacing whatever with the symbol you want. For instance,

prebreak=\textbackslash

will put '\' wherever wrapping occurs.

That should do it.

/Paul

Reply via email to