I'm using listings to show some source code (bash scripts) in my document but there is a problem, when using mono spaced fonts, the space between dashes is very small and in the printed document two or more contiguous dashes seems as a continuous line.

The courier font hasn't this problem, but I would like to use Bera Mono or DejaVu Sans Mono.

Is there a way to avoid this situation?

EDIT: This is the code that reproduces the problem, I am using pdflatex.

} { }

    diff --version | head -n1
    find --version | head -n1
    gawk --version | head -n1

Sample output

I like Herbert's solution but I added the code only to clarify how this problem happen.

  • Do you change the font, or do you use listings, verbatim or even alltt? As far as I know, none of the latter have this issue.
    – Raphael
    Commented Oct 23, 2013 at 6:13
  • Which TeX format are you using -- pdfLaTeX, XeLaTeX, or LuaLaTeX? If you use the fontspec package, have you enabled the option Ligatures=TeX option for monospaced fonts? Please advise.
    – Mico
    Commented Oct 23, 2013 at 7:10
  • I'm using pdflatex. The problem is when I use listings.
    – rendon
    Commented Oct 23, 2013 at 13:34

1 Answer 1


I cannot see it:

%\usepackage{fontspec}%% when running xelatex or lualatex
%\setmonofont{DejaVu Sans Mono}


enter image description here

  • Great! I suppose that my problem is in the form I specify the font.
    – rendon
    Commented Oct 23, 2013 at 13:52

You must log in to answer this question.

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