Pregunta

Formulario este taller de látex , encontré que podría hacer este estilo de listado.

http://img441.imageshack.us/img441/2739/screenshot2010077at112.png

definiendo un nuevo entorno.

\definecolor{mittelgrau}{gray}{0.85}%
\lstdefinestyle{StyleCommand}{%
style=StyleListingBasic, backgroundcolor=\color{mittelgrau}, prebreak=\mbox{\textbackslash{}}%
} 
\lstnewenvironment{bevel}[1][1] {\lstset{style=StyleCommand,linewidth=#1\linewidth}} {}%

Ejecutar el código, recibo este mensaje de error.

ERROR: Package Listings Error: Couldn't load requested style.

¿Qué podría estar equivocado?

¿Fue útil?

Solución

Me perdí el estilo \ lstdefinestyle, y después de alguna modificación, podría hacerlo funcionar.

\documentclass{article}

\usepackage{color}              % Farben
\usepackage{listings}           % für Listings

% Listingdefinitionen
\lstdefinestyle{StyleListingBasic}{%
     basicstyle=\ttfamily,       % Schriftstil
     frame=single,               % einfacher Rahmen
     framesep=1pt,               % Abstand des Rahmens
     framerule=0.8pt,            % Linienstaerke des Rahmens
     rulecolor=\color{mittelgrau},  % Farbe der Rahmenlinie
     breaklines=true,            % automatischen Umbruch aktivieren
     breakindent=0pt             % Einrueckung nach Umbruch
}

\definecolor{mittelgrau}{gray}{0.85}%
\lstdefinestyle{StyleCommand}{%
style=StyleListingBasic, backgroundcolor=\color{mittelgrau}, prebreak=\mbox{\textbackslash{}}%
} 
\lstnewenvironment{Befehl}[1][1] {\lstset{style=StyleCommand,linewidth=#1\linewidth}} {}%

\begin{document}
\begin{Befehl} 
./robots-gui-helper 
\end{Befehl}%

\end{document}

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top