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