Muy buenas, quiero incluir un fichero de código de un programa que he hecho en java en una memoria escrita en latex. Quiero incluir el fichero y que latex mantenga la estructura, tabulado y hasta coloree las etiquetas. Sé que se puede hacer pero no he encontrado un tutorial que me ayude a hacerlo... ¿Me ayudais aqui?
Gracias
Comentarios
Para resolver esto debes
Para resolver esto debes usar el paquete (lo puedes descargar desde ctan.org)
listingsDebes incluir la linea
\usepackage{listings}y, cuando quieras diseñar el código puedes hacerlo:\begin{lstlisting}SELECT *
FROM table
\end{lstlisting}
\lstset{language=XML, basicstyle=\footnotesize, numbers=left, breaklines=true}\lstinputlisting{fichero.XML}
y tienes diferentes códigos para elegir... ABAP (R/2 4.3, R/2 5.0, R/3 3.1, R/3 4.6C, R/3 6.10), ACSL Ada (83, 95), Algol (60, 68), Ant, Assembler (x86masm), Awk (gnu, POSIX), bash, Basic (Visual), C (ANSI, Handel, Objective, Sharp), C++ (ANSI, GNU, ISO, Visual), Caml (light, Objective), Clean, Cobol (1974, 1985, ibm), Comal 80, csh, Delphi, Ei?el, Elan, erlang, Euphoria, Fortran (77, 90, 95), GCL, Gnuplot, Haskell, HTML, IDL (empty, CORBA), inform, Java (empty, AspectJ), JVMIS, ksh, Lisp (empty, Auto), Logo, make (empty, gnu), Mathematica (1.0, 3.0), Matlab, Mercury, MetaPost, Miranda, Mizar, ML, Modula-2, MuPAD, NASTRAN, Oberon-2, OCL (decorative, OMG), Octave, Oz, Pascal (Borland6, Standard, XSC), Perl,PHP, PL/I,Plasm, POV,Prolog, Promela,Python, R,Reduce, Rexx,RSL, Ruby, S (empty, PLUS), SAS, Scilab, sh, SHELXL, Simula (67, CII, DEC, IBM), SQL, tcl (empty, tk), TeX (AlLaTeX, common, LaTeX, plain, primitive), VBScript, Verilog, VHDL (empty, AMS), VRML (97), XML, XSLT.
Por cosas como esta me encanta latex
--
saludos
cyfuss
Enviar un comentario nuevo