Changeset c1136c56


Ignore:
Timestamp:
Apr 28, 2021, 3:52:36 PM (6 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
a6c45c6
Parents:
edc6ea2
Message:

Andrew MMath: \CFAStyle now uses an actual listings style.

Location:
doc/theses/andrew_beach_MMath
Files:
2 edited

Legend:

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

    redc6ea2 rc1136c56  
    9494\lstset{defaultdialect={[UW]CFA}}
    9595
    96 % The cfalab style defines some common settings useful in different languages.
    97 \lstdefinestyle{cfalab}{%
    98     columns=fullflexible,
    99     basicstyle=\linespread{0.9}\tt,
    100     stringstyle=\tt,
     96% Create an internal paragraph indent amount. This is used internally to
     97% mimic the standard indent even when it has been overriden in the document.
     98\newlength\cfalab@parindent
     99\deflength\cfalab@parindent{\parindent}
     100
     101% The cfacommon style has many useful defaults for CFA and other types of
     102% code. Use the listings option "style=cfacommon" to load them.
     103\lstdefinestyle{cfacommon}{
     104  columns=fullflexible,
     105  basicstyle=\linespread{0.9}\sf,
     106  stringstyle=\tt,
     107  tabsize=5,
     108  % Indent code to paragraph indentation.
     109  xleftmargin=\cfalab@parindent,
     110  % Allow ASCII characters in the range 128-255.
     111  extendedchars=true,
     112  % This allows you to use "math mode" to insert LaTeX into the code.
     113  % Use \( and \) if you need to insert math mode inside that code.
     114  escapechar=\$,
     115  % Disable LaTeX math escape in CFA code $...$
     116  mathescape=false,
     117  keepspaces=true,
     118  % Do not show spaces with cup.
     119  showstringspaces=false,
     120  % Show blank lines at end of code.
     121  showlines=true,
     122  % Spacing above/below code block.
     123  aboveskip=4pt,belowskip=0pt,
     124  numberstyle=\footnotesize\sf,
     125  % Replace/adjust listing characters that look bad in sanserif.
     126  literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
     127    {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
     128    {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
     129    {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2
     130    {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2,
    101131}
    102132
     
    104134% Below this line is for compatability with the old common.tex file.
    105135
    106 \newcommand{\CFAStyle}{%
    107   \lstset{
    108     columns=fullflexible,
    109     % reduce line spacing and use sanserif font
    110     basicstyle=\linespread{0.9}\sf,
    111     % use typewriter font
    112     stringstyle=\tt,
    113     tabsize=5,
    114     % indent code to paragraph indentation
    115     %xleftmargin=\parindentlnth,
    116     % Allow ASCII characters in the range 128-255.
    117     extendedchars=true,
    118     % This allows you to use "math mode" to insert LaTeX into the code.
    119     % Use \( and \) if you need to insert math mode inside that code.
    120     escapechar=\$,
    121     % LaTeX math escape in CFA code $...$
    122     mathescape=false,
    123     keepspaces=true,
    124     % do not show spaces with cup
    125     showstringspaces=false,
    126     % show blank lines at end of code
    127     showlines=true,
    128     % spacing above/below code block
    129     aboveskip=4pt,
    130     belowskip=0pt,
    131     % numbering style
    132     numberstyle=\footnotesize\sf,
    133     % replace/adjust listing characters that look bad in sanserif
    134     literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
    135       {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
    136       {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
    137       {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2
    138       {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2,
    139   }
    140 }
     136% Backwards compatable way to activate the cfacommon style.
     137\newcommand{\CFAStyle}{\lstset{style=cfacommon}}
    141138
    142139% A couple of abbreviations are provided. Just ones someone liked.
  • doc/theses/andrew_beach_MMath/uw-ethesis.tex

    redc6ea2 rc1136c56  
    198198\makeglossaries
    199199
    200 
     200% listings package configuation:
    201201\lstMakeShortInline@
    202 
    203 % CFA code-style for all languages
    204 \CFAStyle
    205 % CFA default lnaguage
    206 \lstset{language=CFA,basicstyle=\linespread{0.9}\tt}
     202\lstset{language=CFA,style=cfacommon,basicstyle=\linespread{0.9}\tt}
    207203\lstset{moredelim=**[is][\protect\color{red}]{@}{@}}
    208204% Annotations from Peter:
Note: See TracChangeset for help on using the changeset viewer.