history/display: backspace logic
[hwmod.git] / spec / ProtocolHeader.sty
1 \usepackage{fancyhdr}
2 \usepackage{graphicx}
3 \usepackage{epsfig}
4 \usepackage{color}
5 \usepackage{listings}
6 \usepackage{german}
7 \usepackage[T1]{fontenc}
8 %\usepackage[utf8]{inputenc}
9 \usepackage[latin1]{inputenc}
10 \usepackage{times}
11 \usepackage[plainpages=false, pdfpagelabels]{hyperref} %Klickbare Links im PDF
12 \usepackage{amssymb}
13 \usepackage{amsmath}
14 \usepackage{longtable,colortbl}
15 \usepackage{pdfpages}
16 \usepackage{pdflscape}
17 \usepackage{longtable}
18
19 \newcommand{\mytitle}{Spezifikation für das Design eines Taschenrechners in Hardware}
20 \hypersetup{%
21   colorlinks=true,
22   citecolor=black,
23   linkcolor=black,
24   %bookmarks=true,
25   bookmarksnumbered=true,
26   pdfauthor={Bernhard Urban, Alexander Oh},
27   pdfcreator={},
28   pdfkeywords={Taschenrechner VHDL Hardware},
29   urlcolor=black,
30   plainpages=false,
31   breaklinks=true,
32   pdftitle={\mytitle}
33 }
34
35 \lstset{ %
36         language=vhdl,                  % choose the language of the code
37         extendedchars=true,
38         basicstyle=\footnotesize,       % the size of the fonts that are used for the code
39 %       basicstyle=\scriptsize,         % the size of the fonts that are used for the code
40         numbers=left,                   % where to put the line-numbers
41         numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers
42         stepnumber=1,                   % the step between two line-numbers. If it's 1 each line will be numbered
43         firstnumber=auto,
44         numberfirstline=true,
45         numbersep=5pt,                  % how far the line-numbers are from the code
46         backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}
47         showspaces=false,               % show spaces adding particular underscores
48         showstringspaces=false,         % underline spaces within strings
49         showtabs=false,                 % show tabs within strings adding particular underscores
50 %       frame=single,                     % adds a frame around the code
51         frame={tb},
52         tabsize=2,                          % sets default tabsize to 2 spaces
53         caption=\lstname,
54 %       captionpos=b,                   % sets the caption-position to bottom
55         captionpos=t,                   % sets the caption-position to top
56         breaklines=true,                % sets automatic line breaking
57         breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
58         escapeinside={\%*}{*)},         % if you want to add a comment within your code
59         prebreak={\space\hbox{\ensuremath\hookleftarrow}}
60 }
61
62 \sloppy
63 \newcommand{\MakeTitleAndTOC}{
64         \begin{titlepage}
65         \setcounter{page}{0}
66   %-------------------------------------------------------------------------
67   % print title page
68   %-------------------------------------------------------------------------
69   \thispagestyle{empty}
70   ~ \\
71   ~ \\
72   \begin{center}
73   \noindent
74   {\LARGE Hardware-Modellierung VL}
75   ~ \\
76   ~ \\
77   {\Huge \bf \mytitle}
78   \end{center}
79   ~ \\
80   ~ \\
81   % Author
82   \begin{center}
83   \noindent
84   {\large Gruppe 20}
85   ~ \\
86   ~ \\
87   % passt die kennzahl eh??
88   {\large Alexander Oh, MatrNr. 0225258, KNZ: 066 938} \\
89   {\small e0225258@student.tuwien.ac.at} \\
90   ~ \\
91   {\large Bernhard Urban, MatrNr. 0725771, KNZ: 033 535} \\
92   {\small lewurm@gmail.com} \\
93   ~ \\
94   ~ \\
95   ~ \\
96   ~ \\
97   {\large \today}
98   \end{center}
99   
100   \end{titlepage}
101
102   \newpage
103
104   %-------------------------------------------------------------------------
105   % print table of contents
106   %-------------------------------------------------------------------------
107   \tableofcontents
108   \newpage
109
110 }
111
112
113
114 \newcommand{\mc}[1]{ {{\small \texttt{#1}}}}
115 %%footnote hack von http://bushednotes.wordpress.com/2007/03/25/footnotes-tabular-in-latex/
116 \newcounter{myfootertablecounter}
117
118 \newcommand\myfootnotemark{%
119         %\refstepcounter{footnote}%
120                 \addtocounter{footnote}{1}%
121                 \footnotemark[\thefootnote]%
122 }%
123
124 \newcommand\myfootnotetext[1]{%
125         \addtocounter{myfootertablecounter}{1}
126         \footnotetext[\value{myfootertablecounter}]{#1}
127 }
128
129 % from now on, myfootnote has to be used rather than footnote to
130 % adapt the myfootercounter
131 \newcommand\myfootnote[1]{%
132         \addtocounter{myfootertablecounter}{1}
133         \footnote{#1}
134 }%
135
136 \pagestyle{fancy}
137 \setlength{\headheight}{14.5pt}
138
139 \newcounter{reqcounter}
140 \setcounter{reqcounter}{0}
141 \newcommand{\req}[1]{
142         \noindent
143         \addtocounter{reqcounter}{1}
144         \textbf{Req \arabic{reqcounter}} #1\\
145         \label{Req \arabic{reqcounter}} %this could be done better with a second argument, but that's tiresome to write in the text
146 }
147
148 \newcounter{tccounter}
149 \setcounter{tccounter}{0}
150 \newcommand{\tcc}[1]{
151         \mbox{}\\[0.3cm]
152         \noindent
153         \addtocounter{tccounter}{1}
154         \textbf{TC \arabic{tccounter}}: #1\\
155         \label{TC \arabic{tccounter}} %this could be done better with a second argument, but that's tiresome to write in the text
156 }
157
158 \newcommand{\ZE}{\\}
159 %\newcommand{\ZE}{\\ %\hline}
160 \newcommand{\THEAD}{
161         \begin{center}
162         \begin{longtable}{|l|l|r|l|l|p{7.1cm}|}
163         \hline
164         \textbf{Bezeichnung} & \textbf{Richtung} & \textbf{Breite} &
165         \textbf{Typ} & \textbf{Modul} & \textbf{Beschreibung}
166         \ZE
167         \hline
168         sys\_clk & in & 1 & std\_logic & System & Systemclock \ZE
169         sys\_res\_n & in & 1 & std\_logic & System & Systemreset (low-aktiv) \ZE
170         \hline
171 }
172 \newcommand{\TEND}{
173         \hline
174         \end{longtable}
175         \end{center}
176 }