fa5f76e617a30f5f9e1056f211f8cd46623b5330
[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 \newcommand{\docdate}{28 January 2013}
52
53 \newcommand{\dwf}{DWARF Debugging Information Format}
54 \newenvironment{myindentpara}[1]%
55  {\begin{list}{}%
56    {\setlength{\leftmargin}{#1}}%
57    \item[]%
58  }
59  {\end{list}}
60
61 % broken somehow.
62 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
63
64 \hypersetup{colorlinks=true,
65   %bookmarks=true,
66   pdfauthor={\dwf\ Committee},
67   pdftitle={\dwf\ Version 4.1}
68 }
69
70 % An environment to create a listing-like (boxed) presentation for DWARF examples
71 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
72 % but does full LaTex processing within its scope (unlike \verb).
73 \newsavebox{\savedwf}
74 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
75   \begin{minipage}{\textwidth}\footnotesize}
76   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
77 % A helper to annotate the parts of a multipage figure
78 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
79
80 % Generate a page ref.
81 % use like   \refersec{chap:registerbasedaddressing}
82 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
83 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
84 \newcommand{\referfol}[1]{\ref{#1} following}
85
86 % Generate a live link in the document
87 % use like \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}
88 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
89 % use when the index is different from the text and target.
90 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
91 % livetarg is the declaration this is the target of livelinks.
92 % FIXME: we might want livetarg and livetargi  #2 to be \textbf{#2}
93 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
94 % When we want the index entry to look different from the name.
95 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
96
97 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
98
99 % The following two let us mark a word as 'do not link' or
100 % 'do not index' to indicate the word is used generically
101 % and has been considered so do not index or link it.
102 % There is no significant difference in the two commands, though
103 % \nolink would be more oriented to words such as flag or address
104 % that might be linked (and indexed) in some circumstances.
105 \newcommand{\nolink}[1]{#1}
106 \newcommand{\noindex}[1]{#1}
107
108 % For index entries.
109 \newcommand{\addtoindex}[1]{#1\index{#1}}
110 \newcommand{\addtoindexi}[2]{#1\index{#2}}
111 \newcommand{\addtoindexx}[1]{\index{#1}}
112
113 % Quote commands that avoid need for inline UTF-8 in these sources
114 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
115 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
116
117 % Better naming for the lowest level section header
118 \newcommand{\subsubsubsection}[1]{\paragraph{#1}}
119
120 % Reduce vertical space at beginning of a list
121 \setlength{\topsep}{0in}
122
123 \newcommand{\emptypage}{
124     \clearpage
125     \vspace*{4in}
126     \begin{center} \textit{(empty page)} \end{center}
127     }
128
129 % A simple rule used in simple tables; default length is 2 inches
130 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{1pt}}
131
132 % A simple one column table of names; default width is 2 inches
133 \newcommand{\simplenametablerule}{\simplerule[2in]}
134 \newenvironment{simplenametable}[3][2in]
135     {   \begin{table}[H] \caption{#2} \label{#3}
136         \begin{center}
137         \renewcommand{\simplenametablerule}{\simplerule[#1]}
138         \simplenametablerule \\
139         \textbf{Name} \\
140         \simplenametablerule \\
141         }
142     {   \simplenametablerule \\
143         \end{center}
144         \end{table}
145         }
146
147 %--- Begin the document pages
148 %
149 \begin{document}
150 \frontmatter
151 \thispagestyle{empty}
152
153 \nonzeroparskip
154 \setlength{\parindent}{0pt} 
155 \setlength{\headheight}{6cm}
156 \setlength{\uppermargin}{6cm}
157
158 \begin{centering}
159 \LARGE
160 \textbf{\dwf}
161
162 \textbf{Version 4.1}
163
164 \centering
165 \includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
166
167 \centering
168 \vspace{1in}
169 \href{http://www.dwarfstd.org}{\dwf\ Committee}
170  
171 \url{http://www.dwarfstd.org}
172
173 \large
174 \vspace{1in}
175 \textbf{\docdate}
176
177 \end{centering}
178
179 %\clearpage
180 \openany
181
182 \textmd
183 \normalsize
184 \setlength{\headheight}{15pt}  
185
186 \pagestyle{plain}
187 \makeevenhead{plain}{}{}{}
188 \makeoddhead{plain}{}{}{}
189 \makeevenfoot{plain}{}{}{}
190 \makeoddfoot{plain}{}{}{}
191
192 \nonzeroparskip
193 \setlength{\parindent}{0pt} 
194 \settrims{0.5in}{0.5in}
195 \settypeblocksize{8.2in}{6.0in}
196 %\setlrmarginsandblock{0.6in}{0.6in}{*}
197 %\setheadfoot{15pt}{15pt}
198 %\setheaderspaces {*}{2\onelineskip}{*}
199 \nouppercaseheads
200 \makeevenhead{plain}{}{\rightmark}{}
201 \makeoddhead{plain}{}{\rightmark}{}
202 \makeevenfoot{plain}{\docdate}{}{Page \thepage}
203 \makeoddfoot{plain}{\docdate}{}{Page \thepage}
204
205 %\openany
206
207 \nonzeroparskip
208 \setlength{\parindent}{0pt} 
209
210 \flushleft
211 \include{copyright}
212 \include{foreword}
213 \include{foreword4.1}
214 \emptypage
215
216 \cleardoublepage
217 \tableofcontents
218
219 \cleardoublepage
220 \listoffigures
221
222 \cleardoublepage
223 \listoftables
224
225 \flushleft
226 \chapterstyle{section}
227
228 \setlength{\parindent}{0pt} 
229
230 \makepagestyle{fragFirstChPage}
231     \makeevenhead{fragFirstChPage}{}{}{}
232     \makeoddhead{fragFirstChPage}{}{}{}
233     \makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
234     \makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
235 \nouppercaseheads
236 \aliaspagestyle{chapter}{fragFirstChPage}
237
238 % ----- Start the main part of the document -----
239 \mainmatter
240 % Define the levels of sectionality that are numbered.
241 \setcounter{secnumdepth}{5}
242 \include{introduction}
243 \include{generaldescription}    \emptypage
244 \include{programscope}
245 \include{dataobject}            \emptypage
246 \include{typeentries}           \emptypage
247 \include{otherdebugginginformation}
248 \include{datarepresentation}    \emptypage
249 %  The \appendix toggles us into appendix chapters
250 \appendix
251 \include{attributesbytag}
252 \include{debugsectionrelationships}
253 \include{encodingdecoding}      \emptypage
254 \include{examples}
255 \include{compression}
256 \include{sectionversionnumbers}
257 \include{gnulicense}
258 \printindex
259 \end{document}