Ignore:
File:
1 edited

Legend:

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

    rec1c674 r8cd34e9  
    11% Package for CFA Research Lab.
    22%
    3 % Made by combining and updating various macro files people had made.
     3% This is a collection of commands everyone working on CFA related documents
     4% should find useful. So mostly programming language related tools.
    45%
    56% Internal commands are prefixed with "\cfalab@".
     
    1718% Automatically adds spaces.
    1819\RequirePackage{xspace}
    19 % Improved reference tools.
    20 \RequirePackage[nospace]{varioref}
    2120
    22 % Symbols: All symbols are zero argument robust commands with special rules
    23 % about the space following the c.s. token. Normally the space might be
    24 % re-added according to the rules of the xspace package. They may be followed
    25 % by a star (which the command will consume) to disable this behaviour.
    26 
    27 % \newsymbolcmd{<command>}{<replacement text>}
    28 % Defines <command> to be a symbol that has the given <replacement text>.
    29 \newrobustcmd*\newsymbolcmd[2]{\newrobustcmd{#1}{\cfalab@symbol{#2}}}
    30 \def\cfalab@symbol#1{\@ifnextchar*{#1\cfalab@eatstar}{#1\xspace}}
    31 \def\cfalab@eatstar*{}
    32 
     21% Tip for commands that end with \xspace: if the default is not correct then
     22% follow the command with {} to disable \xspace, use '{} ' to force add a
     23% space and '{}<whatever-follows>' to force remove one.
     24%
     25% \CFA
    3326% Cforall with the forall symbol.
    34 \newsymbolcmd\CFA{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}}
    35 % C++ with kerning. (No standard number support.)
    36 \newsymbolcmd\Cpp{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}}
     27\newrobustcmd\CFA{\textsf{C\raisebox{\depth}{\rotatebox{180}{A}}}\xspace}
     28% \Cpp[<std>]
     29% C++ symbol name. You may optionally provide <std> to specify a standard.
     30\newrobustcmd\Cpp[1][\xspace]{C++#1}
    3731
    3832% This is executed very early in the \begin{document} code, before the
     
    5347\newcommand*\colour[2]{{\color{#1}#2}}
    5448
    55 % \code*{<code>}
     49% \codeCFA{<code>}
     50% \codeC{<code>}
     51% \codeCpp{<code>}
     52% \codePy{<code>}
    5653% Use the listings package to format a snipit of <code>.
    5754\newrobustcmd*\codeCFA[1]{\lstinline[language=CFA]{#1}}
     
    6057\newrobustcmd*\codePy[1]{\lstinline[language=Python]{#1}}
    6158
     59% \begin{cfa}[<options>]
     60% \end{cfa}
    6261% Use the listings package to format a block of CFA code.
    6362% Extra listings options can be passed in as an optional argument.
     
    124123  numberstyle=\footnotesize\sf,
    125124  % Replace/adjust listing characters that look bad in sanserif.
    126   literate={-}{\makebox[1ex][c]{\raisebox{0.7ex}{\rule{0.75ex}{0.1ex}}}}1
     125  literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
    127126    {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
    128127    {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
Note: See TracChangeset for help on using the changeset viewer.