github.com/aakash4dev/cometbft@v0.38.2/spec/consensus/consensus-paper/technote.sty (about)

     1  \NeedsTeXFormat{LaTeX2e}
     2  \ProvidesPackage{technote}[2007/11/09]
     3  \typeout{Template for quick notes with some useful definitions}
     4  
     5  \RequirePackage{ifthen}
     6  \RequirePackage{calc}
     7  \RequirePackage{amsmath,amssymb,amsthm}
     8  \RequirePackage{epsfig}
     9  \RequirePackage{algorithm}
    10  \RequirePackage[noend]{algorithmicplus}
    11  
    12  \newboolean{technote@noedit}
    13  \setboolean{technote@noedit}{false}
    14  \DeclareOption{noedit}{\setboolean{technote@noedit}{true}}
    15  
    16  \newcounter{technote@lang}
    17  \setcounter{technote@lang}{0}
    18  \DeclareOption{german}{\setcounter{technote@lang}{1}}
    19  \DeclareOption{french}{\setcounter{technote@lang}{2}}
    20  
    21  \DeclareOption{fullpage}{
    22  \oddsidemargin  -10mm % Margin on odd side pages (default=0mm)
    23  \evensidemargin -10mm % Margin on even side pages (default=0mm)
    24  \topmargin      -10mm % Top margin space (default=16mm)
    25  \headheight       \baselineskip % Height of headers (default=0mm)
    26  \headsep          \baselineskip % Separation spc btw header and text (d=0mm)
    27  \footskip        30pt % Separation spc btw text and footer (d=30pt)
    28  \textheight     230mm % Total text height (default=200mm)
    29  \textwidth      180mm % Total text width (default=160mm)
    30  }
    31  
    32  \renewcommand{\algorithmiccomment}[1]{\hfill/* #1 */}
    33  \renewcommand{\algorithmiclnosize}{\scriptsize}
    34  
    35  \newboolean{technote@truenumbers}
    36  \setboolean{technote@truenumbers}{false}
    37  \DeclareOption{truenumbers}{\setboolean{technote@truenumbers}{true}}
    38  
    39  \ProcessOptions
    40  
    41  \newcommand{\N}{\ifthenelse{\boolean{technote@truenumbers}}%
    42    {\mbox{\rm I\hspace{-.5em}N}}%
    43    {\mathbb{N}}}
    44  
    45  \newcommand{\R}{\ifthenelse{\boolean{technote@truenumbers}}%
    46    {\mbox{\rm I\hspace{-.2em}R}}%
    47    {\mathbb{R}}}
    48  
    49  \newcommand{\Z}{\mathbb{Z}}
    50  
    51  \newcommand{\set}[1]{\left\{#1\right\}}
    52  \newcommand{\mathsc}[1]{\mbox{\sc #1}}
    53  \newcommand{\li}[1]{\langle#1\rangle}
    54  \newcommand{\st}{\;s.t.\;}
    55  \newcommand{\Real}{\R}
    56  \newcommand{\Natural}{\N}
    57  \newcommand{\Integer}{\Z}
    58  
    59  % edit commands
    60  \newcommand{\newedit}[2]{
    61    \newcommand{#1}[2][default]{%
    62      \ifthenelse{\boolean{technote@noedit}}{}{
    63        \par\vspace{2mm}
    64        \noindent
    65        \begin{tabular}{|l|}\hline
    66          \parbox{\linewidth-\tabcolsep*2}{{\bf #2:}\hfill\ifthenelse{\equal{##1}{default}}{}{##1}}\\\hline
    67          \parbox{\linewidth-\tabcolsep*2}{\rule{0pt}{5mm}##2\rule[-2mm]{0pt}{2mm}}\\\hline
    68        \end{tabular}
    69        \par\vspace{2mm}
    70      }
    71    }
    72  }
    73  
    74  \newedit{\note}{Note}
    75  \newedit{\comment}{Comment}
    76  \newedit{\question}{Question}
    77  \newedit{\content}{Content}
    78  \newedit{\problem}{Problem}
    79  
    80  \newcommand{\mnote}[1]{\marginpar{\scriptsize\it
    81              \begin{minipage}[t]{0.8 in}
    82                \raggedright #1
    83              \end{minipage}}}
    84  
    85  \newcommand{\Insert}[1]{\underline{#1}\marginpar{$|$}}
    86  
    87  \newcommand{\Delete}[1]{\marginpar{$|$}
    88  }
    89  
    90  % lemma, theorem, etc.
    91  \newtheorem{lemma}{Lemma}
    92  \newtheorem{proposition}{Proposition}
    93  \newtheorem{theorem}{Theorem}
    94  \newtheorem{corollary}{Corollary}
    95  \newtheorem{assumption}{Assumption}
    96  \newtheorem{definition}{Definition}
    97  
    98  \gdef\op|{\,|\;}
    99  \gdef\op:{\,:\;}
   100  \newcommand{\assign}{\leftarrow}
   101  \newcommand{\inc}[1]{#1 \assign #1 + 1}
   102  \newcommand{\isdef}{:=}
   103  
   104  \newcommand{\ident}[1]{\mathit{#1}}
   105  \def\newident#1{\expandafter\def\csname #1\endcsname{\ident{#1}}}
   106  
   107  \newcommand{\eg}{{\it e.g.}}
   108  \newcommand{\ie}{{\it i.e.}}
   109  \newcommand{\apriori}{{\it apriori}}
   110  \newcommand{\etal}{{\it et al.}}
   111  
   112  \newcommand\ps@technote{%
   113    \renewcommand\@oddhead{\theheader}%
   114    \let\@evenhead\@oddhead
   115    \renewcommand\@evenfoot
   116      {\hfil\normalfont\textrm{\thepage}\hfil}%
   117    \let\@oddfoot\@evenfoot
   118  }