分类: LINUX
2011-04-12 14:52:52
排版源代码,
\lstset{language=C,caption= C code,label=ccode} \begin{lstlisting} for (i=0; i!=n; i++) stat[i]= i; \end{lstlisting}如果源代码很长,可以放在额外的文档中,然后导入
\lstinputlisting{source_filename.c}ABAP | IDL | Plasm | ACSL | inform | POV | Ada | Java | Prolog |
Algol | JVMIS | Promela | Ant | ksh | Python | Assembler | Lisp | R |
Awk | Logo | Reduce | bash | make | Rexx | Basic | Mathematica | RSL |
C | Matlab | Ruby | C++ | Mercury | S | Caml | MetaPost | SAS |
Clean | Miranda | Scilab | Cobol | Mizar | sh | Comal | ML | SHELXL |
csh | Modula-2 | Simula | Delphi | MuPAD | SQL | Eiffel | NASTRAN | tcl |
Elan | Oberon-2 | TeX | erlang | OCL | VBScript | Euphoria | Octave | Verilog |
Fortran | Oz | VHDL | GCL | Pascal | VRML | Gnuplot | Perl | XML |
Haskell | PHP | XSLT | HTML | PL/I | | | |
|
listings 宏包提供一系列的可定制参数,
\lstset{ %