diff options
author | Karl Berry <karl@freefriends.org> | 2009-01-24 16:35:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-01-24 16:35:39 +0000 |
commit | 89bd3c91a3106d658db88156e2006b8920c0e9cf (patch) | |
tree | 3b8afa1e521d8f253dbb6e0053ba79c82a64aeb1 /Master/texmf-dist/source/latex/cmll | |
parent | bc73750e2889e33eec7f44eb8ca8ebe6e99708a7 (diff) |
cmll update (22jan09)
git-svn-id: svn://tug.org/texlive/trunk@11958 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/cmll')
-rw-r--r-- | Master/texmf-dist/source/latex/cmll/cmll.dtx | 225 |
1 files changed, 194 insertions, 31 deletions
diff --git a/Master/texmf-dist/source/latex/cmll/cmll.dtx b/Master/texmf-dist/source/latex/cmll/cmll.dtx index feb55efab5b..11d254f2acb 100644 --- a/Master/texmf-dist/source/latex/cmll/cmll.dtx +++ b/Master/texmf-dist/source/latex/cmll/cmll.dtx @@ -1,6 +1,6 @@ % \title{Linear Logic symbols for Computer Modern} % \author{Emmanuel Beffara} -% \date{February 22, 2006} +% \date{January 23, 2009} % % \maketitle % @@ -27,6 +27,10 @@ % \end{itemize} % You may have to update \TeX's databases by running |texhash| or |mktexlsr| % (this is for Kpathsea-based distributions like te\TeX) or a similar command. +% You may also have to register the map file for the Type1 fonts using +% |updmap|, depending on your installation. +% Linux users using Debian or Ubuntu can avoid all this by using the package +% at |http://iml.univ-mrs.fr/~beffara/soft/| (updated more often than TexLive). % % \subsection{Package loading} % @@ -37,30 +41,45 @@ % cm & Computer Modern serif \\ % ss & Computer Modern sans serif \\ % euler & AMS Euler \\ -% auto & automatic selection (default) +% emu & emulation mode (see section~\ref{selection}) \\ +% auto & automatic selection among the above +% (default, see section~\ref{selection}) % \end{tabular} % \end{quote} -% Automatic selection is done by looking at the loaded packages and the -% current font settings. Note that this works only when \texttt{cmll} is -% loaded \emph{after} changing those settings. % % \subsection{Symbols} % % The \texttt{cmll} font defines a handful of symbols useful in linear logic % that were not defined in other fonts and packages. % \begin{symbols}{Unary operators:} -% \dosymbol\oc \dosymbol\wn -% \dosymbol\shpos \dosymbol\shneg \dosymbol\shift +% \dosymbol\oc +% \dosymbol\wn +% \dosymbol\shpos +% \dosymbol\shneg +% \dosymbol\shift % \end{symbols} % \begin{symbols}{Binary operators:} -% \dosymbol\parr \dosymbol\with +% \dosymbol\parr +% \dosymbol\invamp +% \dosymbol\with % \end{symbols} % \begin{symbols}{Large operators:} -% \dosymbol\bigparr \dosymbol\bigwith +% \dosymbol\bigparr +% \dosymbol\biginvamp +% \dosymbol\bigwith % \end{symbols} % \begin{symbols}{Binary relations:} -% \dosymbol\coh \dosymbol\scoh -% \dosymbol\incoh \dosymbol\sincoh +% \dosymbol\coh +% \dosymbol\scoh +% \dosymbol\incoh +% \dosymbol\sincoh +% \dosymbol\multimapboth +% \dosymbol\Perp +% \dosymbol\simperp +% \end{symbols} +% \begin{symbols}{Letter-like symbols:} +% \dosymbol\Bot +% \dosymbol\simbot % \end{symbols} % The symbols $\oc$, $\wn$ and $\with$ are actually characters from the % standard Computer Modern fonts declared with a new math code to get proper @@ -70,12 +89,62 @@ % \verb/A = !B/ & $A = !B$ & \verb/A = \oc B/ & $A = \oc B$ \\ % \verb/A = ?B/ & $A = ?B$ & \verb/A = \wn B/ & $A = \wn B$ % \end{tabular}\] +% The names |\parr| and |\invamp| are synonyms, the names |\bigparr| and +% |\biginvamp| too. The macros |\biginvampemu| and |\bigwithemu| provide +% emulations for the |\biginvamp| and |\bigwith| symbols, built using the +% normal symbols at different sizes (using the |relsize| package). In +% emulation mode (i.e. with the package option |emu|) the names |\biginvamp| +% and |\bigwith| are synonyms for them. +% +% \subsection{Emulation and automatic selection} +% \label{selection} +% +% If you use a math font family other than Computer Modern or Euler, you may +% have an ampersand symbol that does not match the reversed ampersand from any +% variant of CMLL. In this case, the |cmll| package provides a ``poor man'' +% version of the reversed ampersand and large ampersands, built using the +% standard |\&| symbol. +% Also provided are the ``big'' variants of |\with| and |\invamp| built using +% the normal version at a different size (using the |relsize| package). +% These versions can be used explicitly under the names |\invampemu|, +% |\bigwithemu| and |\biginvampemu|. +% +% In the emulation mode, that is when the package is loaded with the |emu| +% option, these variants are used instead of the symbols provided by the +% font. +% Moreover, in emulation mode, any symbol that already exists is preserved by +% |cmll|, otherwise all symbols are redefined. +% This is useful for instance with |txfonts|, which already provides |\invamp| +% and |\multimapboth|. +% Note that this feature works only if the package |cmll| is loaded +% \emph{after} loading any package that might define one of the symbols +% provided by CMLL. +% +% The automatic selection works as follows: +% \begin{itemize} +% \item if |euler| is loaded, use the Euler variant, +% \item if |txfonts| or |pxfonts| is loaded, use the emulation mode, +% \item if the default font is |cmss|, use the |ss| variant, +% \item otherwise use the |cm| variant. +% \end{itemize} +% +% \subsection{History} +% +% \begin{description} +% \item [2009-01-23] +% New symbols: |\multimapboth|, |\Perp|, |\Bot|, |\simperp|, |\simbot|. +% Synonyms |\invamp| and |\biginvamp| added for compatibility. +% New package option |emu|. +% Various fixes and code improvements. +% \item [2006-02-22] +% First public release. +% \end{description} % % % \section{Files} % % \subsection{This document} -% +% % \begin{macrocode} %<*driver> \documentclass{ltxdoc} @@ -103,10 +172,15 @@ %<*ucmllr> \DeclareFontShape{U}{cmllr}{m}{n}{% <5><6><7><8><9>gen*cmllr% - <10->cmllr10}{} + <10><10.95>cmllr10% + <12><14.4>cmllr12% + <17.28->cmllr17% + }{} \DeclareFontShape{U}{cmllr}{bx}{n}{% <5><6><7><8><9>gen*cmllbx% - <10->cmllbx10}{} + <10><10.95>cmllbx10% + <12->cmllbx12% + }{} %</ucmllr> % \end{macrocode} % @@ -118,7 +192,10 @@ \DeclareFontShape{U}{cmllss}{m}{n}{% <-8>cmllss8% <9>cmllss9% - <10->cmllss10}{} + <10>cmllss10 + <12><14.4>cmllss12% + <17.28->cmllss17% + }{} \DeclareFontShape{U}{cmllss}{bx}{n}{% <->cmllssbx10}{} %</ucmllss> @@ -143,7 +220,16 @@ % \begin{macrocode} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{cmll}[2006/02/22 Linear Logic symbols for Computer Modern] +\ProvidesPackage{cmll}[2009/01/23 Linear Logic symbols for Computer Modern] +% \end{macrocode} +% +% With the package option |emu|, symbols already defined are used and +% |\invamp| (if undefined) is made by rotation using an ampersand. This +% requires the |graphicx| package. +% +% \begin{macrocode} +\let\cmll@ifemu=\iffalse +\DeclareOption{emu}{\let\cmll@ifemu=\iftrue} % \end{macrocode} % % The font is declared as a symbol font named \texttt{llsymbols}, in normal @@ -157,16 +243,23 @@ % \end{macrocode} % % The following code is used to detect which family should be used. Euler is -% detected if its package is loaded, sans-serif is detected by looking at the -% default font family name. +% detected if its package is loaded, emulation is activated for txfonts and +% pxfonts, sans-serif is detected by looking at the default font family name. % \begin{macrocode} \RequirePackage{ifthen} \def\cmll@use@auto{% \@ifpackageloaded{euler}{% \def\cmll@style{euler}}{% - \ifthenelse{\equal{\rmdefault}{cmss}}{% - \def\cmll@style{ss}}{% - \def\cmll@style{cm}}}% + \@ifpackageloaded{txfonts}{% + \let\cmll@ifemu=\iftrue% + \def\cmll@style{cm}}{% + \@ifpackageloaded{pxfonts}{% + \let\cmll@ifemu=\iftrue% + \def\cmll@style{cm}}{% + \ifthenelse{\equal{\rmdefault}{cmss}}{% + \def\cmll@style{ss}}{% + \def\cmll@style{cm}}% + }}}% \csname cmll@use@\cmll@style\endcsname} % \end{macrocode} % @@ -203,18 +296,88 @@ \csname cmll@use@\cmll@style\endcsname % \end{macrocode} % +% In some cases it is preferable to emulate the |\invamp| by rotating the +% ampersand symbol. Here is a robust definition of this rotation: +% \begin{macrocode} +\newcommand\invampemu{% + \mathbin{\mathchoice% + {\rotatebox[origin=c]{180}{$\&$}}% + {\rotatebox[origin=c]{180}{$\&$}}% + {\rotatebox[origin=c]{180}{$\scriptstyle\&$}}% + {\rotatebox[origin=c]{180}{$\scriptscriptstyle\&$}}% + }} +% \end{macrocode} +% We may also want to emulate the big versions of the ampersand. In this case +% we change ther text size appropriately for each style, using the |relsize| +% package. This version is reasonable at normal size and becomes approximative +% when math is composed in small or large sizes. +% \begin{macrocode} +\newcommand\bigwithemu{% + \mathop{\mathchoice% + {\vcenter{\hbox{\relsize{+4}$\&$}}}% + {\vcenter{\hbox{\relsize{+2}$\&$}}}% + {\vcenter{\hbox{\relsize{+0.5}$\&$}}}% + {\vcenter{\hbox{\relsize{-1}$\&$}}}% + }} +% \end{macrocode} +% For the large inversed ampersand, we call the |\invamp| macro, which is +% supposed to be defined (either as a proper character or as an emulation as +% above). When it is emulated, this makes two nested |\mathchoice|s, which is +% not very efficient. +% \begin{macrocode} +\newcommand\biginvampemu{% + \mathop{\mathchoice% + {\vcenter{\hbox{\relsize{+4}$\invamp$}}}% + {\vcenter{\hbox{\relsize{+2}$\invamp$}}}% + {\vcenter{\hbox{\relsize{+0.5}$\invamp$}}}% + {\vcenter{\hbox{\relsize{-1}$\invamp$}}}}} +% \end{macrocode} +% +% The actual commands |\invamp|, |\bigwith| and |\biginvamp| can be defined in +% various ways depending on the setup. +% +% \begin{macrocode} +\cmll@ifemu + \@ifundefined{invamp}{% + \RequirePackage{graphicx}% + \let\invamp=\invampemu + }{}% + \RequirePackage{relsize}% + \let\bigwith=\bigwithemu + \let\biginvamp=\biginvampemu +% \end{macrocode} +% Already existing symbols are preserved in emulation mode. +% \begin{macrocode} + \def\cmll@declare@symbol#1#2#3#4{% + \@ifundefined{#1}{% + \expandafter\DeclareMathSymbol% + \expandafter{\csname#1\endcsname}{#2}{#3}{#4}}{}} +\else + \def\cmll@declare@symbol#1#2#3#4{% + \expandafter\DeclareMathSymbol% + \expandafter{\csname#1\endcsname}{#2}{#3}{#4}} +\fi +% \end{macrocode} +% % The new symbol definitions are the same for all variants. % \begin{macrocode} -\DeclareMathSymbol{\parr}{\mathbin}{llsymbols}{0} -\DeclareMathSymbol{\shpos}{\mathord}{llsymbols}{1} -\DeclareMathSymbol{\shneg}{\mathord}{llsymbols}{2} -\DeclareMathSymbol{\shift}{\mathord}{llsymbols}{3} -\DeclareMathSymbol{\coh}{\mathrel}{llsymbols}{4} -\DeclareMathSymbol{\scoh}{\mathrel}{llsymbols}{5} -\DeclareMathSymbol{\incoh}{\mathrel}{llsymbols}{6} -\DeclareMathSymbol{\sincoh}{\mathrel}{llsymbols}{7} -\DeclareMathSymbol{\bigwith}{\mathop}{llsymbols}{8} -\DeclareMathSymbol{\bigparr}{\mathop}{llsymbols}{10} +\cmll@declare@symbol{invamp}{\mathbin}{llsymbols}{0} +\let\parr=\invamp +\cmll@declare@symbol{shpos}{\mathord}{llsymbols}{1} +\cmll@declare@symbol{shneg}{\mathord}{llsymbols}{2} +\cmll@declare@symbol{shift}{\mathord}{llsymbols}{3} +\cmll@declare@symbol{coh}{\mathrel}{llsymbols}{4} +\cmll@declare@symbol{scoh}{\mathrel}{llsymbols}{5} +\cmll@declare@symbol{incoh}{\mathrel}{llsymbols}{6} +\cmll@declare@symbol{sincoh}{\mathrel}{llsymbols}{7} +\cmll@declare@symbol{bigwith}{\mathop}{llsymbols}{8} +\cmll@declare@symbol{biginvamp}{\mathop}{llsymbols}{10} +\let\bigparr=\biginvamp +\cmll@declare@symbol{multimapboth}{\mathrel}{llsymbols}{12} +\cmll@declare@symbol{Bot}{\mathord}{llsymbols}{13} +\cmll@declare@symbol{Perp}{\mathrel}{llsymbols}{13} +\cmll@declare@symbol{simbot}{\mathord}{llsymbols}{14} +\cmll@declare@symbol{simperp}{\mathrel}{llsymbols}{14} %</package> % \end{macrocode} % |