TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am typesetting a set of instructions which includes several (Unix) command line arguments. I have been using the listings package to include these arguments, but the colouring is less than ideal. Weird words like "test" are bolded. Is there something more like Pygments, which can highlight flags and filenames and the like?

As an example something like

program-name -some-option-flag -some-other-option-flag -i /location/of/input/file -o /location/of/output/file
share|improve this question

closed as unclear what you're asking by Jubobs, Speravir, ChrisS, Jesse, cmhughes Jan 16 '14 at 5:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Would you please provide an example of what you're doing? – egreg Nov 9 '11 at 17:32
@Dave: You can use the package minted which uses pygments. – Marco Daniel Nov 9 '11 at 17:49
It is possible to specify the language used in a listing, and even define your own language or formatting. As suggested, provide an MWE to allow others to work with something. – Werner Nov 9 '11 at 18:43
Thanks for providing the command line that you are tying to typeset, but it would be even more helpful to have a complete MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. That way we can see exactly what the problem is. – Peter Grill Nov 9 '11 at 23:53

Without a full MWE it not clear exactly what issue you are having. But, you can define you own keywords that you want highlighted. Below I have defined cd, man, ls,and uptime to be emphasized in blue, and the keyword filename to be emphasized in red. So when these appear in the listing the specified formatting is applied.

enter image description here


    numbers=left, numberstyle=\tiny, stepnumber=2, numbersep=5pt,%

    cd, man, ls,uptime%

man cd
ls -lF test/
rm filename
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.