texlive[45322] Master/texmf-dist: complexity (16sep17)
commits+karl at tug.org
commits+karl at tug.org
Sat Sep 16 22:47:20 CEST 2017
Revision: 45322
http://tug.org/svn/texlive?view=revision&revision=45322
Author: karl
Date: 2017-09-16 22:47:20 +0200 (Sat, 16 Sep 2017)
Log Message:
-----------
complexity (16sep17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/complexity/README
trunk/Master/texmf-dist/doc/latex/complexity/complexity.pdf
trunk/Master/texmf-dist/doc/latex/complexity/complexity.tex
trunk/Master/texmf-dist/tex/latex/complexity/complexity.sty
Modified: trunk/Master/texmf-dist/doc/latex/complexity/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/complexity/README 2017-09-16 20:47:06 UTC (rev 45321)
+++ trunk/Master/texmf-dist/doc/latex/complexity/README 2017-09-16 20:47:20 UTC (rev 45322)
@@ -9,3 +9,22 @@
No dependencies other than the standard ifthen package.
See complexity.pdf for full documentation
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% 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.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Modified: trunk/Master/texmf-dist/doc/latex/complexity/complexity.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/complexity/complexity.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/complexity/complexity.tex 2017-09-16 20:47:06 UTC (rev 45321)
+++ trunk/Master/texmf-dist/doc/latex/complexity/complexity.tex 2017-09-16 20:47:20 UTC (rev 45322)
@@ -1,12 +1,12 @@
% complexity latex package documentation
-% Copyright 2005, by Chris Bourke <cbourke at cse.unl.edu>.
-% http://www.cse.unl.edu/~cbourke
+% Copyright 2017, by Chris Bourke <cbourke at cse.unl.edu>
+% http://chrisbourke.unl.edu
%
% Please do not distribute altered versions of this document
\documentclass{ltxdoc}
-\def\complexityversion{0.80}
+\def\complexityversion{0.81a}
%\usepackage{amsmath}
\usepackage[pdftex,a4paper,colorlinks,pdfpagemode=None]{hyperref}
@@ -19,9 +19,7 @@
\begin{document}
\title{User's Guide for \texttt{complexity}: a \LaTeX\ package, Version \complexityversion}
-\author{Chris Bourke\\
-% \href{mailto:cbourke at cse.unl.edu}{\texttt{cbourke at cse.unl.edu}}
-}
+\author{Chris Bourke}
\date{\today}
\maketitle
@@ -39,46 +37,6 @@
defined for helping you to typeset Computational Complexity
constructs.
-\subsection{Why a \texttt{complexity} package?}
-
-A better question is why not? Complexity theory is a more recent,
-though mature area of Theoretical Computer Science. Each researcher
-seems to have his or her own preferences as to how to typeset
-Complexity Classes and has built up their own personal \LaTeX\
-commands file. This can be frustrating, to say the least, when it
-comes to collaborations or when one has to go through an entire
-series of files changing commands for compatibility or to get
-exactly the look they want (or what may be required). I find it
-amazing that a package hasn't been written \emph{already}! (Maybe
-there has been, but I've not found it).
-
-I thought the best solution would be to develop a single \LaTeX\
-package to handle all of this for us.
-
-\section{Installation}
-
-You should place the |complexity| directory and its files
-(|complexity.sty| and |mycomplexity.sty| as well the documentation
-files if you like) in a place that your \TeX\ distribution will be
-able to find them.
-
-If you use MiK\TeX\ then you should place it in your |localtexmf|
-directory, making sure to refresh your \TeX\ tree (MiK\TeX\ options
-wizard $\rightarrow$ General $\rightarrow$ File Names Database,
-Refresh Now).
-
-In a unix \TeX\ distribution, you may find it useful to use a local
-\LaTeX\ path (i.e. creating a directory
-|/usr/local/username/mylatexfolder/| and tell your \TeX\
-distribution where to find it. Depending on your distribution, you
-might declare an environmental variable (say
-in your |.cshrc| file) like %
-
-|setenv $TEXINPUTS = /usr/local/texdistro//:/usr/local/username/mylatexfolder//|%
-
-(note that the double slash will recursively search all
-subdirectories).
-
\section{Package Options}
The |complexity| package provides two general options---a
@@ -108,10 +66,7 @@
the number of commands the |complexity| package defines (and perhaps
limit conflicts with other packages or your own commands) by using
the |basic| option. This option defines only the most commonly used
-complexity classes.\footnote{Deciding which classes were most
-``common'' was purely based on my judgement, for better or worse. If
-I've not considered your favorite complexity class as ``common,'' I
-humbly apologize.}
+complexity classes.
\begin{description}
@@ -128,21 +83,16 @@
\subsection{Font Options}
-Different researchers and different publications have their own
-preferences for how to typeset complexity classes. The beauty of
-the |complexity| package is that it not only defines a whole sleigh
-of complexity classes \emph{for you}, but it also allows you to
-change the font they are typeset in with a simple option call.
+You can easily change the fonts for complexity classes using
+a package option. The |complexity| package defines three different
+font entities: a font for complexity classes (|classfont|), a font
+for languages (|langfont|), and a font for functions (|funcfont|).
+By default, all of these fonts are typeset using the |mathsf| font.
+You can change the font for all of them together or specify a font
+for each individually. To apply a single font to all three entities,
+simply pass the font (by itself) as an option. The supported font
+options are as follows.
-The |complexity| package defines three different font entities: a
-font for complexity classes (|classfont|), a font for languages
-(|langfont|), and a font for functions (|funcfont|). By default,
-all of these fonts are typeset using the |mathsf| font. You can
-change the font for all of them together or specify a font for each
-individually. To apply a single font to all three entities, simply
-pass the font (by itself) as an option. The supported font options
-are as follows.
-
\begin{description}
\item[|sanserif|] (\emph{Default}) This typesets the classes in a
@@ -221,53 +171,47 @@
A special option is the |small| option and pertains only to how
complexity classes (|classfont|) are typeset. Since classes are
-typeset in uppercase letters, they tend to be more dominant. This
-is not so important for classes such as $\P$ and $\NP$, but if you
-are referencing classes such as $\PSPACE$ or $\DTIME$ it can
+typeset in uppercase letters, they tend to be more dominant. If
+you frequently typeset classes such as $\PSPACE$ or $\DTIME$ it can
interrupt the normal flow of text layouts. One solution to this is
to typeset classes 1pt smaller than the surrounding text. This is
the approach taken in some texts (most notably, Papadimitriou's book
-\emph{Computational Complexity}, 1994) and it works quite well. To
-illustrate, consider the following:
+\emph{Computational Complexity}, 1994) and it works quite well.
+The following samples illustrate the difference. The first sample
+uses the default font size while the second uses a font that is 1pt
+smaller (internally, the |\small| command is used). The difference is
+subtle but when used in a long text, flows more naturally.
+
\begin{quote}
-There are deterministic classes such as $\PSPACE \hbox{\small
-\PSPACE}$\kern-.3em, nondeterministic classes such as $\NP
-\hbox{\small \NP}$\kern-.35em, and functional classes such as $\GapP
-\hbox{\small \GapP}$\kern-.35em. But I like them all.
-\end{quote} % Internal note: the negative kerning was added here
- % for illustration only, the package typesets these classes
- % with a correct amount of spacing when |small| is used!
+There are deterministic classes such as $\PSPACE$, nondeterministic
+classes such as $\NP$, and functional classes such as $\GapP$. But
+I like them all.
+\end{quote}
-In the preceding pairs, the first was typeset in the document's
-default font size while the second was typeset 1pt smaller
-(internally, the |\small| command is used). The difference is
-subtle but when used in a long text, flows more naturally.
+\begin{quote}
+There are deterministic classes such as $\hbox{\small\PSPACE}$,
+nondeterministic classes such as $\hbox{\small \NP}$, and functional
+classes such as $\hbox{\small \GapP}$. But I like them all.
+\end{quote}
-To get the same effect using |complexity|, simply use the |small|
-option (i.e. |\usepackage[small]{complexity}| with any combination
-of the other options (it works for all fonts, but some do not look
-as good as others; |typewriter| for example looks bad with this
-option). Remember, however that this option only affects how classes
-are typeset, not languages.
+To get the same effect using |complexity|, use the |small|
+option:
-It should be noted that this option only affects how classes are
-typeset in the display and in-line mathmodes. It has no effect in,
-say, a footnote or some special environment. Subscripts,
+|\usepackage[small]{complexity}|
+
+with any combination of the other options (it works for all
+fonts, but some do not look as good as others; |typewriter|
+for example looks bad with this option). Remember, however
+that this option only affects how classes are typeset, not
+languages.
+
+This option only affects how classes are
+typeset in the display and in-line mathmodes. It has no effect in
+a footnote or some special environment. Subscripts,
superscripts (as well as subsubscripts and supersuperscripts) are
-not effected either---\TeX\ is allowed to automatically change font
+not effected either. \TeX\ is allowed to automatically change font
sizes for these cases.
-
-\section{Using the Package}
-
-Each of the commands is defined using |\ensuremath| so that you need
-not be in \LaTeX's mathmode to use them. A word of warning,
-however, if you use a command outside of mathmode, \TeX\ may not
-properly insert surrounding whitespace. Thus, its best to always
-use |complexity| commands inside mathmode. A complete list of
-commands for classes can be found in Section
-\ref{sec:CompleteListOfComplexityCommands}.
-
\subsection{Overridden Commands}
Three commands in the |complexity| package override built-in \TeX\
@@ -278,15 +222,27 @@
use them. To use any of these symbols, use the commands
|\defaultL|, |\defaultP|, and |\defaultS| instead.
-Additionally, it may be the case that other \LaTeX\ packages are
-loaded that already define (or redefine) some of the commands in the
-|complexity| package. If this is the case, please email me so that
-I can work something out for future updates. The quick solution is
-to simply comment out the definition of the conflicting command in
-|complexity.sty| and directly use |\ComplexityFont{}| to typeset
-your complexity class (see also Section \ref{sec:Customization} -
-Customization).
+In some situations this redefinition is not desirable (if you need
+these symbols but cannot use the |\default| versions). You can
+disable the overriding of these three commands using the option
+|disableredefinitions|; for example:
+|\usepackage[disableredefinitions]{complexity}|
+
+Three alternatives are defined if you disable the overrides:
+|\cL|, |\cP| and |\cS| that typeset the classes $\cL$, $\cP$
+and $\cS$ respectively.
+
+
+\section{Using the Package}
+
+Each of the commands is defined using |\ensuremath| so that you
+need not be in \LaTeX's mathmode to use them. However, if you
+use a command outside of mathmode, \TeX\ may not properly insert
+surrounding whitespace. It is recommended to always use |complexity|
+commands inside mathmode. A complete list of commands for classes
+can be found in Section \ref{sec:CompleteListOfComplexityCommands}.
+
\subsection{Special Commands}
In addition to complexity classes, the |complexity| package also
@@ -305,10 +261,10 @@
\centering %
\caption{\texttt{func} Commands} %
\label{table:SpecialCommands}
-\begin{tabular}{llp{7cm}}
+\begin{tabular}{llp{8cm}}
Command & Result & Comment \\
-\hline\hline\\
-|\llog| & $\llog$ & Denotes logarithmic functions. Note that the command %
+\hline\hline
+|\llog| & $\llog$ & Denotes logarithmic functions. The command %
is invoked with \emph{two} l's so as to not interfere
with the \LaTeX\ |\log| command.\\
|\poly| & $\poly$ & Denotes polynomial functions \\
@@ -324,9 +280,9 @@
\subsection{Language Commands}
-|complexity| also defines commands to typeset languages (subsets of
-$\{0,1\}^*$). A complete list of predefined language commands can
-be found in Table \ref{table:LanguageCommands} below. The number of
+|complexity| also defines commands to typeset languages.
+A complete list of predefined language commands can
+be found in Table \ref{table:LanguageCommands}. The number of
commands is sparse; this was intentional. How one refers to
languages is far less standard than how one refers to classes. Some
people like to explicitly write \emph{every} word
@@ -527,34 +483,11 @@
\hrule
-For an even more complicated example, check out the \LaTeX ed (PDF)
-version of the Complexity Zoo (\url{http://www.ComplexityZoo.com})
-available on my webpage (\url{http://www.cse.unl.edu/~cbourke})
-
-\section{Feedback}
-
-I'd very much appreciate feedback that would improve this package.
-Specifically, I'm looking for the following.
-
-\begin{itemize}
-
- \item Inconsistencies in (or suggestions for better) notation
-
- \item Errors, Typos, etc
-
- \item Incompatibilities with other packages
-
- \item Feature requests
-
-\end{itemize}
-
-You can email me at
-\href{mailto:cbourke at cse.unl.edu}{cbourke at cse.unl.edu}
-
\subsection{Acknowledgements}
I'd like to thank Till Tantau for several useful suggestions and
feature requests as well as some clever code segments for the
-|small| option.
+|small| option. I'd also like to thank Enrico Gregorio for the
+suggested fix to disable redefinitions.
\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/complexity/complexity.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/complexity/complexity.sty 2017-09-16 20:47:06 UTC (rev 45321)
+++ trunk/Master/texmf-dist/tex/latex/complexity/complexity.sty 2017-09-16 20:47:20 UTC (rev 45322)
@@ -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]
+\ProvidesPackage{complexity}[09/16/17 \space v0.81a]
-\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 at cse.unl.edu) ^^J%
- \space\space +----------------------------------------------+}
-
% 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 at fullmode} %
\setboolean{complexity at fullmode}{true}
\DeclareOption{full}{%
@@ -83,14 +98,11 @@
\setboolean{complexity at fullmode}{false}%
} %
-%%Begin Till Here
-%\DeclareOption{roman}{\renewcommand{\complexity at fontcommand{\mathrm}}}
-%\DeclareOption{bold}{\renewcommand{\complexity at fontcommand{\mathbf}}}
-%...
+\newif\ifcomplexity at noredef
+\DeclareOption{disableredefinitions}{\complexity at noredeftrue}
\DeclareOption{sanserif}{
\renewcommand{\complexity at fontcommand}{\mathsf}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathsf{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathsf{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathsf{#1}}}}
}
@@ -97,7 +109,6 @@
\DeclareOption{roman}{
\renewcommand{\complexity at fontcommand}{\mathrm}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathrm{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathrm{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathrm{#1}}}}
}
@@ -104,7 +115,6 @@
\DeclareOption{bold}{
\renewcommand{\complexity at fontcommand}{\mathbf}
- %old: \renewcommand{\ComplexityFont}[1]{{\hbox{\ensuremath{\mathbf{#1}}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathbf{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathbf{#1}}}}
}
@@ -111,7 +121,6 @@
\DeclareOption{typewriter}{
\renewcommand{\complexity at fontcommand}{\mathtt}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathtt{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathtt{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathtt{#1}}}}
}
@@ -118,7 +127,6 @@
\DeclareOption{italic}{
\renewcommand{\complexity at fontcommand}{\mathit}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathit{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\mathit{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\mathit{#1}}}}
}
@@ -125,7 +133,6 @@
\DeclareOption{caps}{
\renewcommand{\complexity at fontcommand}{\textsc}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\textsc{#1}}}}
\renewcommand{\lang}[1]{{\ensuremath{\textsc{#1}}}}
\renewcommand{\func}[1]{{\ensuremath{\textsc{#1}}}}
}
@@ -132,7 +139,6 @@
\DeclareOption{slant}{
\renewcommand{\complexity at 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 at fontcommand}{\mathsf}
- %old: \renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathsf{#1}}}}
}
\DeclareOption{classfont=roman}{
\renewcommand{\complexity at fontcommand}{\mathrm}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathrm{#1}}}}
}
\DeclareOption{classfont=bold}{
\renewcommand{\complexity at fontcommand}{\mathbf}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathbf{#1}}}}
}
\DeclareOption{classfont=typewriter}{
\renewcommand{\complexity at fontcommand}{\mathtt}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathtt{#1}}}}
}
\DeclareOption{classfont=italic}{
\renewcommand{\complexity at fontcommand}{\mathit}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\mathit{#1}}}}
}
\DeclareOption{classfont=caps}{
\renewcommand{\complexity at fontcommand}{\textsc}
- %\renewcommand{\ComplexityFont}[1]{{\ensuremath{\textsc{#1}}}}
}
\DeclareOption{classfont=slant}{
\renewcommand{\complexity at 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 at 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 at kern}{{\kern-.10em}} % note: more {} don't seem to matter, good
+\newcommand{\complexity at kern}{{\kern-.10em}}
\newcommand{\complexity at hyphen}{ %
\lower-.12em\hbox{\textrm{-}} %
}
@@ -282,15 +275,23 @@
\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 at 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
%%%%%%% Standard Classes
More information about the tex-live-commits
mailing list