Dear Herbert,
I tried your following codes in LyX:
I am using report as the document template:
\usepackage[breaklines]{listings}
\renewcommand\lstlistingname{Algorithmus}
\renewcommand\lstlistlistingname{Algorithmenverzeichnis}
\renewcommand\thelstlisting{\thesection.\arabic{lstlisting}}
\newcommand{\lst}[2]{
\noindent\rule[-1ex]{\columnwidth}{0.3mm}
\vspace{-1ex}
\lstinputlisting[caption={#2},label={#1},stringspaces=false,frame={tb},lineskip=-1pt,extendedchars=true,
basicstyle=\tt\footnotesize,labelstep=1,labelstyle=\tiny,indent=2em,language=Java,breaklines]{#1}
\vspace{1ex}
}
It works fine in the normal document. However, if I
import the source code with in a Enumrated
environment. It will have some error for the top and
button rule of the frame, Pleaes try:
1. point 1
\lst{mycode.file}{first code}
2. point 2
Where mycode.file is only:
#include
void main(void)
{
print("hello\n");
}
Could you please help me to fix this problem?
Thank you very much in advance! ^_^
Peter Chan
__
Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/online.html