summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/complexity
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/complexity')
-rw-r--r--Master/texmf-dist/tex/latex/complexity/complexity.sty79
1 files changed, 40 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/complexity/complexity.sty b/Master/texmf-dist/tex/latex/complexity/complexity.sty
index 6a57384e02b..8acec3ac4d2 100644
--- a/Master/texmf-dist/tex/latex/complexity/complexity.sty
+++ b/Master/texmf-dist/tex/latex/complexity/complexity.sty
@@ -13,8 +13,32 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
+% Copyright and license
+% =====================
+%
+% Copyright (C) 2017 Chris Bourke
+%
+% This file may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, either version 1.3c of this license
+% or (at your option) any later version. The latest version of this
+% license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
+% Changes made (.81 -> .81a, 2017/09/16)
+% -Updated copyright, added LPPL 1.3c
+% Changes made (.80 -> .81, 2017/09/15)
+% -Removed \typeout message
+% -Cleaned up comments
+% -Added package option (disableredefinitions) to disable redefinitions
+% of \L, \P, \S for authors that need the originals but cannot use the
+% replacements. For backwards compatibility, the they are still redefined
+% by default. Thanks to Enrico Gregorio for the fix.
% Changes made (.76 -> .80)
% -Added a cool message using \typeout!
% -Added \newclass, \newlang, \newfunc commands
@@ -41,16 +65,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e} %
-\ProvidesPackage{complexity}[11/24/06 \space v0.77]
-
-\typeout{\space\space +----------------------------------------------+^^J%
- \space\space\space\space complexity LaTeX package ^^J%
- \space\space\space\space version: ^^J%
- \space\space\space\space author: Chris Bourke (cbourke@cse.unl.edu) ^^J%
- \space\space +----------------------------------------------+}
+\ProvidesPackage{complexity}[09/16/17 \space v0.81a]
% Require Packages
-%\RequirePackage{keyval}[1997/11/10]
\RequirePackage{ifthen}
% Declare internal commands
@@ -64,7 +81,6 @@
\newcommand{\func}[1]{{\ensuremath{\mathsf{#1}}}}
\newcommand{\class}[1]{\ComplexityFont{#1}}
-% Experimental:
\newcommand{\newclass}[2]{\newcommand{#1}{\ComplexityFont{#2}}}
\newcommand{\newlang}[2]{\newcommand{#1}{\lang{#2}}}
\newcommand{\newfunc}[2]{\newcommand{#1}{\func{#2}}}
@@ -73,7 +89,6 @@
\newcommand{\renewlang}[2]{\renewcommand{#1}{\lang{#2}}}
\newcommand{\renewfunc}[2]{\renewcommand{#1}{\func{#2}}}
-
\newboolean{complexity@fullmode} %
\setboolean{complexity@fullmode}{true}
\DeclareOption{full}{%
@@ -83,56 +98,47 @@
\setboolean{complexity@fullmode}{false}%
} %
-%%Begin Till Here
-%\DeclareOption{roman}{\renewcommand{\complexity@fontcommand{\mathrm}}}
-%\DeclareOption{bold}{\renewcommand{\complexity@fontcommand{\mathbf}}}
-%...
+\newif\ifcomplexity@noredef
+\DeclareOption{disableredefinitions}{\complexity@noredeftrue}
\DeclareOption{sanserif}{
\renewcommand{\complexity@fontcommand}{\mathsf}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathsf{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathsf{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathsf{#1}}}}
}
\DeclareOption{roman}{
\renewcommand{\complexity@fontcommand}{\mathrm}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathrm{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathrm{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathrm{#1}}}}
}
\DeclareOption{bold}{
\renewcommand{\complexity@fontcommand}{\mathbf}
- %old: \renewcommand{\ComplexityFont}[1]{{\hbox{\ensuremath{\mathbf{#1}}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathbf{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathbf{#1}}}}
}
\DeclareOption{typewriter}{
\renewcommand{\complexity@fontcommand}{\mathtt}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathtt{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathtt{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathtt{#1}}}}
}
\DeclareOption{italic}{
\renewcommand{\complexity@fontcommand}{\mathit}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathit{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathit{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathit{#1}}}}
}
\DeclareOption{caps}{
\renewcommand{\complexity@fontcommand}{\textsc}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\textsc{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\textsc{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\textsc{#1}}}}
}
\DeclareOption{slant}{
\renewcommand{\complexity@fontcommand}{\textsl}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\textsl{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\textsl{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\textsl{#1}}}}
}
@@ -140,31 +146,24 @@
% Independent classfonts:
\DeclareOption{classfont=sanserif}{
\renewcommand{\complexity@fontcommand}{\mathsf}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathsf{#1}}}}
}
\DeclareOption{classfont=roman}{
\renewcommand{\complexity@fontcommand}{\mathrm}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathrm{#1}}}}
}
\DeclareOption{classfont=bold}{
\renewcommand{\complexity@fontcommand}{\mathbf}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathbf{#1}}}}
}
\DeclareOption{classfont=typewriter}{
\renewcommand{\complexity@fontcommand}{\mathtt}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathtt{#1}}}}
}
\DeclareOption{classfont=italic}{
\renewcommand{\complexity@fontcommand}{\mathit}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathit{#1}}}}
}
\DeclareOption{classfont=caps}{
\renewcommand{\complexity@fontcommand}{\textsc}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\textsc{#1}}}}
}
\DeclareOption{classfont=slant}{
\renewcommand{\complexity@fontcommand}{\textsl}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\textsl{#1}}}}
}
% Independent langfonts:
@@ -190,11 +189,6 @@
\renewcommand{\lang}[1]{{\ensuremath{\textsl{#1}}}}
}
-% If I were to use keyval:
-%\define@key{funcfont}{sanserif}{
-% \renewcommand{\func}[1]{{\ensuremath{\mathsf{#1}}}}
-%}
-
% Independent funcfonts:
\DeclareOption{funcfont=sanserif}{
\renewcommand{\func}[1]{{\ensuremath{\mathsf{#1}}}}
@@ -218,7 +212,6 @@
\renewcommand{\func}[1]{{\ensuremath{\textsl{#1}}}}
}
-
% Till Tantau's Code for the small option:
\DeclareOption{small}{
@@ -254,7 +247,7 @@
% Define some internal commands
% such as a standard kerning value for several commands
-\newcommand{\complexity@kern}{{\kern-.10em}} % note: more {} don't seem to matter, good
+\newcommand{\complexity@kern}{{\kern-.10em}}
\newcommand{\complexity@hyphen}{ %
\lower-.12em\hbox{\textrm{-}} %
}
@@ -282,14 +275,22 @@
\newcommand{\MaxSAT}{\lang{MaxSAT}}
-% We redefine 4 commands inside of Latex, but preserve them for usage
+% Alternatives for \L, \P, \S if disabled
+\newcommand{\cL}{\ComplexityFont{L}}
+\newcommand{\cP}{\ComplexityFont{P}}
+\newcommand{\cS}{\ComplexityFont{S}}
-\let\defaultL\L
+% We redefine 3 commands, but preserve them for usage
+\let\defaultL\L % for back compatibility
+\let\defaultP\P % for back compatibility
+\let\defaultS\S % for back compatibility
+% Only redefine if not disabled
+\ifcomplexity@noredef\else
\renewcommand{\L}{\ComplexityFont{L}}
-\let\defaultP\P
\renewcommand{\P}{\ComplexityFont{P}}
-\let\defaultS\S
\renewcommand{\S}{\ComplexityFont{S}}
+\fi
+
% Major Classes listed in Alphabetical order