Re: How to insert colored program listing in LYX
Hello, Yes, if you choose a fixed length font like Courrier, the layout of the listing is left as in your text editor, with the possibility of syntax highlighting, line numbering and a lot of other possibilities. For me it works very well : I teach Fortran and I use a lot of program extracts in my documents. The only problem I had was with the trees ... they use special characters and it seems to block LyX... Siegfried.
Re: How to insert colored program listing in LYX
Title: MEUNIER-GUTTIN-CLUZEL Hello, Yes, if you first insert the Listings inset and after, you paste your code ( special paste and plain text ... or something like that ... my LyX speaks french ! ). On the screen it was OK and the tree wasn't affected. Remember I'm on Windows XP with LyX 1.5.6, it can be different with linux. In my case, the problem with the listings solution was that I was unable to produce an ouput. No message, nothing and no output ( I think that LaTeX wasn't called ...). I think it's a problem of characters but I don't have time to investigate. The solution with LyX Code produced a good rendering of the directory tree on the PDF output. Siegfried. -- Siegfried MEUNIER-GUTTIN-CLUZEL Maître de conférence à l'INSA de Rouen Fax. 33 (0)2 32 95 37 94 Tél. 02 32 95 37 46 (CORIA) 02 32 95 97 76 ( INSA ) CNRS UMR 6614 - CORIA Université de Rouen Site Universitaire du Madrillet - BP 12 76801 Saint Etienne du Rouvray cedex Tél. 33 (0)2 32 95 36 00 - Fax 33 (0)2 32 91 04 85 www.coria.fr
Re: How to insert colored program listing in LYX
On Tue, 4 Nov 2008, Siegfried MEUNIER-GUTTIN-CLUZEL wrote: To: Md. Golam Parvez <[EMAIL PROTECTED]> From: Siegfried MEUNIER-GUTTIN-CLUZEL <[EMAIL PROTECTED]> Subject: Re: How to insert colored program listing in LYX Hello, You can use the listings package ( Insert > Listings ). If you right-clic on the listing insert box, you can choose the language you use and the syntax will be highlighted. In the listings manual there are many options, so I suppose you can change the colors if you really want. Hope it helps. Siegfried. Hi Siegfried. Would the listings package insert some code verbatim, without affecting the layout or format of the code? Regards, Keith - Websites: http://www.php-debuggers.net http://www.karsites.net http://www.raised-from-the-dead.org.uk Where will you spend Eternity? http://www.fellowshiptractleague.org/tracts/images/PDF/tract_130.pdf All email addresses are challenge-response protected with TMDA [http://tmda.net] -
Re: How to insert colored program listing in LYX
Md. Golam Parvez schrieb: > I am using lyx-1.5.6 in UBUNTU 8.04. Can anybody tell me how to insert > colored program listing. Thanks in advanced. a) use the listings package http://dante.ctan.org/CTAN/help/Catalogue/entries/listings.html with Insert>Listing or Insert>File>Listing (names may vary, my LyX speaks German) or raw LaTeX (ERT). Read its documentation to find out how to style the code with colours (in the documents LaTeX preamble or the listing settings field under Document>Settings>Text Format). b) use Pygments http://pygments.org to generate LaTeX code for a coloured listing and insert as ERT or as Subdocument. c) use some other tool to generate a PDF or PS version of the listing and insert as graphic. Günter
Re: How to insert colored program listing in LYX
Md. Golam Parvez wrote: Hi I am using lyx-1.5.6 in UBUNTU 8.04. Can anybody tell me how to insert colored program listing. Thanks in advanced. Golam Parvez First, make sure you have the listings LaTeX package (listings.sty) installed, as well as one of the color packages (color.sty or xcolor.sty). In LyX, use Document -> Settings -> Preamble to load the color package (e.g., \usepackage{xcolor}). Now use Insert -> Program Listing to get a listing inset, into which you insert your code. Right-click the handle (the word "Listing") to get the settings dialog. In the Main Settings tab, use the lower left portion to select your language and, if necessary, dialect. In the Advanced tab, type in parameters from the listings.sty LaTeX package to control colors. For instance, 'keywordstyle=\color{blue}' will set keywords in a blue font. Consult the documentation of the listings package for possible color settings. /Paul
Re: How to insert colored program listing in LYX
I have used this Highlight converter with good results. http://www.andre-simon.de/ Output in Latex and then import into your LyX document. --- On Tue, 11/4/08, Ernesto Posse <[EMAIL PROTECTED]> wrote: > From: Ernesto Posse <[EMAIL PROTECTED]> > Subject: Re: How to insert colored program listing in LYX > To: lyx-users@lists.lyx.org > Cc: "Md. Golam Parvez" <[EMAIL PROTECTED]> > Date: Tuesday, November 4, 2008, 8:52 AM > And if your language is not on the list, and you know a > little Python, > I recommend Pygments (http://pygments.org) a very nice > syntax > colouring package that generates, among other things, LaTeX > which you > then can include as a file in your LyX document. > > > > On Tue, Nov 4, 2008 at 7:54 AM, Siegfried > MEUNIER-GUTTIN-CLUZEL > <[EMAIL PROTECTED]> wrote: > > Hello, > > > > You can use the listings package ( Insert > > Listings ). > > If you right-clic on the listing insert box, you can > choose the language you > > use and the syntax will be highlighted. > > In the listings manual there are many options, so I > suppose you can change > > the colors if you really want. > > > > Hope it helps. > > > > Siegfried. > > > > > > -- > Ernesto Posse > > Applied Formal Methods Group - Software Technology Lab > School of Computing > Queen's University - Kingston, Ontario, Canada
Re: How to insert colored program listing in LYX
And if your language is not on the list, and you know a little Python, I recommend Pygments (http://pygments.org) a very nice syntax colouring package that generates, among other things, LaTeX which you then can include as a file in your LyX document. On Tue, Nov 4, 2008 at 7:54 AM, Siegfried MEUNIER-GUTTIN-CLUZEL <[EMAIL PROTECTED]> wrote: > Hello, > > You can use the listings package ( Insert > Listings ). > If you right-clic on the listing insert box, you can choose the language you > use and the syntax will be highlighted. > In the listings manual there are many options, so I suppose you can change > the colors if you really want. > > Hope it helps. > > Siegfried. > -- Ernesto Posse Applied Formal Methods Group - Software Technology Lab School of Computing Queen's University - Kingston, Ontario, Canada
Re: How to insert colored program listing in LYX
Hello, You can use the listings package ( Insert > Listings ). If you right-clic on the listing insert box, you can choose the language you use and the syntax will be highlighted. In the listings manual there are many options, so I suppose you can change the colors if you really want. Hope it helps. Siegfried.
How to insert colored program listing in LYX
Hi I am using lyx-1.5.6 in UBUNTU 8.04. Can anybody tell me how to insert colored program listing. Thanks in advanced. Golam Parvez