First draft of Version 5, incorporating numerous approved changes
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
index 0b612a9..47cec9d 100644 (file)
@@ -1,18 +1,37 @@
-\documentclass[12pt,letterpaper,twoside]{memoir} 
+\documentclass[12pt,letterpaper,oneside]{memoir} 
 % for debugging, add 'draft' (without quotes) to the [] document class list.
 % If draft is in the document class list, pix are just suggested
 % by an outline, the pic does not appear as a picture.
 %
-\usepackage{url} % For color in letters. Links instead?
-\usepackage{color} % For color in letters. Links instead?
-\usepackage{ellipsis} % Provides ... as \dots
-\usepackage{color}
+\newcommand{\docdate}{June 22, 2013}
+%
+\usepackage{ifthen}
+\newboolean{isdraft}
+\setboolean{isdraft}{true}
+\newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** DRAFT ***}{}}
+%
+\usepackage[T1]{fontenc}
+\usepackage{palatino}
+\usepackage{cmtt}
+\renewcommand{\ttdefault}{cmtt}        % Use Computer Modern Typewriter instead of Courier
+%\usepackage{ascii}
+%\renewcommand{\ttdefault}{ascii}
+%\renewcommand{\ttfamily}{\asciifamily}
+%\usepackage{microtype}
+%\DisableLigatures[f]{encoding=T1}
+%\renewcommand{\familydefault}{phv}  % font family helvetica
+%
+
+\usepackage{url}                  % For color in letters. Links instead?
+\usepackage[usenames]{color} % For color in letters. Links instead?
+\usepackage{ellipsis}     % Provides ... as \dots
+%\usepackage{color}
 \usepackage{listings}
 \usepackage{alltt}
 \lstset{ %
 language={},               % choose the language of the code
-basicstyle=\footnotesize,  % the size of the fonts that are used for the code
-numbers=left,              % where to put the line-numbers
+basicstyle=\footnotesize\ttfamily,  % the size of the fonts that are used for the code
+numbers=none,              % where to put the line-numbers
 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
 numberfirstline=true,
 firstnumber=1,             % first line number in each listing
@@ -40,19 +59,16 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \usepackage{needspace}     % For assuring space remaining on a page
 \usepackage{ifthen}        % For conditional processing
 \usepackage{changepage}    % For odd/even page checks
-\usepackage{epic}          % For eepic package 
-\usepackage{eepic}         % For the diagram of section relationships
+\usepackage{tikz}                 % graphics (Appendix B)
+\usetikzlibrary{shapes.geometric}
+\usetikzlibrary{arrows}
 \usepackage{makeidx}       % For making an index
 % hyperref must be the last package listed.
 % The hyperref settings helps hypertext get right links in the 
 % pdf of the index.
-\usepackage[plainpages=false,pdfpagelabels,pagebackref]{hyperref} % Lets us generate colored active links inside a pdf.
+\usepackage[plainpages=false,pdfpagelabels,pagebackref,allcolors=blue]{hyperref} % Lets us generate colored active links inside a pdf.
 \makeindex  % This and the makeidx package allow \index to create index entries.
 
-\renewcommand{\familydefault}{phv}  % font family helvetica
-
-\newcommand{\docdate}{3 February 2013}
-
 \newcommand{\dwf}{DWARF Debugging Information Format}
 
 \newenvironment{myindentpara}[1]%
@@ -68,7 +84,7 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \hypersetup{colorlinks=true,
   %bookmarks=true,
   pdfauthor={\dwf\ Committee},
-  pdftitle={\dwf\ Version 4.1}
+  pdftitle={\dwf\ Version 5}
 }
 
 % An environment to create a listing-like (boxed) presentation for DWARF examples
@@ -88,7 +104,7 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \newcommand{\referfol}[1]{\ref{#1} following}
 
 % Generate a live link in the document
-% use like \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}
+% use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
 % use when the index is different from the text and target.
 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
@@ -98,6 +114,9 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 % When we want the index entry to look different from the name.
 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
 
+\newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
+\newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
+
 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
 
 % The following two let us mark a word as 'do not link' or
@@ -109,10 +128,16 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \newcommand{\nolink}[1]{#1}
 \newcommand{\noindex}[1]{#1}
 
-% For index entries.
+% For index entries. The tt-variant of each pair is designed to
+% allow a word to appear in tt font in the main test and the index
+% but to collate in the index in its non-tt order. (LaTex normally
+% sorts all tt words before all non-tt words.)
 \newcommand{\addtoindex}[1]{#1\index{#1}}
+\newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
 \newcommand{\addtoindexi}[2]{#1\index{#2}}
+\newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
 \newcommand{\addtoindexx}[1]{\index{#1}}
+\newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
 
 % Quote commands that avoid need for inline UTF-8 in these sources
 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
@@ -121,11 +146,16 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 % Better naming for the lowest level section header
 \newcommand{\subsubsubsection}[1]{\paragraph{#1.}}
 
-% Issue \clear space if less than n lines remain on page
+% Issue \clearpage if less than n lines remain on page
 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
 
-% Reduce vertical space at beginning of a list
-\setlength{\topsep}{0in}
+% Helper for item lists with bold subject markers
+\newcommand{\itembf}[1]{\item \textbf{#1}}
+\newcommand{\itembfnl}[1]{\itembf{#1} \\}
+
+% And description lists with normal (not bold) text
+\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
+\newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
 
 \newcommand{\emptypage}{
     \clearpage
@@ -152,6 +182,26 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
         \end{table}
         }
 
+% Anti-ligature commands added because \/ and {} don't work for unknown reasons
+% nor does the microtext package DisableLigatures command...???
+%
+\newcommand{\xiiif}                            {0x\hspace{1pt}3\hspace{2pt}f}
+\newcommand{\xiiifff}                  {0x\hspace{1pt}3\hspace{2pt}f\hspace{2pt}f\hspace{2pt}f}
+\newcommand{\xff}                              {0x\hspace{1pt}f\hspace{2pt}f}
+\newcommand{\xffff}                            {0x\hspace{1pt}f\hspace{2pt}f\hspace{2pt}f\hspace{2pt}f}
+%
+% These are intended for use in running text...
+%
+\newcommand{\xffffffff}                {\texttt{0xffffffff}}                   % use with following punctutation
+\newcommand{\wffffffff}                {\texttt{0xffffffff}\ }                 % use as separate "word"
+\newcommand{\xfffffffzero}             {\texttt{0xfffffff0}}                   % use with following punctutation
+\newcommand{\wfffffffzero}             {\texttt{0xfffffff0}\ }
+\newcommand{\xffffffffffffffff}        {\texttt{0xffffffffffffffff}}   % use with following punctutation
+\newcommand{\wffffffffffffffff}        {\texttt{0xffffffffffffffff}\ }
+
+% Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
+\include{dwarfnamecmds}
+
 %--- Begin the document pages
 %
 \begin{document}
@@ -162,42 +212,42 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \setlength{\parindent}{0pt} 
 \setlength{\headheight}{6cm}
 \setlength{\uppermargin}{6cm}
+\setlength{\topsep}{0pt}
+\tightlists                                    % less spacing before/after lists
 
-\begin{centering}
+\begin{center}
 \LARGE
 \textbf{\dwf}
-
-\textbf{Version 4.1}
-
-\centering
-\includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
-
-\centering
-\vspace{3cm}
-\href{http://www.dwarfstd.org}{\dwf\ Committee}
-
-\vspace{2cm} 
+\\
+\textbf{Version 5}
+\\
+\vspace{1cm}
+\includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
+\\
+\vspace{1cm}
+\href{http://www.dwarfstd.org}{\dwf}
+\href{http://www.dwarfstd.org}{Committee}
+\\
+\vspace{0.3cm} 
 \url{http://www.dwarfstd.org}
-
-\large
-\vspace{1in}
+\\
+\vspace{3cm}
 \textbf{\docdate}
-
-\end{centering}
-
-%\clearpage
-\openany
+\\
+\ifthenelse{\boolean{isdraft}}{
+       \vspace{1cm}
+       \draftmark}
+       {}
+\end{center}
 
 \textmd
 \normalsize
 \setlength{\headheight}{15pt}  
-
 \pagestyle{plain}
-\makeevenhead{plain}{}{}{}
-\makeoddhead{plain}{}{}{}
-\makeevenfoot{plain}{}{}{}
-\makeoddfoot{plain}{}{}{}
-
+%\makeevenhead{plain}{}{}{}
+%\makeoddhead{plain}{}{}{}
+%\makeevenfoot{plain}{}{}{}
+%\makeoddfoot{plain}{}{}{}
 \nonzeroparskip
 \setlength{\parindent}{0pt} 
 \settrims{0.5in}{0.5in}
@@ -208,21 +258,18 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \nouppercaseheads
 \makeevenhead{plain}{}{\rightmark}{}
 \makeoddhead{plain}{}{\rightmark}{}
-\makeevenfoot{plain}{\docdate}{}{Page \thepage}
-\makeoddfoot{plain}{\docdate}{}{Page \thepage}
+\makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
+\makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
 
 %\openany
 
 \nonzeroparskip
 \setlength{\parindent}{0pt} 
-
 \flushleft
 \include{copyright}
 \include{foreword}
-\include{foreword4.1}
-\emptypage
 
-\cleardoublepage
+\newpage
 \tableofcontents
 
 \cleardoublepage
@@ -231,17 +278,26 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \cleardoublepage
 \listoftables
 
+\ifthenelse{\boolean{isdraft}}
+       {       {% Environment to keep the following header change local
+               \cleardoublepage
+               \makeevenhead{plain}{}{Change Summary}{}
+               \makeoddhead{plain}{}{Change Summary}{}
+               \include{changesummary}
+               \cleardoublepage}
+       }{}
+
 \flushleft
 \raggedbottom
-\chapterstyle{section}
+\chapterstyle{default}
 
 \setlength{\parindent}{0pt} 
 
 \makepagestyle{fragFirstChPage}
     \makeevenhead{fragFirstChPage}{}{}{}
     \makeoddhead{fragFirstChPage}{}{}{}
-    \makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
-    \makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
+    \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
+    \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
 \nouppercaseheads
 \aliaspagestyle{chapter}{fragFirstChPage}
 
@@ -249,21 +305,26 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \mainmatter
 % Define the levels of sectionality that are numbered.
 \setcounter{secnumdepth}{5}
+
 \include{introduction}
 \include{generaldescription}            %\emptypage
 \include{programscope}                  \emptypage
 \include{dataobject}                    \emptypage
-\include{typeentries}                   \emptypage
-\include{otherdebugginginformation} \emptypage
-\include{datarepresentation}            %\emptypage
+\include{typeentries}                   %\emptypage
+\include{otherdebugginginformation}    \emptypage
+\include{datarepresentation}            \emptypage
+
 %  The \appendix toggles us into appendix chapters
 \appendix
-\include{attributesbytag}
+
+\include{attributesbytag}                              %\emptypage
 \include{debugsectionrelationships}     \emptypage
 \include{encodingdecoding}              \emptypage
-\include{examples}                      %\emptypage
+\include{examples}                      \emptypage
 \include{compression}                   %\emptypage
 \include{sectionversionnumbers}
 \include{gnulicense}
+
 \printindex
+
 \end{document}