customize.tex 3.56 KB
Newer Older
Michael Schmid committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175

% ===================================
%  document formatting refinement
% ===================================

% No indents for whole text
\setlength{\parindent}{0pt}

% improve the line breaking 
\setlength{\emergencystretch}{1em}

% pic width = \textwidth - \chapterpicwidth
\def\chapterpicwidth{0.43}

% line breaks for URLs
\renewcommand{\UrlBreaks}{\do\/}


%
% custom hyphenation
%
\hyphenation{in-stru-men-ta-tion analy-sis con-cur-ren-cy}


% ===================================
%  settings for the listings package
% ===================================

\definecolor{lightGray}{RGB}{242,242,242}
\lstset{
  language=C++,
  basicstyle=\ttfamily,
  columns=fullflexible,
  keepspaces=true, % To have spaces monsized
  tabsize=2,
  frame=none, % = single
  breaklines=true,
  numbers=left,
  numberstyle=\tiny,
  escapeinside={//@}{@},
  showstringspaces=false,
  resetmargins=true,
  xleftmargin=18pt,
  xrightmargin=0pt,
  %resetmargins=true,
  %framextopmargin=0pt
  backgroundcolor=\color{lightGray},
  captionpos=b,
  %abovecaptionskip=0pt,
  %belowcaptionskip=0pt,
  %aboveskip=3pt,
  %belowskip=0pt,
  %framesep=1pt,
  numberbychapter=false,
}

% coloring for listings
\lstdefinestyle{colored}{
  moredelim=[is][\color{blue}]{@}{@},
  moredelim=[is][\color{red}]{|}{|},
}

% 
% Counter and caption for listings
%

%\newcounter{lstlisting}  % already defined by pkg listing at \begin{document}
\counterwithout{lstlisting}{chapter}

\newcommand{\inputlisting}[1]{  
  \begin{minipage}{\columnwidth}
  \lstinputlisting{#1}
  \end{minipage}
}

\newcommand{\lstgname}{Listing}
\newcommand{\listingcaption}[1]% 
{%
  {%
    \refstepcounter{lstlisting}
    \noindent\footnotesize{\lstgname~\thelstlisting{:}~#1\hfill}
  }%
}%



% ===========================
%  cover generation commands
% ===========================

\def\backcover{
\genbackpage{
  \textbf{Siemens AG}\newline
  Corporate Technology\newline
  Multicore Expert Center\newline
  \newline
  Otto-Hahn-Ring 6\newline
  81739 Muenchen\newline
  Germany\newline
  \newline
  {http://multicore.ct.siemens.de}
  }
}
% ======================
%  convenience commands
% ======================

\def\chaptername{Chapter}
\def\algname{Algorithm}
\def\sectionname{Section}

%
% Programming languages and frameworks
%

\def\qt{Qt}
\def\cE{C11}
\def\cpp{C\raisebox{0.17ex}{\small\textbf{++}}}
\def\cppFootnote{C\raisebox{0.08ex}{\small{++}}}
\def\cppE{{\cpp}11}
\newcommand{\csharp}{%
  {\settoheight{\dimen0}{C}C\kern-.05em\hspace{0.5pt}\resizebox{!}{\dimen0}{\raisebox{\depth}{\#}}}}
\def\dotnet{.NET}

%
% Special characters
%
\def\myCheck{\ding{51}} % check
\def\myCross{\ding{55}} % cross


%
% Various stuff
%
\def\time#1{#1}

\def\markup#1{{\color{NavyBlue}#1}}

\newcommand{\toolcard}[9]{
  \begin{table}
    \caption{Quick card for {#2}}
    {\small
      \begin{tabular}{>{\bfseries}p{0.295\columnwidth}p{0.605\columnwidth}}
        \thickhline 
        {Tool} & #2 \\
        {Detectable bugs} & #3 \\
        {License} & #4 \\
        {Platforms} & #5 \\
        {Operating systems} & #6 \\
        {\mbox{Languages}} & #7 \\
        {Threading libraries} & {#8} \\
        {Additional facts} & {#9} \\
        \thickhline
      \end{tabular}
    }
    \label{qc:#1}
  \end{table}
}

% table cell that allows line breaks (e.g., for toolcard)
%   first (optional) parameter defines alignment (l,c,r)
%   second parameter is the content
\def\lbcell[#1]#2{\rule{0pt}{4ex}\shortstack[#1]{#2}}


% =======================
%  other (various) stuff
% =======================

%
% very custom stuff
%
\def\hb#1{\hbImpl(#1)}
\def\hbRel{\rightarrow}
\def\hbImpl(#1,#2){$#1 \hbRel #2$}