1

My MWE

$ cat test1.tex
\documentclass{article}
%usepackage{savetrees}
\begin{document}
\begin{verbatim}
for i in range(3):
    for j in range(3):
        for k in range (3):
            plot(i,j,k) # aaaaaaaaaaaaaaa
            plot(j,k,i) #               b
\end{verbatim}
\end{document}
$ diff test1.tex test2.tex 
2c2
< %usepackage{savetrees}
---
> \usepackage{savetrees}
$ 

Running pdflatex test1 produces

enter image description here

while pdflatex test2 produces

enter image description here

It looks like spaces are not the same width as fixed width characters...

Is it possible to fix this problem?

  • hmm. I can't reproduce this. The margins are smaller with savetrees. But the verbatim text looks the same. – David Purton Mar 17 at 8:45
  • Make sure your distribution is all up to date. – David Purton Mar 17 at 8:46
  • Ohhhh! Are you compiling with xelatex by any chance? I do see the difference with xelatex. (pdflatex and lualatex are fine.) – David Purton Mar 17 at 8:47
  • I have compiled with pdflatex, with lualatex and with xelatex as well and because I've got same misfit with all the engines I've decided to post only the pdflatex runs. Re the up-to-date-ness, I run Debian unstable and the package version is 2018.20190227-2 – gboffi Mar 17 at 8:52
  • hmmm. I don't know then if you get problems with all engines. I run Debian testing and I'm at version 2018.20190131-1. An immediate workaround might be to use \usepackage[wordspacing=normal]{savetrees} – David Purton Mar 17 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.