Ignore:
Timestamp:
May 8, 2021, 8:56:23 AM (14 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr
Children:
4ab767a
Parents:
b721578
Message:

harmonize common.tex and common.sty macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.tex

    rb721578 r28572e8  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Tue Apr 27 12:03:17 2021
    14 %% Update Count     : 539
     13%% Last Modified On : Sat May  8 08:48:37 2021
     14%% Update Count     : 540
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    3838\usepackage{xspace}
    3939\newcommand{\CFAIcon}{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}} % Cforall icon
    40 \newcommand{\CFA}{\protect\CFAIcon\xspace}                      % CFA symbolic name
    41 \newcommand{\CFL}{\textrm{Cforall}\xspace}                      % Cforall non-icon name
    42 \newcommand{\Celeven}{\textrm{C11}\xspace}                      % C11 symbolic name
     40\newcommand{\CFA}{\protect\CFAIcon\xspace}                              % CFA symbolic name
     41\newcommand{\CFL}{\textrm{Cforall}\xspace}                              % Cforall non-icon name
     42\newcommand{\Celeven}{\textrm{C11}\xspace}                              % C11 symbolic name
    4343\newcommand{\CCIcon}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}} % C++ icon
    44 \newcommand{\CC}{\protect\CCIcon\xspace}                        % C++ symbolic name
     44\newcommand{\CC}[1][]{\protect\CCIcon{#1}\xspace}               % C++ symbolic name
    4545% numbers disallowed in latex variables names => use number names
    46 \newcommand{\CCeleven}{\protect\CCIcon{11}\xspace}      % C++11 symbolic name
    47 \newcommand{\CCfourteen}{\protect\CCIcon{14}\xspace} % C++14 symbolic name
    48 \newcommand{\CCseventeen}{\protect\CCIcon{17}\xspace} % C++17 symbolic name
    49 \newcommand{\CCtwenty}{\protect\CCIcon{20}\xspace}      % C++20 symbolic name
     46\newcommand{\CCeleven}{\protect\CCIcon{11}\xspace}              % C++11 symbolic name
     47\newcommand{\CCfourteen}{\protect\CCIcon{14}\xspace}    % C++14 symbolic name
     48\newcommand{\CCseventeen}{\protect\CCIcon{17}\xspace}   % C++17 symbolic name
     49\newcommand{\CCtwenty}{\protect\CCIcon{20}\xspace}              % C++20 symbolic name
    5050\newcommand{\Csharp}{C\raisebox{-0.7ex}{\Large$^\sharp$}\xspace} % C# symbolic name
    5151
     
    153153% Latin abbreviation
    154154\newcommand{\abbrevFont}{\textit}                       % set empty for no italics
     155% If not followed by a comma or colon, add a comma.
     156\newcommand{\CheckCommaColon}{\@ifnextchar{,}{}{\@ifnextchar{:}{}{,\xspace}}}
     157% If not followed by a period, add a period.
     158\newcommand{\CheckPeriod}{\@ifnextchar{.}{}{.\xspace}}
     159
    155160\@ifundefined{eg}{
    156161\newcommand{\EG}{\abbrevFont{e}.\abbrevFont{g}.}
    157 \newcommand*{\eg}{%
    158         \@ifnextchar{,}{\EG}%
    159                 {\@ifnextchar{:}{\EG}%
    160                         {\EG,\xspace}}%
    161 }}{}%
     162\newcommand{\eg}{\EG\CheckCommaColon}
     163}{}%
    162164\@ifundefined{ie}{
    163165\newcommand{\IE}{\abbrevFont{i}.\abbrevFont{e}.}
    164 \newcommand*{\ie}{%
    165         \@ifnextchar{,}{\IE}%
    166                 {\@ifnextchar{:}{\IE}%
    167                         {\IE,\xspace}}%
    168 }}{}%
     166\newcommand{\ie}{\IE\CheckCommaColon}
     167}{}%
    169168\@ifundefined{etc}{
    170169\newcommand{\ETC}{\abbrevFont{etc}}
    171 \newcommand*{\etc}{%
    172         \@ifnextchar{.}{\ETC}%
    173         {\ETC.\xspace}%
    174 }}{}%
     170\newcommand{\etc}{\ETC\CheckPeriod}
     171}{}%
    175172\@ifundefined{etal}{
    176173\newcommand{\ETAL}{\abbrevFont{et}~\abbrevFont{al}}
    177 \newcommand*{\etal}{%
    178         \@ifnextchar{.}{\protect\ETAL}%
    179                 {\protect\ETAL.\xspace}%
    180 }}{}%
     174\newcommand{\etal}{\ETAL\CheckPeriod}
     175}{}%
    181176\@ifundefined{viz}{
    182177\newcommand{\VIZ}{\abbrevFont{viz}}
    183 \newcommand*{\viz}{%
    184         \@ifnextchar{.}{\VIZ}%
    185                 {\VIZ.\xspace}%
    186 }}{}%
     178\newcommand{\viz}{\VIZ\CheckPeriod}
     179}{}%
    187180\makeatother
    188181
Note: See TracChangeset for help on using the changeset viewer.