PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : listing, newenvironment und gestrichelte rahmen



Tenacity
28-02-2008, 13:18
Ich finde die Code-Umgebung die auf http://en.wikibooks.org/wiki/LaTeX/Packages/Listings
verwendet wird super geil und würde die gerne Nachbauen.

Im Prinzip liefert das Minimalbeispiel das ja schon:

\documentclass{article}

\usepackage{listings}
\lstset{ %
language=Tex, % choose the language of the code
basicstyle=\footnotesize, % the size of the fonts that are used for the code
showstringspaces=false, % underline spaces within strings
numbers=none, % where to put the line-numbers
numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
stepnumber=2, % the step between two line-numbers. If it's 1 each line will be numbered
numbersep=5pt, % how far the line-numbers are from the code
%backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces within strings adding particular underscores
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
%rulecolor=\color{blue},
xleftmargin=\fboxsep,
xrightmargin=\fboxsep,
rulesep=5pt,
tabsize=2, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
escapeinside={\%*}{*)} % if you want to add a comment within your code
}


\begin{document}

\begin{center}
\begin{minipage}{.7\textwidth}
\begin{lstlisting}
\begin{figure}[htbp]
\centering
\includegraphics[scale=0.95]{}
\caption{Caption}
\label{Label}
\end{figure}
\end{lstlisting}
\end{minipage}
\end{center}
\end{document}


Mein Problem ist jetzt nur


Wie bekomme ich gestrichelte Rahmen, das listings-package unterstützt das nicht.
wie kann ich aus der center-minipage-listing umgebung eine eine eigene Umgebung machen. Habe schon ein wenig mit \newenvrionment rumgespielt, aber so wie in dem Beispiel bekommen ich das nicht hin.


Ansatz für die Newenvironment ist


\newenvironment{code}
{}
{}

Danke für Hilfe