Created
November 6, 2014 11:06
-
-
Save white-gecko/6646712d5a967096764e to your computer and use it in GitHub Desktop.
LaTeX package for a cooler listing appearance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% This package fixes some issues with listings | |
% - Set a nice font | |
% - Add Turtle as langugage | |
% - Imprive XML style | |
% - Fix dashs/hyphens | |
% | |
% (c) 2013 Natanael Arndt | |
% LPPL LaTeX Public Project License | |
% | |
\NeedsTeXFormat{LaTeX2e}[1994/06/01] | |
\ProvidesPackage{listingshack} | |
[2013/05/08 v0.01 LaTeX package for a cooler listing appearance] | |
\RequirePackage{listings} | |
\RequirePackage{color} | |
\RequirePackage{scrhack} % Um Probleme mit listings/float und KOMA script zu beheben | |
% Fix dashs/hyphens | |
\makeatletter | |
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}} | |
\@empty\z@\@empty | |
\makeatother | |
\newfontfamily\listingsfont[Scale=.7]{DejaVu Sans Mono} % LMMono10, DejaVu Sans Mono, Droid Sans Mono, Source Code Pro | |
\newfontfamily\listingsfontinline[Scale=.8]{DejaVu Sans Mono} | |
\lstset{ | |
basicstyle=\listingsfont, | |
inputencoding=utf8, | |
extendedchars=\true | |
} | |
\definecolor{olivegreen}{rgb}{0.2,0.8,0.5} | |
\definecolor{darkgray}{rgb}{0.3,0.3,0.3} | |
\definecolor{gray}{rgb}{0.4,0.4,0.4} | |
\lstdefinelanguage{ttl}{ | |
sensitive=true, | |
morecomment=[l][\color{gray}]{@}, | |
morecomment=[l][\color{darkgray}]{\#\ }, | |
morestring=[b][\color{darkgray}]\", | |
} | |
\endinput | |
%% | |
%% End of file `listingshack.sty'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment