38542845e9018aa0b5a953014531c0eff4fb098e
[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 Lewurm, Fabian Ehrentraud}, TODO unanonymize
27   pdfcreator={},
28   pdfkeywords={lulz a wannabe hax0r :D search for a real hint fagot},
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   %{\large Fabian Ehrentraud, MatrNr. 0725639, KNZ: 033 535}\\ TODO unanonymize
88   {\large Mister X}\\
89   %{\small werteplus@gmail.com} \\
90   ~ \\
91   %{\large Bernhard Urban, MatrNr. 0725771, KNZ: 033 535} \\ TODO unanonymize
92   {\large Mister Y} \\
93   %{\small lewurm@gmail.com} \\
94   ~ \\
95   ~ \\
96   ~ \\
97   ~ \\
98   {\large \today}
99   \end{center}
100   
101   \end{titlepage}
102
103   \newpage
104
105   %-------------------------------------------------------------------------
106   % print table of contents
107   %-------------------------------------------------------------------------
108   \tableofcontents
109   \newpage
110
111 }
112
113
114
115 \newcommand{\mc}[1]{ {{\small \texttt{#1}}}}
116 %%footnote hack von http://bushednotes.wordpress.com/2007/03/25/footnotes-tabular-in-latex/
117 \newcounter{myfootertablecounter}
118
119 \newcommand\myfootnotemark{%
120         %\refstepcounter{footnote}%
121                 \addtocounter{footnote}{1}%
122                 \footnotemark[\thefootnote]%
123 }%
124
125 \newcommand\myfootnotetext[1]{%
126         \addtocounter{myfootertablecounter}{1}
127         \footnotetext[\value{myfootertablecounter}]{#1}
128 }
129
130 % from now on, myfootnote has to be used rather than footnote to
131 % adapt the myfootercounter
132 \newcommand\myfootnote[1]{%
133         \addtocounter{myfootertablecounter}{1}
134         \footnote{#1}
135 }%
136
137 \pagestyle{fancy}
138 \setlength{\headheight}{14.5pt}
139
140 \newcounter{reqcounter}
141 \setcounter{reqcounter}{0}
142 \newcommand{\req}[1]{
143         \noindent
144         \addtocounter{reqcounter}{1}
145         \textbf{Req \arabic{reqcounter}} #1\\
146         \label{Req \arabic{reqcounter}} %this could be done better with a second argument, but that's tiresome to write in the text
147 }
148
149 \newcounter{tccounter}
150 \setcounter{tccounter}{0}
151 \newcommand{\tcc}[1]{
152         \mbox{}\\[0.3cm]
153         \noindent
154         \addtocounter{tccounter}{1}
155         \textbf{TC \arabic{tccounter}}: #1\\
156         \label{TC \arabic{tccounter}} %this could be done better with a second argument, but that's tiresome to write in the text
157 }
158
159 \newcommand{\ZE}{\\ \hline}
160 \newcommand{\THEAD}{
161         \begin{center}
162         \begin{longtable}{|l|l|r|l|l|p{6cm}|}
163         \hline
164         \textbf{Bezeichnung} & \textbf{Direction} & \textbf{Breite} &
165         \textbf{Typ} & \textbf{in Verbindung mit} & \textbf{Beschreibung}
166         \ZE
167         sys\_clk & in & 1 & std\_logic & System & Systemclock \ZE
168         sys\_res\_n & in & 1 & std\_logic & System & Systemreset \ZE
169 }
170 \newcommand{\TEND}{
171         \end{longtable}
172         \end{center}
173 }