Justin Crites wrote:
Greetings,
I am new to LyX and love the concept. I was hoping to be advised about the
correct way to typeset certain document features.
I am using it for some documents that frequently require sections of
monospace text. For example, I might have a "program listing" block and
then discussion surrounding it, referencing the names of variables or
expressions. I think of the variables or expression snippets semantically
as "code fragments".
In Lyx 1.6:
For big blocks of code, keep the code in a file and use
Insert->Program Listing. That way your document will use the source code
directly, so less need to update the document when you make changes to
the code. The code listed is the _same_ as the code you ran tests with.
(You don't have to list the whole file, it is possible to skip over
uninteresting parts)
Note that there is all sorts of options for pretty-printing code,
you can have automatic "syntax highlighting" if you like. Or just
monospace, if that suits you better.
For smaller pieces in discussions:
First, use "Document Settings", "Modules". Add the "logical markup" module.
After this, you can mark short snippets of code and use Edit->Text
Style->Charstyle:Code.
This is the "LyX way" of doing markup.
Such styles can be customized further if you make your own modules.
Helge Hafting