Alexander Dahl avatar Alexander Dahl committed a64bd82

settings for listings package and first fragile (!) frames with code listings

Comments (0)

Files changed (1)

-% $Id$
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Documentclass und Packages
+%%% documentclass and packages
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \RequirePackage{atbegshi}           % workaround for newer PGF versions
 \documentclass[hyperref={pdfpagelabels=false}]{beamer}
 \usepackage[utf8]{inputenc}
 \usepackage{textcomp}
 \usepackage[ngerman]{babel}		
-\usepackage[babel,english=american,german=guillemets]{csquotes}	% Französische
+\usepackage[babel,english=american,german=guillemets]{csquotes}	% french
 \usepackage{microtype}
-%\usepackage{listings}
-%\lstloadlanguages{HTML}
+
+% colors for listings
+\definecolor{lightergray}{gray}{.95}
+\definecolor{darkblue}{rgb}{0,0,0.5}
+\definecolor{darkgreen}{rgb}{0,0.5,0}
+\definecolor{darkred}{rgb}{0.5,0,0}
+\definecolor{darkerblue}{rgb}{0,0,0.4}
+\definecolor{darkergreen}{rgb}{0,0.4,0}
+\definecolor{darkerred}{rgb}{0.4,0,0}
+
+\usepackage{listings}
+\lstloadlanguages{HTML,XML}
+\lstset{
+    basicstyle=\ttfamily\small\mdseries,
+    keywordstyle=\bfseries\color{darkblue},
+    identifierstyle=,
+    commentstyle=\color{darkgray},
+    stringstyle=\itshape\color{darkred},
+    frame=none,
+    showstringspaces=false,
+    tabsize=4,
+    backgroundcolor=\color{lightergray},
+}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Vorbereitungen für beamer 
+%%% preparations for beamer 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \useinnertheme{default}
 \useoutertheme{infolines}
 \usefonttheme{structurebold}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Titel, Autor, Datum
+%%% title, author, date
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \title[Template Toolkit 2]{Schnell, statisch, sicher} 
 \subtitle{Template Toolkit 2 für Webseiten (und andere Späße)}
 \keywords{foo, bar}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Dokument
+%%% document
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{document} 
 
 
 \subsection{Hello World}
 
-\begin{frame}{Hello [\% world \%]!}
-    % [% INCLUDE header title="My first example" %]
-    % <html>
-    %
+\begin{frame}[fragile]
+    \frametitle{Hello [\% world \%]!}
+    \begin{lstlisting}[language=HTML]
+    [% INCLUDE header title="My first example" %]
+    <html>
+    \end{lstlisting} 
 \end{frame}
 
 \subsection{Syntax}
     \end{columns}
 \end{frame}
 
-\begin{frame}
-    \emph{add template code of one description file here}
+\begin{frame}[fragile]{Template für KDE}
+    \begin{lstlisting}[
+        language=XML,
+        basicstyle=\ttfamily\scriptsize\mdseries,
+        breaklines=true,
+    ]
+[% PROCESS smileys.tt2 %]
+<?xml version='1.0'?>
+<!-- Theme created with penguineering tools! - http://tools.penguineering.com/ -->
+<messaging-emoticon-map>
+[% FOREACH smiley IN smileys %]
+<emoticon file="[% smiley.basename %]">
+[% FOREACH alias IN smiley.aliases -%]
+    <string>[% FILTER replace('<','&lt;') %]
+[%- FILTER replace('>','&gt;') %]
+[%- FILTER replace('&','&amp;') %]
+[%- alias -%]
+[% END -%]
+[% END -%]
+[% END %]</string>
+[% END -%]
+</emoticon>
+[% END %]
+</messaging-emoticon-map>
+    \end{lstlisting}
 \end{frame}
 
 \section*{Solang die dicke Frau noch singt \dots}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.