Ignore:
Timestamp:
Aug 1, 2016, 9:00:59 AM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
182fe1e
Parents:
057b34f
Message:

update switch documentation and LaTeX macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.tex

    r057b34f rc45170a  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Tue Jul 12 20:37:57 2016
    14 %% Update Count     : 206
     13%% Last Modified On : Mon Aug  1 08:57:17 2016
     14%% Update Count     : 223
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    1919\setlength{\textheight}{9in}
    2020%\oddsidemargin 0.0in
    21 \renewcommand{\topfraction}{0.8}        % float must be greater than X of the page before it is forced onto its own page
    22 \renewcommand{\bottomfraction}{0.8}     % float must be greater than X of the page before it is forced onto its own page
     21\renewcommand{\topfraction}{0.8}                % float must be greater than X of the page before it is forced onto its own page
     22\renewcommand{\bottomfraction}{0.8}             % float must be greater than X of the page before it is forced onto its own page
    2323\renewcommand{\floatpagefraction}{0.8}  % float must be greater than X of the page before it is forced onto its own page
    24 \renewcommand{\textfraction}{0.0}       % the entire page maybe devoted to floats with no text on the page at all
    25 
    26 \lefthyphenmin=4
     24\renewcommand{\textfraction}{0.0}               % the entire page maybe devoted to floats with no text on the page at all
     25
     26\lefthyphenmin=4                                                % hyphen only after 4 characters
    2727\righthyphenmin=4
    2828
     
    3838% Names used in the document.
    3939
    40 \newcommand{\CFA}{C$\mathbf\forall$\xspace}              % set language symbolic name
    41 \newcommand{\CFL}{Cforall\xspace}                        % set language text name
     40\newcommand{\CFA}{C$\mathbf\forall$\xspace} % set language symbolic name
     41\newcommand{\CFL}{Cforall\xspace}               % set language text name
    4242\newcommand{\CC}{\rm C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name
    4343\newcommand{\CCeleven}{\rm C\kern-.1em\hbox{+\kern-.25em+}11\xspace} % C++11 symbolic name
    44 \def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)
     44\def\c11{ISO/IEC C}                                             % C11 name (cannot have numbers in latex command name)
    4545
    4646%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    5252\setlength{\parindentlnth}{\parindent}
    5353
    54 \newlength{\gcolumnposn}
     54\newlength{\gcolumnposn}                                % temporary hack because lstlisting does handle tabs correctly
    5555\newlength{\columnposn}
    5656\setlength{\gcolumnposn}{2.5in}
     
    6363%\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
    6464
    65 \usepackage{pslatex}                                                                    % reduce size of san serif font
    66 \usepackage{relsize}                                    % must be after change to small or selects old size
     65\usepackage{pslatex}                                    % reduce size of san serif font
     66\usepackage{relsize}                                    % must be after change to small or selects old size
    6767
    6868% reduce size of chapter/section titles
     
    120120
    121121% inline text and lowercase index: \Index{inline and lowercase index text}
     122\newcommand{\Index}{\@ifstar\@sIndex\@Index}
    122123% inline text and as-in index: \Index[as-is index text]{inline text}
     124\newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
    123125% inline text but index with different as-is text: \Index[index text]{inline text}
    124 \newcommand{\Index}{\@ifstar\@sIndex\@Index}
    125 \newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
    126126\newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
    127127
    128 % cannot use ©
     128% inline text and code index (cannot use ©)
    129129\newcommand{\Indexc}[1]{\lstinline$#1$\index{#1@\lstinline$#1$}}
     130% code index (cannot use ©)
    130131\newcommand{\indexc}[1]{\index{#1@\lstinline$#1$}}
    131132
     
    137138\newcommand{\@newterm}[2][\@empty]{\lowercase{\def\temp{#2}}{\newtermFontInline{#2}}\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
    138139\newcommand{\@snewterm}[2][\@empty]{{\newtermFontInline{#2}}\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
     140
     141% Latin abbreviation
     142\newcommand{\abbrevFont}{\textit}       % set empty for no italics
     143\newcommand*{\eg}{%
     144        \@ifnextchar{,}{\abbrevFont{e}.\abbrevFont{g}.}%
     145                {\@ifnextchar{:}{\abbrevFont{e}.\abbrevFont{g}.}%
     146                        {\abbrevFont{e}.\abbrevFont{g}.,\xspace}}%
     147}%
     148\newcommand*{\ie}{%
     149        \@ifnextchar{,}{\abbrevFont{i}.\abbrevFont{e}.}%
     150                {\@ifnextchar{:}{\abbrevFont{i}.\abbrevFont{e}.}%
     151                        {\abbrevFont{i}.\abbrevFont{e}.,\xspace}}%
     152}%
     153\newcommand*{\etc}{%
     154        \@ifnextchar{.}{\abbrevFont{etc}}%
     155        {\abbrevFont{etc}.\xspace}%
     156}%
    139157\makeatother
    140158
     
    145163        \endlist
    146164}% quote2
     165
    147166\newenvironment{rationale}{%
    148167  \begin{quote2}\noindent$\Box$\enspace
     
    188207\newcommand{\VPageref}[2][page]{\ifx#1\@empty\else{#1}\nobreakspace\fi\pageref{#2}}
    189208
    190 % Go programming language
     209% Go programming language: https://github.com/julienc91/listings-golang/blob/master/listings-golang.sty
    191210\lstdefinelanguage{Golang}{
    192211        morekeywords=[1]{package,import,func,type,struct,return,defer,panic, recover,select,var,const,iota,},%
     
    204223}
    205224
    206 % CFA programming language, based on ANSI C
     225% CFA programming language, based on ANSI C (with some gcc additions)
    207226\lstdefinelanguage{CFA}[ANSI]{C}{
    208227        morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto,
     
    215234language=CFA,
    216235columns=fullflexible,
    217 basicstyle=\linespread{0.9}\sf,
    218 stringstyle=\tt,
    219 tabsize=4,
    220 xleftmargin=\parindentlnth,
    221 extendedchars=true,
    222 escapechar=§,
    223 mathescape=true,
    224 keepspaces=true,
    225 showstringspaces=false,
    226 showlines=true,
    227 aboveskip=4pt,
     236basicstyle=\linespread{0.9}\sf,                 % reduce line spacing and use sanserif font
     237stringstyle=\tt,                                                % use typewriter font
     238tabsize=4,                                                              % 4 space tabbing
     239xleftmargin=\parindentlnth,                             % indent code to paragraph indentation
     240extendedchars=true,                                             % allow ASCII characters in the range 128-255
     241escapechar=§,                                                   % escape to latex in CFA code
     242mathescape=true,                                                % allow $...$ LaTeX math escapes in code
     243%keepspaces=true,                                               %
     244showstringspaces=false,                                 % do not show spaces with cup
     245showlines=true,                                                 % show blank lines at end of code
     246aboveskip=4pt,                                                  % spacing above/below code block
    228247belowskip=3pt,
    229 moredelim=**[is][\color{red}]{®}{®}, % red highlighting
    230 moredelim=**[is][\color{blue}]{ß}{ß}, % blue highlighting
     248moredelim=**[is][\color{red}]{®}{®},    % red highlighting
     249moredelim=**[is][\color{blue}]{ß}{ß},   % blue highlighting
    231250moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting
    232251moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % temporarily turn off keywords
     
    242261\renewcommand\thebibliography[1]{
    243262  \Oldthebibliography{#1}
    244   \setlength{\parskip}{0pt}                     % reduce vertical spacing between references
     263  \setlength{\parskip}{0pt}                             % reduce vertical spacing between references
    245264  \setlength{\itemsep}{5pt plus 0.3ex}
    246265}%
    247 
    248 \newcommand*{\eg}{\textit{e.g}.\@\xspace}
    249 \newcommand*{\ie}{\textit{i.e}.\@\xspace}
    250 
    251 \makeatletter
    252 \newcommand*{\etc}{%
    253     \@ifnextchar{.}%
    254         {\textit{etc}}%
    255         {\textit{etc}.\@\xspace}%
    256 }
    257 \makeatother
    258266
    259267% Local Variables: %
Note: See TracChangeset for help on using the changeset viewer.