Ignore:
Timestamp:
Feb 7, 2022, 11:04:54 PM (16 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
12b5e94a, c4f8170
Parents:
1cf8a9f
Message:

cleanup, add snake and lang macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.sty

    r1cf8a9f r7a15b7e  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon May 31 09:08:37 2021
    14 %% Update Count     : 565
     13%% Last Modified On : Mon Feb  7 23:00:46 2022
     14%% Update Count     : 569
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    4343\newcommand{\CCIcon}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}} % C++ icon
    4444\newcommand{\CC}[1][]{\protect\CCIcon{#1}\xspace}               % C++ symbolic name
     45\newcommand{\Cpp}[1][]{\CC{#1}}                                                 % C++ synonym
    4546% numbers disallowed in latex variables names => use number names
    4647\newcommand{\CCeleven}{\protect\CCIcon{11}\xspace}              % C++11 symbolic name
     
    5152
    5253%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     54
     55\usepackage{pslatex}                                                                    % reduce size of san serif font
     56\usepackage{relsize}                                                                    % must be after change to small or selects old size
     57\usepackage{rotating}
     58\usepackage{calc}                                                                               % latex arithmetic
    5359
    5460% remove special-character warning in PDF side-bar names
     
    7177\newlength{\parindentlnth}
    7278\setlength{\parindentlnth}{\parindent}
    73 
    74 \usepackage{pslatex}                                                                    % reduce size of san serif font
    75 \usepackage{relsize}                                                                    % must be after change to small or selects old size
    76 \usepackage{rotating}
    77 \usepackage{calc}                                                                               % latex arithmetic
    7879
    7980% reduce size of chapter/section titles
     
    151152\newcommand{\@snewterm}[2][\@empty]{{\newtermFontInline{#2}}\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
    152153
     154% \snake{<identifier>}
     155% Improves writing of snake case (or any convention that uses _) by allowing
     156% line breaks after _. Disables commands inside the block and formats the
     157% identifier to look like code.
     158\newcommand*\snake[1]{\snakefont{\expandafter\snake@next\detokenize{#1}\@nil}}
     159
     160% \snakefont{<text>}
     161% Command used by \snake, you may renew the command to change its formating.
     162\newcommand*\snakefont[1]{\LstBasicStyle{#1}}
     163
     164% Thanks Manuel of TeX Stack exchange. (I got the base pattern from one of
     165% their answers.) Note: \@nil should never be defined.
     166\newcommand*\snake@next[1]{\ifx\@nil#1\else
     167  \expandafter\ifx\string_#1\string_\allowbreak\else#1\fi
     168  \expandafter\snake@next\fi
     169}
     170
     171% \lang{<language>}{<code>}
     172% Use the listings package to format the snipit of <code> in <language>.
     173\newcommand{\lang}[2]{\lstinline[language=#1]{#2}}
     174
    153175% Latin abbreviation
    154176\newcommand{\abbrevFont}{\textit}                       % set empty for no italics
     
    263285extendedchars=true,                                             % allow ASCII characters in the range 128-255
    264286escapechar=\$,                                                  % LaTeX escape in CFA code §...§ (section symbol), emacs: C-q M-'
    265 mathescape=false,                                               % LaTeX math escape in CFA code $...$
     287mathescape=false,                                               % disable LaTeX math escape in CFA code $...$
    266288keepspaces=true,                                                %
    267289showstringspaces=false,                                 % do not show spaces with cup
     
    308330}{}
    309331% inline code @...@ (at symbol)
    310 \makeatother
    311332\lstMakeShortInline@                                    % single-character for \lstinline
    312 \makeatletter
    313333\fi%
    314334
Note: See TracChangeset for help on using the changeset viewer.