Google Answers Logo
View Question
 
Q: Code listings in LaTeX ( No Answer,   0 Comments )
Question  
Subject: Code listings in LaTeX
Category: Computers > Software
Asked by: writealot-ga
List Price: $15.00
Posted: 01 Sep 2006 12:44 PDT
Expires: 01 Sep 2006 14:04 PDT
Question ID: 761457
I have a large document with lots of pseudocode in LaTeX. My question
is: what is the easiest way for me to get decent-looking code?

The fewer of these I need to do, the easier I consider it: (i)
numbering lines by hand, (ii) escaping characters like "|" (pipe), ">"
(greater than) or "%" (percent), and (iii) putting "//" at the end of
each line

The pseudocode must have the following features:
- numbered lines (must be able to start from an arbitrary number so I
can split the code into several figures)
- proportional font
- indentation
- I must be able to use my own commands to change the formatting of
specific words, something like this: \method{openGizmo()}
- I must be able to change the font size and line spacing 

Finally, it would be really nice if when I refer to line numbers later
in the text, these number adjust if I add or remove lines in the
pseudocode (in the same way that \ref{introduction} will change to
"Section 2" if the introduction gets moved to section 2).

I have tried the tabbing environment. It's not very nice because I
have to end each line by hand, I have to escape lots of characters,
and (worst of all) I have to number lines by hand.

I have also tried the listings package (with the lstlisting command)
but I can't find a way to get my text in a proportional font, not do I
see an easy mechanism to keep my code indented neatly once I can get a
proportional font.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy