On Sat, Mar 22, 2003 at 12:31:26AM +0100, Guido Ostkamp wrote: > > I sometimes need sourcecode examples in my documents. I already know, that > the LyX environment "Lyx-Code" must be used for that. > > However, I haven't found a comfortable way to import sourcecode from an > existing ASCII-file without loosing all the formatting - i.e. the > indentation with blanks and/or tabs in front of each line and the line > breaks, which is crucial for the readability of sourcecode.
Insert->Include file, and select "verbatim" in the dialog. Note that this will NOT preserve tabs, so either use a tab2space utility on the file, or use the moreverb or listing package (in fact, the listing package is better as it performs "pretty printing").
