TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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 try to change the font of verbatim text as below

% Used by @verbatim ... @endverbatim

But I don't know why some characters cannot be shown in pdf

enter image description here

The example call is the verbatim text in the above figure. The variable name should be parameter_table_build_number, but pdf shows the underscore as an upper dot. I copied that dot and paste into notepad, it shows me the underscore. I searched the underscore in pdf, and it also indicates that dot is the underscore.

However, if I change the font to \footnotesize, it show me the correct character but the verbatim text will exceeds the paper's boundary.

enter image description here

Could anybody tell me how to fix this problem? Thanks a lot.

share|improve this question
please edit your question and add a working minimal example. – Marco Daniel Jul 21 '11 at 21:10
See this link first. listings package is very helpful to handle code inclusion. You should use it. – xport Jul 21 '11 at 21:26
Do not ask the same question time and time again. It is a duplicate of your previous quesion: How to configure the verbatim text? The answers in two questions should be merged. – Leo Liu Jul 29 '11 at 20:10
up vote 11 down vote accepted

You can't use \verbatim ... \endverbatim inside a macro. A detailed explanation you can find here: TeX Frequently Asked Questions - Why doesn’t verbatim work within …?

You can use packages like listings, fancyvrb ...

Here an example with fancyvrb:




EDIT: Using listings:


share|improve this answer
Awesome!!! This is what I want. Thanks a lot – Jason Xu Jul 22 '11 at 13:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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