Ignore:
Timestamp:
Mar 24, 2020, 4:37:09 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
44a88528
Parents:
ae66348
Message:

ABMM thesis: Lots of context reworking. Took out Peter's formating and put back parts that I understood and used.

File:
1 edited

Legend:

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

    rae66348 rc72ea7a  
    11% Package for CFA Research Lab.
    22%
    3 % Made by combining and updating
     3% Made by combining and updating various macro files people had made.
     4%
     5% Internal commands are prefixed with "\cfalab@".
    46
    57% I don't know what the oldest LaTeX2e version with everything needed is.
    68\NeedsTeXFormat{LaTeX2e}
    7 \ProvidesPackage{cfalab}[2020/03/09 v0.1 CFA Laboratory LaTeX Tools]
     9\ProvidesPackage{cfalab}[2020/03/24 v0.1 CFA Laboratory LaTeX Tools]
    810
    911% Other packages required.
    1012\RequirePackage{etoolbox}
     13\RequirePackage{listings}
    1114\RequirePackage{xspace}
    1215
     
    1619% by a star (which the command will consume) to disable this behaviour.
    1720
    18 % \newsymbolcmd{<command>}{<expansion>}
    19 %    Defines <command> to be a symbol that has the given <expansion>.
     21% \newsymbolcmd{<command>}{<replacement text>}
     22%     Defines <command> to be a symbol that has the given <replacement text>.
    2023\newrobustcmd*\newsymbolcmd[2]{\newrobustcmd{#1}{\cfalab@symbol{#2}}}
    2124\def\cfalab@symbol#1{\@ifnextchar*{#1\cfalab@eatstar}{#1\xspace}}
     
    2528\newsymbolcmd\CFA{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}}
    2629
    27 \newcommand\codeC[1]{\texttt{#1}}
     30% The CFA listings language. Based off of ANCI C and including GCC extensions.
     31% The UW dialect is the default (and only so far) dialect of the language.
     32\lstdefinelanguage[UW]{CFA}[ANSI]{C}{
     33    morekeywords={_Alignas, _Alignof, __alignof, __alignof__, asm, __asm,
     34        __asm__, __attribute, __attribute__, auto, _Bool, catch, catchResume,
     35        choose, _Complex, __complex, __complex__, __const, __const__,
     36        coroutine, disable, dtype, enable, exception, __extension__,
     37        fallthrough, fallthru, finally, __float80, float80, __float128,
     38        float128, forall, ftype, generator, _Generic, _Imaginary, __imag,
     39        __imag__, inline, __inline, __inline__, __int128, int128, __label__,
     40        monitor, mutex, _Noreturn, one_t, or, otype, restrict, resume,
     41        __restrict, __restrict__, __signed, __signed__, _Static_assert,
     42        suspend, thread, _Thread_local, throw, throwResume, timeout, trait,
     43        try, ttype, typeof, __typeof, __typeof__, virtual, __volatile,
     44        __volatile__, waitfor, when, with, zero_t
     45    },
     46    moredirectives={defined,include_next},
     47}
     48\lstset{defaultdialect={[UW]CFA}}
     49
     50% The cfalab style defines some common settings useful in different languages.
     51\lstdefinestyle{cfalab}{%
     52    columns=fullflexible,
     53    basicstyle=\linespread{0.9}\tt,
     54    stringstyle=\tt,
     55}
     56
     57% \code*[<escape character>]{<code>}
     58%     Use the listings package to format a snipit of <code>.
     59%     The <escape character> must be a character that does not appear in
     60%     <code> and defaults to a backtick.
     61\newcommand*\codeC[2][\`]{\lstinline[language=C]#1#2#1}
     62\newcommand*\codeCFA[2][\`]{\lstinline[language=CFA]#1#2#1}
     63
     64% \settextunderscore{(new|old)}
     65%     Redefines the underscore either as a new repersentation or the old one.
     66%     Not that some other packages (ex. hyperref) can override this. Set it
     67%     up after loading them.
     68\let\cfalab@textunderscore@old=\textunderscore
     69\newcommand\cfalab@textunderscore@new{%
     70    \leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}
     71\newcommand\settextunderscore[1]{%
     72    \renewcommand\textunderscore{\csuse{cfalab@textunderscore@#1}}}
    2873
    2974\endinput
Note: See TracChangeset for help on using the changeset viewer.