Changeset a98b2cc for doc/LaTeXmacros


Ignore:
Timestamp:
Feb 20, 2017, 12:11:48 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
3bff885, 7fb1db7
Parents:
d150ea2
Message:

remove multiple lstset macros, introduce \CFADefaultStyle macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.tex

    rd150ea2 ra98b2cc  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Tue Oct 25 22:04:19 2016
    14 %% Update Count     : 234
     13%% Last Modified On : Fri Feb 10 11:32:36 2017
     14%% Update Count     : 249
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    210210\newcommand{\VPageref}[2][page]{\ifx#1\@empty\else{#1}\nobreakspace\fi\pageref{#2}}
    211211
     212\let\Oldthebibliography\thebibliography
     213\renewcommand\thebibliography[1]{
     214  \Oldthebibliography{#1}
     215  \setlength{\parskip}{0pt}                             % reduce vertical spacing between references
     216  \setlength{\itemsep}{5pt plus 0.3ex}
     217}%
     218
    212219% Go programming language: https://github.com/julienc91/listings-golang/blob/master/listings-golang.sty
    213220\lstdefinelanguage{Golang}{
    214         morekeywords=[1]{package,import,func,type,struct,return,defer,panic, recover,select,var,const,iota,},%
    215         morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16, int32,int64,
     221        morekeywords=[1]{package,import,func,type,struct,return,defer,panic,recover,select,var,const,iota,},%
     222        morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16,int32,int64,
    216223                bool,float32,float64,complex64,complex128,byte,rune,uintptr, error,interface},%
    217         morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false, delete,append,real,imag,complex,chan,},%
    218         morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if, else,default,},%
     224        morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false,delete,append,real,imag,complex,chan,},%
     225        morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if,else,default,},%
    219226        morekeywords=[5]{Println,Printf,Error,},%
    220227        sensitive=true,%
     
    237244}%
    238245
    239 \lstset{
    240 language=Pseudo,
    241 columns=fullflexible,
    242 basicstyle=\linespread{0.9}\tt\small,           % reduce line spacing and use typewriter font
    243 stringstyle=\sf\color{Mahogany},                        % use sanserif font
    244 commentstyle=\itshape\color{OliveGreen},                % green and italic comments
    245 tabsize=4,                                                      % 4 space tabbing
    246 xleftmargin=\parindentlnth,                             % indent code to paragraph indentation
    247 extendedchars=true,                                     % allow ASCII characters in the range 128-255
    248 escapechar=§,                                           % escape to latex in CFA code
    249 mathescape=true,                                                % allow $...$ LaTeX math escapes in code
    250 %keepspaces=true,                                               %
    251 showstringspaces=false,                                 % do not show spaces with cup
    252 showlines=true,                                         % show blank lines at end of code
    253 aboveskip=4pt,                                          % spacing above/below code block
    254 belowskip=3pt,
    255 moredelim=**[is][\color{red}]{®}{®},    % red highlighting
    256 moredelim=**[is][\color{blue}]{ß}{ß},   % blue highlighting
    257 moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting
    258 moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % temporarily turn off keywords
    259 % replace/adjust listing characters that look bad in sanserif
    260 literate={-}{\raisebox{-0.15ex}{\texttt{-}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1 {©}{{\"u}}1
    261         {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {_}{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
    262         {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2,
    263 }%
    264 
    265246% CFA programming language, based on ANSI C (with some gcc additions)
    266247\lstdefinelanguage{CFA}[ANSI]{C}{
     
    271252}%
    272253
     254\newcommand{\CFADefaultStyle}{%
    273255\lstset{
    274256language=CFA,
    275257columns=fullflexible,
    276 basicstyle=\linespread{0.9}\sf,                 % reduce line spacing and use sanserif font
    277 stringstyle=\tt,                                                % use typewriter font
    278 tabsize=4,                                                              % 4 space tabbing
    279 xleftmargin=\parindentlnth,                             % indent code to paragraph indentation
    280 extendedchars=true,                                             % allow ASCII characters in the range 128-255
    281 escapechar=§,                                                   % escape to latex in CFA code
    282 mathescape=true,                                                % allow $...$ LaTeX math escapes in code
    283 %keepspaces=true,                                               %
    284 showstringspaces=false,                                 % do not show spaces with cup
    285 showlines=true,                                                 % show blank lines at end of code
    286 aboveskip=4pt,                                                  % spacing above/below code block
     258basicstyle=\linespread{0.9}\sf,                                                 % reduce line spacing and use sanserif font
     259stringstyle=\tt,                                                                                % use typewriter font
     260tabsize=4,                                                                                              % 4 space tabbing
     261xleftmargin=\parindentlnth,                                                             % indent code to paragraph indentation
     262extendedchars=true,                                                                             % allow ASCII characters in the range 128-255
     263escapechar=§,                                                                                   % LaTeX escape in CFA code §...§ (section symbol), emacs: C-q M-'
     264mathescape=true,                                                                                % LaTeX math escape in CFA code $...$
     265%keepspaces=true,                                                                               %
     266showstringspaces=false,                                                                 % do not show spaces with cup
     267showlines=true,                                                                                 % show blank lines at end of code
     268aboveskip=4pt,                                                                                  % spacing above/below code block
    287269belowskip=3pt,
    288 moredelim=**[is][\color{red}]{®}{®},    % red highlighting
    289 moredelim=**[is][\color{blue}]{ß}{ß},   % blue highlighting
    290 moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting
    291 moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % temporarily turn off keywords
    292270% replace/adjust listing characters that look bad in sanserif
    293271literate={-}{\raisebox{-0.15ex}{\texttt{-}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
    294272        {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {_}{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
    295273        {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2,
    296 }%
    297 
    298 \lstMakeShortInline©    % single-character for \lstinline
    299 
    300 
    301 \let\Oldthebibliography\thebibliography
    302 \renewcommand\thebibliography[1]{
    303   \Oldthebibliography{#1}
    304   \setlength{\parskip}{0pt}                             % reduce vertical spacing between references
    305   \setlength{\itemsep}{5pt plus 0.3ex}
    306 }%
     274moredelim=**[is][\color{red}]{®}{®},                                    % red highlighting ®...® (registered trademark symbol) emacs: C-q M-.
     275moredelim=**[is][\color{blue}]{ß}{ß},                                   % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_
     276moredelim=**[is][\color{OliveGreen}]{¢}{¢},                     % green highlighting ¢...¢ (cent symbol) emacs: C-q M-"
     277moredelim=[is][\lstset{keywords={}}]{¶}{¶},                     % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^
     278}% lstset
     279% inline code ©...© (copyright symbol) emacs: C-q M-)
     280\lstMakeShortInline©                                                                    % single-character for \lstinline
     281}%CFADefaultStyle
    307282
    308283% Local Variables: %
Note: See TracChangeset for help on using the changeset viewer.