# How to make letter spacing in verbatim/fancyvrb look like listings

I've just noticed that the spacing between letters is different in verbatim vs. lstlisting environments:

Given that I add the option columns=flexible to the lstlisting environment, the spacing in this environment looks similar to the one in the verbatim environment. Is it possible to do the reverse, i.e. to make the text in the verbatim environment look like the text in the lstlisting environment (possibly using the fancyvrb package)?

Below is the sample code I used:

\documentclass{article}
\usepackage{verbatim}
\usepackage{listings}

\begin{document}

\begin{lstlisting}[basicstyle=\ttfamily]
Dummy code
\end{lstlisting}

\begin{verbatim}
Dummy code
\end{verbatim}

\end{document}

-

That's one of the features of listings I like the less: letterspacing lowercase text is a capital sin. However, here's how you can do it (don't tell Frederic Goudy, please).

\documentclass{article}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{microtype}
\makeatletter
\makeatother

\begin{document}

\begin{lstlisting}[basicstyle=\ttfamily]
Dummy code
\end{lstlisting}

\begin{verbatim}
Dummy code
\end{verbatim}

\end{document}


The small difference is due to the fact that letterspacing is applied only between letters. You may have also to increase the interword spacing.

-