source: SMC4LRT/utils.tex

Last change on this file was 3681, checked in by vronk, 11 years ago
File size: 4.1 KB
Line 
1%%%%%%%%%%%%%%%
2% utils / commands
3
4
5\usepackage{graphicx} % support the \includegraphics command and options
6
7\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
8%\usepackage[T1]{fontenc}
9
10\usepackage{color}
11
12\usepackage{pgf}                                       
13\usepackage{tikz}                                       % tikz graphics
14\usetikzlibrary{arrows,automata}
15
16\usepackage{epstopdf}
17
18\usepackage{float}
19\usepackage{framed}
20\usepackage{amsmath}
21\usepackage{tabularx}
22\usepackage{tabu}
23\usepackage{pdflscape} 
24
25\usepackage[singlelinecheck=off]{caption}
26
27%%% PACKAGES
28\usepackage{booktabs} % for much better looking tables
29\usepackage{array} % for better arrays (eg matrices) in maths
30\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
31\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
32%\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
33% These packages are all incorporated in the memoir class to one degree or another...
34
35
36
37 % disable
38\usepackage[textsize=footnotesize, textwidth=1in, colorinlistoftodos=1,                 bordercolor=todoborder, linecolor=todoborder, backgroundcolor=todobg]{todonotes}
39
40\newcommand{\todoin}[1]{\todo[inline]{#1}}
41\newcommand{\todocite}[1]{\todo[inline,backgroundcolor=cite]{#1}}
42\newcommand{\todoask}[1]{\todo[inline,backgroundcolor=ask]{#1}}
43\newcommand{\todocode}[1]{\todo[inline,backgroundcolor=code]{#1}} % anything that runs: installing, implementing, data transform
44\newcommand{\concept}[1]{\textsf{#1}}
45\newcommand{\code}[1]{\texttt{#1}}
46\newcommand{\var}[1]{\textrm{\textit{#1}}}
47\newcommand{\xne}[1]{\textsf{#1}}  % named entity (?)
48\newcommand{\furl}[1]{\footnote{\url{#1}}}
49\newcommand{\ftodo}[1]{\footnote{\todoin{#1}}}
50
51\newenvironment{note}
52{\footnotesize \color{grey} \begin{textit}}
53{ \end{textit} \normalsize}
54
55\floatstyle{plain}
56\newfloat{definitionx}{htp}{lod}[chapter]
57\floatname{definitionx}{Definition}
58
59
60\DeclareCaptionType{defcap}[Definition][List of definitions]
61\captionsetup[defcap]{labelformat=simple}
62
63\newenvironment{definition}[1]
64{\begin{defcap}[!ht]\caption{#1}\equation\notag}
65% \begin{definitionx}
66{\endequation\end{defcap}}
67% \end{definitionx}
68
69
70% environments for examples
71% with different number of columns (1,2,3)
72
73% \vspace{0.5\baselineskip}
74\newenvironment{example1}
75{
76 \begin{ttfamily}\footnotesize \begin{shaded*} \noindent
77\begin{tabular}{l}   }
78{ \end{tabular} \end{shaded*} \end{ttfamily}  }
79
80
81%@{\hspace{-2mm}}
82\newenvironment{example2}
83{ \footnotesize
84\begin{ttfamily} \begin{shaded*} \noindent
85 \begin{tabular}{p{0.4\textwidth}  p{0.6\textwidth} } }
86{\end{tabular} \end{shaded*} \end{ttfamily} }
87
88
89\newenvironment{example3}
90{ \footnotesize
91 \begin{ttfamily} \begin{shaded*} \noindent
92 \begin{tabular}{@{\hspace{-1mm}} p{0.25\textwidth}  p{0.25\textwidth}  p{0.45\textwidth}} 
93}
94{  \end{tabular} \end{shaded*} \end{ttfamily} }
95
96% xml syntax highlighting
97% source http://snipt.org/vngf3
98\usepackage{listings}
99 
100\definecolor{grey}{rgb}{0.4,0.4,0.4}
101\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
102\definecolor{cyan}{rgb}{0.0,0.6,0.6}
103
104\definecolor{todobg}{rgb}{0.8,0.8,1}
105\definecolor{cite}{rgb}{0.8,1,0.8}
106\definecolor{ask}{rgb}{1,1,0.8}
107\definecolor{code}{rgb}{1,0.8,0.8}
108\definecolor{todoborder}{rgb}{0.8,0.4,0.4}
109\definecolor{shadecolor}{rgb}{0.9,0.9,1.0}
110
111 
112\lstset{
113  basicstyle=\ttfamily\footnotesize,
114  columns=fullflexible,
115  showstringspaces=false,
116  commentstyle=\color{grey}\upshape
117}
118 
119\lstdefinelanguage{XML}
120{
121  basicstyle=\ttfamily\color{darkblue}\bfseries\footnotesize,
122  morestring=[b]",
123  morestring=[s]{>}{<},
124  morecomment=[s]{<?}{?>},
125  stringstyle=\color{black},
126  identifierstyle=\color{darkblue},
127  keywordstyle=\color{cyan},
128  morekeywords={xmlns,version,type}% list your attributes here
129}
130
131
132%%% Fallback definitions for Docutils-specific commands
133
134% legend environment
135\ifthenelse{\isundefined{\DUlegend}}{
136  \newenvironment{DUlegend}{\small}{}
137}{}
138
139% titlereference role
140\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
Note: See TracBrowser for help on using the repository browser.