listings format problem

2005-06-12 Thread funny guy
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


listings format

2005-06-06 Thread funny guy
Dear all,

I am trying to use the package listings.sty in LyX. 

1. In the example document listings.dvi, the format of
a floating listing is very nice (page 6 in
listings-1.3.pdf). It has two lines that encapsulates
the codes that are inserted. However, I cannot get
these two lines. Can anyone tell me how to do that in
LyX ?


2. Moreover, how to put another line above the
caption?
like this:


  Listing 1: My codes

line 1 of codes
line 2 of codes
...


3. How to change the fonts of the inserted codes?

Thanks for your help in advance! ^_^

Peter Chan






__ 
Discover Yahoo! 
Find restaurants, movies, travel and more fun for the weekend. Check it out! 
http://discover.yahoo.com/weekend.html