Ignore:
Timestamp:
Apr 28, 2021, 2:02:23 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c1136c56
Parents:
df24d37
Message:

Andrew MMath: LaTeX clean-up. Went through existing to make some of the examples more managable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/cfalab.sty

    rdf24d37 redc6ea2  
    2626
    2727% \newsymbolcmd{<command>}{<replacement text>}
    28 %     Defines <command> to be a symbol that has the given <replacement text>.
     28% Defines <command> to be a symbol that has the given <replacement text>.
    2929\newrobustcmd*\newsymbolcmd[2]{\newrobustcmd{#1}{\cfalab@symbol{#2}}}
    3030\def\cfalab@symbol#1{\@ifnextchar*{#1\cfalab@eatstar}{#1\xspace}}
     
    5050
    5151% \colour{<colour>}{<text>}
    52 % Just \colour but using the LaTeX style instead of TeX style command.
     52% Just \color but using the LaTeX style instead of TeX style command.
    5353\newcommand*\colour[2]{{\color{#1}#2}}
    5454
     
    6060\newrobustcmd*\codePy[1]{\lstinline[language=Python]{#1}}
    6161
     62% Use the listings package to format a block of CFA code.
     63% Extra listings options can be passed in as an optional argument.
    6264\lstnewenvironment{cfa}[1][]{\lstset{language=CFA}\lstset{#1}}{}
    6365
     
    124126    % show blank lines at end of code
    125127    showlines=true,
    126     aboveskip=4pt,                          % spacing above/below code block
     128    % spacing above/below code block
     129    aboveskip=4pt,
    127130    belowskip=0pt,
    128131    % numbering style
     
    137140}
    138141
    139 \newcommand{\abbrevFont}{\textit}           % set empty for no italics
    140 \@ifundefined{eg}{
    141 \newcommand{\EG}{\abbrevFont{e}.\abbrevFont{g}.}
    142 \newcommand*{\eg}{%
    143     \@ifnextchar{,}{\EG}%
    144         {\@ifnextchar{:}{\EG}%
    145             {\EG,\xspace}}%
    146 }}{}%
    147 \@ifundefined{ie}{
    148 \newcommand{\IE}{\abbrevFont{i}.\abbrevFont{e}.}
    149 \newcommand*{\ie}{%
    150     \@ifnextchar{,}{\IE}%
    151         {\@ifnextchar{:}{\IE}%
    152             {\IE,\xspace}}%
    153 }}{}%
    154 \@ifundefined{etc}{
    155 \newcommand{\ETC}{\abbrevFont{etc}}
    156 \newcommand*{\etc}{%
    157     \@ifnextchar{.}{\ETC}%
    158         {\ETC.\xspace}%
    159 }}{}%
    160 \@ifundefined{etal}{
    161 \newcommand{\ETAL}{\abbrevFont{et}~\abbrevFont{al}}
    162 \newcommand*{\etal}{%
    163     \@ifnextchar{.}{\protect\ETAL}%
    164         {\protect\ETAL.\xspace}%
    165 }}{}%
    166 \@ifundefined{viz}{
    167 \newcommand{\VIZ}{\abbrevFont{viz}}
    168 \newcommand*{\viz}{%
    169     \@ifnextchar{.}{\VIZ}%
    170         {\VIZ.\xspace}%
    171 }}{}%
     142% A couple of abbreviations are provided. Just ones someone liked.
     143%
     144% Abbreviation formatting commands (renew to customize):
     145\newcommand{\abbrevFont}{\textit}
     146%
     147% Abbreviations that, if not followed by a comma or colon, add a comma.
     148\newrobustcmd*\cfalab@abbrev@comma{%
     149  \@ifnextchar{,}{}{\@ifnextchar{:}{}{,\xspace}}}
     150\providerobustcmd*\eg{\abbrevFont{e}.\abbrevFont{g}.\cfalab@abbrev@comma}
     151\providerobustcmd*\ie{\abbrevFont{i}.\abbrevFont{e}.\cfalab@abbrev@comma}
     152%
     153% Abbreviations that, if not followed by a period, add a period.
     154\newrobustcmd*\cfalab@abbrev@period{\@ifnextchar{.}{}{.\xspace}}
     155\providerobustcmd*\etc{\abbrevFont{etc}\cfalab@abbrev@period}
     156\providerobustcmd*\etal{\abbrevFont{et}~\abbrevFont{al}\cfalab@abbrev@period}
     157\providerobustcmd*\viz{\abbrevFont{viz}\cfalab@abbrev@period}
    172158
    173159\endinput
Note: See TracChangeset for help on using the changeset viewer.