6d1bb6d8962b0a55e159c11b9f8630922063b01a
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
1 \documentclass[12pt,letterpaper,twoside]{memoir} 
2 % for debugging, add 'draft' (without quotes) to the [] document class list.
3 % If draft is in the document class list, pix are just suggested
4 % by an outline, the pic does not appear as a picture.
5 %
6 \usepackage{url} % For color in letters. Links instead?
7 \usepackage{color} % For color in letters. Links instead?
8 \usepackage{ellipsis} % Provides ... as \dots
9 \usepackage{color}
10 \usepackage{listings}
11 \usepackage{alltt}
12 \lstset{ %
13 language={},               % choose the language of the code
14 basicstyle=\footnotesize,  % the size of the fonts that are used for the code
15 numbers=left,              % where to put the line-numbers
16 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
17 numberfirstline=true,
18 firstnumber=1,             % first line number in each listing
19 stepnumber=5,              % the step between two line-numbers. If it is 1 each line will be numbered
20 numbersep=10pt,            % how far the line-numbers are from the code
21 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
22 showspaces=false,          % show spaces adding particular underscores
23 showstringspaces=false,    % underline spaces within strings
24 showtabs=false,            % show tabs within strings adding particular underscores
25 frame=single,              % adds a frame around the code
26 tabsize=2,                 % sets default tabsize to 2 spaces
27 captionpos=b,              % sets the caption-position to bottom
28 breaklines=true,           % sets automatic line breaking
29 breakatwhitespace=false,   % sets if automatic breaks should only happen at whitespace
30 escapeinside={\%*}{*)}     % if you want to add a comment within your code
31 }
32
33 \usepackage{amsmath}       % Provides \nobreakdash
34 \usepackage{graphicx}      % For pictures
35 \usepackage{longtable}     % For multipage tables
36 \usepackage{varioref}      % defines \vref
37 % \textregistered is the trademark symbol
38 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
39 \setlength{\headheight}{15pt}  % avoids warning from latex
40 \usepackage{ifthen}        % For conditional processing
41 \usepackage{changepage}    % For odd/even page checks
42 \usepackage{epic}          % For eepic package 
43 \usepackage{eepic}         % For the diagram of section relationships
44 \usepackage{makeidx}       % For making an index
45 % hyperref must be the last package listed.
46 % The hyperref settings helps hypertext get right links in the 
47 % pdf of the index.
48 \usepackage[plainpages=false,pdfpagelabels,pagebackref]{hyperref} % Lets us generate colored active links inside a pdf.
49 \makeindex  % This and the makeidx package allow \index to create index entries.
50
51 \renewcommand{\familydefault}{phv}  % font family helvetica
52
53 \newcommand{\docdate}{31 January 2013}
54
55 \newcommand{\dwf}{DWARF Debugging Information Format}
56
57 \newenvironment{myindentpara}[1]%
58   {\begin{list}{}%
59     {\setlength{\leftmargin}{#1}}%
60     \item[]%
61   }
62   {\end{list}}
63
64 % broken somehow.
65 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
66
67 \hypersetup{colorlinks=true,
68   %bookmarks=true,
69   pdfauthor={\dwf\ Committee},
70   pdftitle={\dwf\ Version 4.1}
71 }
72
73 % An environment to create a listing-like (boxed) presentation for DWARF examples
74 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
75 % but does full LaTex processing within its scope (unlike \verb).
76 \newsavebox{\savedwf}
77 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
78   \begin{minipage}{\textwidth}\footnotesize}
79   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
80 % A helper to annotate the parts of a multipage figure
81 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
82
83 % Generate a page ref.
84 % use like   \refersec{chap:registerbasedaddressing}
85 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
86 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
87 \newcommand{\referfol}[1]{\ref{#1} following}
88
89 % Generate a live link in the document
90 % use like \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}
91 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
92 % use when the index is different from the text and target.
93 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
94 % livetarg is the declaration this is the target of livelinks.
95 % FIXME: we might want livetarg and livetargi  #2 to be \textbf{#2}
96 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
97 % When we want the index entry to look different from the name.
98 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
99
100 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
101
102 % The following two let us mark a word as 'do not link' or
103 % 'do not index' to indicate the word is used generically
104 % and has been considered so do not index or link it.
105 % There is no significant difference in the two commands, though
106 % \nolink would be more oriented to words such as flag or address
107 % that might be linked (and indexed) in some circumstances.
108 \newcommand{\nolink}[1]{#1}
109 \newcommand{\noindex}[1]{#1}
110
111 % For index entries.
112 \newcommand{\addtoindex}[1]{#1\index{#1}}
113 \newcommand{\addtoindexi}[2]{#1\index{#2}}
114 \newcommand{\addtoindexx}[1]{\index{#1}}
115
116 % Quote commands that avoid need for inline UTF-8 in these sources
117 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
118 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
119
120 % Better naming for the lowest level section header
121 \newcommand{\subsubsubsection}[1]{\paragraph{#1.}}
122
123 % Reduce vertical space at beginning of a list
124 \setlength{\topsep}{0in}
125
126 \newcommand{\emptypage}{
127     \clearpage
128     \vspace*{4in}
129     \begin{center} \textit{(empty page)} \end{center}
130     }
131
132 % A simple rule used in simple tables; default length is 2 inches
133 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
134
135 % A simple one column table of names; default width is 2 inches
136 \newcommand{\simplenametablerule}{\simplerule[2in]}
137 \newenvironment{simplenametable}[3][2in]
138     {   \begin{table}[here] \caption{#2} \label{#3}
139         \begin{center}
140         \renewcommand{\simplenametablerule}{\simplerule[#1]}
141         \simplenametablerule \\
142         \begin{tabular*}{#1}{l}
143         }
144     {   \end{tabular*}
145         \vspace{4pt} \\
146         \simplenametablerule \\
147         \end{center}
148         \end{table}
149         }
150
151 %--- Begin the document pages
152 %
153 \begin{document}
154 \frontmatter
155 \thispagestyle{empty}
156
157 \nonzeroparskip
158 \setlength{\parindent}{0pt} 
159 \setlength{\headheight}{6cm}
160 \setlength{\uppermargin}{6cm}
161
162 \begin{centering}
163 \LARGE
164 \textbf{\dwf}
165
166 \textbf{Version 4.1}
167
168 \centering
169 \includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
170
171 \centering
172 \vspace{3cm}
173 \href{http://www.dwarfstd.org}{\dwf\ Committee}
174
175 \vspace{2cm} 
176 \url{http://www.dwarfstd.org}
177
178 \large
179 \vspace{1in}
180 \textbf{\docdate}
181
182 \end{centering}
183
184 %\clearpage
185 \openany
186
187 \textmd
188 \normalsize
189 \setlength{\headheight}{15pt}  
190
191 \pagestyle{plain}
192 \makeevenhead{plain}{}{}{}
193 \makeoddhead{plain}{}{}{}
194 \makeevenfoot{plain}{}{}{}
195 \makeoddfoot{plain}{}{}{}
196
197 \nonzeroparskip
198 \setlength{\parindent}{0pt} 
199 \settrims{0.5in}{0.5in}
200 \settypeblocksize{8.2in}{6.0in}
201 %\setlrmarginsandblock{0.6in}{0.6in}{*}
202 %\setheadfoot{15pt}{15pt}
203 %\setheaderspaces {*}{2\onelineskip}{*}
204 \nouppercaseheads
205 \makeevenhead{plain}{}{\rightmark}{}
206 \makeoddhead{plain}{}{\rightmark}{}
207 \makeevenfoot{plain}{\docdate}{}{Page \thepage}
208 \makeoddfoot{plain}{\docdate}{}{Page \thepage}
209
210 %\openany
211
212 \nonzeroparskip
213 \setlength{\parindent}{0pt} 
214
215 \flushleft
216 \include{copyright}
217 \include{foreword}
218 \include{foreword4.1}
219 \emptypage
220
221 \cleardoublepage
222 \tableofcontents
223
224 \cleardoublepage
225 \listoffigures
226
227 \cleardoublepage
228 \listoftables
229
230 \flushleft
231 \chapterstyle{section}
232
233 \setlength{\parindent}{0pt} 
234
235 \makepagestyle{fragFirstChPage}
236     \makeevenhead{fragFirstChPage}{}{}{}
237     \makeoddhead{fragFirstChPage}{}{}{}
238     \makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
239     \makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
240 \nouppercaseheads
241 \aliaspagestyle{chapter}{fragFirstChPage}
242
243 % ----- Start the main part of the document -----
244 \mainmatter
245 % Define the levels of sectionality that are numbered.
246 \setcounter{secnumdepth}{5}
247 \include{introduction}
248 \include{generaldescription}            \emptypage
249 \include{programscope}                  \emptypage
250 \include{dataobject}                    \emptypage
251 \include{typeentries}                   \emptypage
252 \include{otherdebugginginformation}     \emptypage
253 \include{datarepresentation}
254 %  The \appendix toggles us into appendix chapters
255 \appendix
256 \include{attributesbytag}
257 \include{debugsectionrelationships}     \emptypage
258 \include{encodingdecoding}              \emptypage
259 \include{examples}                      \emptypage
260 \include{compression}                   \emptypage
261 \include{sectionversionnumbers}
262 \include{gnulicense}
263 \printindex
264 \end{document}