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.

  • please edit your question and add a working minimal example. Jul 21, 2011 at 21:10
  • 1
    See this link first. listings package is very helpful to handle code inclusion. You should use it. Jul 21, 2011 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, 2011 at 20:10

1 Answer 1


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:


  • Awesome!!! This is what I want. Thanks a lot
    – Jason Xu
    Jul 22, 2011 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .