summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cmll/cmll.dtx
blob: feb55efab5ba58b255f6dfd20befe8ef23865331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
% \title{Linear Logic symbols for Computer Modern}
% \author{Emmanuel Beffara}
% \date{February 22, 2006}
%
% \maketitle
%
% \section{Documentation}
%
% \subsection{Installation}
%
% The installation consists in copying the |.mf| files from the |mf|
% subdirectory somewhere in Metafont's search path and the |.sty| and |.fd|
% files from the |latex| subdirectory somewhere in \LaTeX's search path.
%
% Call |TEXMF| the base directory of your installation (on Unix this should be
% something like |/usr/share/texmf| or |~/texmf| for a single user
% installation). Then copy the directories as follows:
% \begin{itemize}
%   \item copy |mf| as |TEXMF/fonts/source/public/cmll|
%   \item copy |latex| as |TEXMF/tex/latex/cmll|
% \end{itemize}
% If you want to install the fonts in Type1 format:
% \begin{itemize}
%   \item copy |type1| as |TEXMF/fonts/type1/public/cmll|
%   \item copy |tfm| as |TEXMF/fonts/tfm/public/cmll|
%   \item copy |cmll.map| as |TEXMF/fonts/map/dvips/misc/cmll.map|
% \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.
%
% \subsection{Package loading}
%
% The package is loaded by simply saying |\usepackage{cmll}|. The variant of
% the font that should be used is chosen using the following package options:
% \begin{quote}
%   \begin{tabular}{>{\ttfamily}ll}
%     cm & Computer Modern serif \\
%     ss & Computer Modern sans serif \\
%     euler & AMS Euler \\
%     auto & automatic selection (default)
%   \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
% \end{symbols}
% \begin{symbols}{Binary operators:}
% \dosymbol\parr \dosymbol\with
% \end{symbols}
% \begin{symbols}{Large operators:}
% \dosymbol\bigparr \dosymbol\bigwith
% \end{symbols}
% \begin{symbols}{Binary relations:}
% \dosymbol\coh \dosymbol\scoh
% \dosymbol\incoh \dosymbol\sincoh
% \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
% spacing. See the following examples:
% \[\begin{tabular}{ll@{\hspace{4em}}ll}
%   \verb/A \& B/ & $A \& B$ & \verb/A \with B/ & $A \with B$ \\
%   \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}\]
%
%
% \section{Files}
%
% \subsection{This document}
% 
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\usepackage{array,cmll}
\newenvironment{symbols}[1]{%
  \par%
  \def\dosymbol##1{\leavevmode\hbox to .5\textwidth{%
    \kern.25\textwidth \hbox to 2em{\hss$##1$\hfil}%
    \texttt{\string##1}\hss}\penalty10}%
  \flushleft%
  #1\strut\\}{\endflushleft}
\begin{document}
\DocInput{cmll.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
% \subsection{Font definitions}
%
% The font definition file is deduced from the ones for Computer Modern. We
% provide an NFSS entry named \texttt{cmllr} in medium and bold extended
% versions.
%
%    \begin{macrocode}
%<*ucmllr>
\DeclareFontShape{U}{cmllr}{m}{n}{%
      <5><6><7><8><9>gen*cmllr%
      <10->cmllr10}{}
\DeclareFontShape{U}{cmllr}{bx}{n}{%
      <5><6><7><8><9>gen*cmllbx%
      <10->cmllbx10}{}
%</ucmllr>
%    \end{macrocode}
%
% The following is a definition for the sans-serif version, named
% \texttt{cmllss}.
%
%    \begin{macrocode}
%<*ucmllss>
\DeclareFontShape{U}{cmllss}{m}{n}{%
      <-8>cmllss8%
      <9>cmllss9%
      <10->cmllss10}{}
\DeclareFontShape{U}{cmllss}{bx}{n}{%
      <->cmllssbx10}{}
%</ucmllss>
%    \end{macrocode}
%
% The following is a definition for the Euler-style version, named
% \texttt{eull}.
%
%    \begin{macrocode}
%<*ueull>
\DeclareFontShape{U}{eull}{m}{n}{%
      <5><6><7><8><9>gen*eullr%
      <10->eullr10}{}
\DeclareFontShape{U}{eull}{bx}{n}{%
      <5><6><7><8><9>gen*eullbx%
      <10->eullbx10}{}
%</ueull>
%    \end{macrocode}
%
% \subsection{The package}
%
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cmll}[2006/02/22 Linear Logic symbols for Computer Modern]
%    \end{macrocode}
%
% The font is declared as a symbol font named \texttt{llsymbols}, in normal
% and bold versions. We provide package options to switch between the
% standard, sans-serif and Euler-style variants.
%
%    \begin{macrocode}
\def\cmll@style{auto}
\DeclareOption*{\edef\cmll@style{\CurrentOption}}
\ProcessOptions\relax
%    \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.
%    \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}}}%
  \csname cmll@use@\cmll@style\endcsname}
%    \end{macrocode}
%
% The following macros are used to set up the font families and symbols from
% other fonts.
%    \begin{macrocode}
\def\cmll@use@cm{%
  \DeclareSymbolFont{llsymbols}{U}{cmllr}{m}{n}%
  \SetSymbolFont{llsymbols}{bold}{U}{cmllr}{bx}{n}%
  \DeclareMathSymbol{\with}{\mathbin}{operators}{`\&}%
  \DeclareMathSymbol{\oc}{\mathord}{operators}{`!}%
  \DeclareMathSymbol{\wn}{\mathord}{operators}{`?}}
%    \end{macrocode}
% Here is the sans-serif variant.
%    \begin{macrocode}
\def\cmll@use@ss{%
  \DeclareSymbolFont{llsymbols}{U}{cmllss}{m}{n}%
  \SetSymbolFont{llsymbols}{bold}{U}{cmllss}{bx}{n}%
  \DeclareMathSymbol{\with}{\mathbin}{operators}{`\&}%
  \DeclareMathSymbol{\oc}{\mathord}{operators}{`!}%
  \DeclareMathSymbol{\wn}{\mathord}{operators}{`?}}
%    \end{macrocode}
% And here is the Euler variant.
%    \begin{macrocode}
\def\cmll@use@euler{%
  \DeclareSymbolFont{llsymbols}{U}{eull}{m}{n}%
  \SetSymbolFont{llsymbols}{bold}{U}{eull}{bx}{n}%
  \DeclareMathSymbol{\with}{\mathbin}{EulerFraktur}{"26}%
  \DeclareMathSymbol{\oc}{\mathord}{EulerFraktur}{"21}%
  \DeclareMathSymbol{\wn}{\mathord}{EulerFraktur}{"3F}}
%    \end{macrocode}
% Finally we activate the proper variant.
%    \begin{macrocode}
\csname cmll@use@\cmll@style\endcsname
%    \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}
%</package>
%    \end{macrocode}
%
% \Finale