In the introduction a basic example of the package listings was presented, let’s see a second example. You can use the option literate to modify the output: \documentclass[a4paper, 10pt]{article} \usepackage[utf8]{inputenc} \usepackage{listings}. Code listings in LaTeX. “Pretty” code listings are sometimes considered worthwhile by the “ordinary” programmer, but they have a serious place in the.

Author: Dougis Mular
Country: Trinidad & Tobago
Language: English (Spanish)
Genre: Business
Published (Last): 26 March 2006
Pages: 131
PDF File Size: 17.91 Mb
ePub File Size: 11.99 Mb
ISBN: 586-9-22940-257-6
Downloads: 85469
Price: Free* [*Free Regsitration Required]
Uploader: Tobar

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

How to force lstlisting to typeset — instead of a long dash always? Also, how to increase distance between two consecutive dashes?

Code listing

Furthermore you shouldn’t use the option utf8x. An explanation can be found in the question utf8x vs.

  2TK3CGN A PDF

Second, the choice of propotional fonts for listings is ugly. I prefer courier, which gives more satisfactory results:. By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy lslisting and cookie policyand that your continued use of the website is subject to these policies.

Home Questions Tags Users Unanswered. How to typeset – – with lstlisting package?

Consider this small example: You can use the option literate to modify the output: Since the question also asks for “how to increase distance between two consecutive dashes? Herbert k 24 Agreed, Courier is not nice.

First, if you use long dashes for options, then this works: I prefer courier, which gives more satisfactory results: Au 6, 3 22 Sign up or log in Sign up using Google.

CTAN: Package listings

Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Email Required, but never shown. Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy lstlsting cookie policyand that your continued use of the website is subject to these policies.

Literature