\usepackage[font=normalsize,format=plain,labelfont={bf,normalsize},textfont={it,normalsize}]{caption} \definecolor{lightgray}{gray}{0.9} \usepackage{listings} \usepackage{courier} \definecolor{gray}{rgb}{0.4,0.4,0.4} \definecolor{darkblue}{rgb}{0.0,0.0,0.6} \definecolor{cyan}{rgb}{0.0,0.6,0.6} \lstset{ basicstyle=\footnotesize\ttfamily, % Standardschrift %numbers=left, % Ort der Zeilennummern numberstyle=\tiny, % Stil der Zeilennummern %stepnumber=2, % Abstand zwischen den Zeilennummern numbersep=5pt, % Abstand der Nummern zum Text tabsize=2, % Groesse von Tabs extendedchars=true, % breaklines=true, % Zeilen werden Umgebrochen keywordstyle=\color{red}, frame=b, % keywordstyle=[1]\textbf, % Stil der Keywords % keywordstyle=[2]\textbf, % % keywordstyle=[3]\textbf, % % keywordstyle=[4]\textbf, \sqrt{\sqrt{}} % stringstyle=\color{white}\ttfamily, % Farbe der String showspaces=false, % Leerzeichen anzeigen ? showtabs=false, % Tabs anzeigen ? xleftmargin=17pt, framexleftmargin=17pt, framexrightmargin=5pt, framexbottommargin=4pt, %backgroundcolor=\color{lightgray}, showstringspaces=false % Leerzeichen in Strings anzeigen ? } \lstdefinelanguage{XML} { morestring=[b]", morestring=[s]{>}{<}, morecomment=[s]{}, stringstyle=\color{black}, identifierstyle=\color{darkblue}, keywordstyle=\color{cyan}, morekeywords={xmlns,version,type}% list your attributes here } \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}} \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
Using in LaTeX code :
\lstinputlisting[label=soaplocationresponse,language=XML,caption=Odpowiedź Location SOAP API]{locationsoapresponse.xml}
Result :
LaTeX XML listing |
Reference :
[1] Listing XML GarciaPL Pastebin.com
[2] Using XML listing Pastebin.com
LaTeX listing XML
2012-09-03T19:31:00+01:00
GarciaPL
LaTeX|