the package "listings" is currently causing me two problems.
The generated listing is too wide. That it stands out beyond
\textwidth
. I've found in the documentary listings unfortunately no setting options for the width. The\resizebox
commented out in the minimal example unfortunately causes some compile errors. I think it would be fine if the line numbering extends into the left edge, but the box should really be as wide as\textwidth
and not stick out in the edge.The listing has rounded corners as desired, but (when zooming in the PDF viewer and on the paper printout) the gray appears at the corners (as far as the corners are not rounded).
Here is my minimal example:
\documentclass{scrreprt}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{color}
\definecolor{listgray}{rgb}{0.88,0.88,0.88}
\begin{document}
%lstlisting Einstellungen
\lstset{
language=Matlab,
tabsize=2,
showspaces=false,
showstringspaces=false,
backgroundcolor=\color{listgray},
float=[htb],
captionpos=b,
basicstyle=\footnotesize,
frame=tbrl, %t: top, r, b, l
frameround=tttt,
numbers=left,
numberstyle=\tiny,
numberblanklines=false,
}
\rule{\textwidth}{1mm}
%\resizebox{\textwidth}{!}
{
\begin{lstlisting}[float,caption={Beschriftung},label=fig:matlab]
Var = A ./ B;
A = Var .* B;
\end{lstlisting}
}
\end{document}