[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [DOK] kodeeksempel i latex



Claus Christensen wrote:
Hej

Hvordan viser jeg bedst kodeeksempler i LaTeX?, hvordan gør i?
Indtil videre har jeg brugt \quote

benyt evt. listings


http://www.atscire.de/products/listings/

http://www.ctan.org/tex-archive/macros/latex/contrib/supported/listings/

Det virker ganske godt.

eks.

usepackage{listings}

\begin{lstlisting}[language=SQL,xleftmargin=2cm]
CREATE TABLE studerende (
   cpr number(10) primary key,
   navn varchar(50)
);
\end{lstlisting}

Listings kender mange andre sprog og du kan stille på en lang række parametre, f.eks. farver etc.

Du kan også inkludere en hel fil

\lstinputlisting[language=C,escapechar={},numbers=left,stepnumber=5]
{STI TIL KODE FIL}

/jens



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 18:57 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *