\documentclass[12pt]{article}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
\texttt{int main(void)} is rendered tighter than in the listing.
What lstlisting option would need changing?
\begin{lstlisting}[numbers=left,language=c,showtabs=true]
int main(void)
{
printf("Hi world\n");
}
\end{lstlisting}
\end{document}
Tell me more
×
TeX - LaTeX Stack Exchange is a question and answer site for
users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
|
|
|||
|
This is controlled by the To make the inline code match your example listing, use:
To make the listing match the inline code, use:
If you want both to be the same, use the same |
|||
|
|
\lstinline!int main(void)!instead of\texttt. Have a look at the listings manual. It talks about fixed width text. – TH. Jan 10 '11 at 0:35