helpListings package for LaTeX - Support: sr #307, newenvironment listings

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

sr #307: newenvironment listings

Submitted by:  Brooks Moses <brooks>
Submitted on:  Wed Apr 13 05:07:12 2011  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: None

Wed Apr 13 05:07:12 2011, original submission:

Marco Daniel wrote, on Thu, 26 Feb 2009 14:58:24 +0100:


Hello Mr. Moses,

you are my last chance. I have a problem with newenvironment and the listing package.
When I use the following example, I get no errors:
=================
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor,framed}
\newenvironment{ListRahm}{%
\def\FrameCommand{\FrameSep=4pt\fcolorbox{black}{yellow}}%
\MakeFramed {\advance\hsize-\width\FrameRestore}}%
{\endMakeFramed}
\begin{document}

\lstset{language=Pascal}
\begin{ListRahm}
\begin{lstlisting}[mathescape]
for i:=maxint to 0 do
begin
$\sum\limits_{j=1}^ni^2+j$
end;
\end{lstlisting}
\end{ListRahm}
\end{document}
==============================================

Now I want to create my own environment FramedListing. But I get many errors:
============================
\newenvironment{ListRahm}[1][]{%
\def\FrameCommand{\FrameSep=4pt\fcolorbox{black}{yellow}}%
\MakeFramed {\advance\hsize-\width\FrameRestore}\begin{listings}[#1]}%
{\end{listings}\endMakeFramed}
============================

I hope you can help me.

regards
Marco

PS: Sorry for the bad english. I am learning.

Brooks Moses <brooks>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by brooks (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray