Debian Codegraph @

texmf-dist/source/latex/oberdiek/colonequals.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: colonequals.dtx
4 % Version: 2016/05/16 v1.1
5 % Info: Colon equals symbols
6 %
7 % Copyright (C)
8 % 2006 Heiko Oberdiek
9 % 2016-2019 Oberdiek Package Support Group
10 % https://github.com/ho-tex/oberdiek/issues
11 %
12 % This work may be distributed and/or modified under the
13 % conditions of the LaTeX Project Public License, either
14 % version 1.3c of this license or (at your option) any later
15 % version. This version of this license is in
16 % https://www.latex-project.org/lppl/lppl-1-3c.txt
17 % and the latest version of this license is in
18 % https://www.latex-project.org/lppl.txt
19 % and version 1.3 or later is part of all distributions of
20 % LaTeX version 2005/12/01 or later.
21 %
22 % This work has the LPPL maintenance status "maintained".
23 %
24 % The Current Maintainers of this work are
25 % Heiko Oberdiek and the Oberdiek Package Support Group
26 % https://github.com/ho-tex/oberdiek/issues
27 %
28 % This work consists of the main source file colonequals.dtx
29 % and the derived files
30 % colonequals.sty, colonequals.pdf, colonequals.ins, colonequals.drv.
31 %
32 % Distribution:
33 % CTAN:macros/latex/contrib/oberdiek/colonequals.dtx
34 % CTAN:macros/latex/contrib/oberdiek/colonequals.pdf
35 %
36 % Unpacking:
37 % (a) If colonequals.ins is present:
38 % tex colonequals.ins
39 % (b) Without colonequals.ins:
40 % tex colonequals.dtx
41 % (c) If you insist on using LaTeX
42 % latex \let\install=y\input{colonequals.dtx}
43 % (quote the arguments according to the demands of your shell)
44 %
45 % Documentation:
46 % (a) If colonequals.drv is present:
47 % latex colonequals.drv
48 % (b) Without colonequals.drv:
49 % latex colonequals.dtx; ...
50 % The class ltxdoc loads the configuration file ltxdoc.cfg
51 % if available. Here you can specify further options, e.g.
52 % use A4 as paper format:
53 % \PassOptionsToClass{a4paper}{article}
54 %
55 % Program calls to get the documentation (example):
56 % pdflatex colonequals.dtx
57 % makeindex -s gind.ist colonequals.idx
58 % pdflatex colonequals.dtx
59 % makeindex -s gind.ist colonequals.idx
60 % pdflatex colonequals.dtx
61 %
62 % Installation:
63 % TDS:tex/latex/oberdiek/colonequals.sty
64 % TDS:doc/latex/oberdiek/colonequals.pdf
65 % TDS:source/latex/oberdiek/colonequals.dtx
66 %
67 %<*ignore>
68 \begingroup
69 \catcode123=1 %
70 \catcode125=2 %
71 \def\x{LaTeX2e}%
72 \expandafter\endgroup
73 \ifcase 0\ifx\install y1\fi\expandafter
74 \ifx\csname processbatchFile\endcsname\relax\else1\fi
75 \ifx\fmtname\x\else 1\fi\relax
76 \else\csname fi\endcsname
77 %</ignore>
78 %<*install>
79 \input docstrip.tex
80 \Msg{************************************************************************}
81 \Msg{* Installation}
82 \Msg{* Package: colonequals 2016/05/16 v1.1 Colon equals symbols (HO)}
83 \Msg{************************************************************************}
84
85 \keepsilent
86 \askforoverwritefalse
87
88 \let\MetaPrefix\relax
89 \preamble
90
91 This is a generated file.
92
93 Project: colonequals
94 Version: 2016/05/16 v1.1
95
96 Copyright (C)
97 2006 Heiko Oberdiek
98 2016-2019 Oberdiek Package Support Group
99
100 This work may be distributed and/or modified under the
101 conditions of the LaTeX Project Public License, either
102 version 1.3c of this license or (at your option) any later
103 version. This version of this license is in
104 https://www.latex-project.org/lppl/lppl-1-3c.txt
105 and the latest version of this license is in
106 https://www.latex-project.org/lppl.txt
107 and version 1.3 or later is part of all distributions of
108 LaTeX version 2005/12/01 or later.
109
110 This work has the LPPL maintenance status "maintained".
111
112 The Current Maintainers of this work are
113 Heiko Oberdiek and the Oberdiek Package Support Group
114 https://github.com/ho-tex/oberdiek/issues
115
116
117 This work consists of the main source file colonequals.dtx
118 and the derived files
119 colonequals.sty, colonequals.pdf, colonequals.ins, colonequals.drv.
120
121 \endpreamble
122 \let\MetaPrefix\DoubleperCent
123
124 \generate{%
125 \file{colonequals.ins}{\from{colonequals.dtx}{install}}%
126 \file{colonequals.drv}{\from{colonequals.dtx}{driver}}%
127 \usedir{tex/latex/oberdiek}%
128 \file{colonequals.sty}{\from{colonequals.dtx}{package}}%
129 }
130
131 \catcode32=13\relax% active space
132 \let =\space%
133 \Msg{************************************************************************}
134 \Msg{*}
135 \Msg{* To finish the installation you have to move the following}
136 \Msg{* file into a directory searched by TeX:}
137 \Msg{*}
138 \Msg{* colonequals.sty}
139 \Msg{*}
140 \Msg{* To produce the documentation run the file `colonequals.drv'}
141 \Msg{* through LaTeX.}
142 \Msg{*}
143 \Msg{* Happy TeXing!}
144 \Msg{*}
145 \Msg{************************************************************************}
146
147 \endbatchfile
148 %</install>
149 %<*ignore>
150 \fi
151 %</ignore>
152 %<*driver>
153 \NeedsTeXFormat{LaTeX2e}
154 \ProvidesFile{colonequals.drv}%
155 [2016/05/16 v1.1 Colon equals symbols (HO)]%
156 \documentclass{ltxdoc}
157 \usepackage{holtxdoc}[2011/11/22]
158 \usepackage{colonequals}
159 \usepackage{array}
160 \usepackage{capt-of}
161 \usepackage{longtable}
162 \begin{document}
163 \DocInput{colonequals.dtx}%
164 \end{document}
165 %</driver>
166 % \fi
167 %
168 %
169 %
170 % \GetFileInfo{colonequals.drv}
171 %
172 % \title{The \xpackage{colonequals} package}
173 % \date{2016/05/16 v1.1}
174 % \author{Heiko Oberdiek\thanks
175 % {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
176 %
177 % \maketitle
178 %
179 % \begin{abstract}
180 % Package \xpackage{colonequals} defines poor man's symbols
181 % for math relation symbols such as ``colon equals''.
182 % The colon is centered around the horizontal math axis.
183 % \end{abstract}
184 %
185 % \tableofcontents
186 %
187 % \section{User interface}
188 %
189 % \subsection{Introduction}
190 %
191 % Math symbols consisting of the colon character can be
192 % constructed with the colon text character, if the math font
193 % lacks of the complete symbol. Often, however, the colon text
194 % character is not centered around the math axis. Especially
195 % combined with the equals symbol the composed symbol does not
196 % look symmetrically. Thus this packages defines a colon
197 % math symbol \cs{ratio} that is centered around the horizontal
198 % math axis. Also math symbols are provided that consist of the
199 % colon symbol. The package is not necessary, if the math
200 % font contains the composed symbols. Examples are \textsf{txfonts}
201 % (\cite{txfonts}) or \textsf{mathabx} (\cite{mathabx}).
202 %
203 % \subsection{Symbols}
204 %
205 % All symbols of this package are relation symbols.
206 % The relation property can be changed by the appropriate
207 % \TeX\ command \cs{mathbin}, \cs{mathord}, \dots
208 %
209 % \begin{center}
210 % \captionof{table}{Unicode mathematical operators}
211 % \kern1ex
212 % \begin{tabular}{l>{\scshape}l>{$}l<{$}l}
213 % U+2236 & ratio & \ratio & \cs{ratio} \\
214 % U+2237 & proportion & \coloncolon & \cs{coloncolon} \\
215 % U+2239 & excess & \colonminus & \cs{colonminus} \\
216 % U+2254 & colon equals & \colonequals & \cs{colonequals} \\
217 % U+2255 & equals colon & \equalscolon & \cs{equalscolon} \\
218 % \end{tabular}
219 % \end{center}
220 %
221 % The following grammar generates all symbols that are supported by
222 % this package:
223 % \begin{center}
224 % \captionof{table}{Symbol grammar}
225 % \kern1ex
226 % \begin{tabular}{@{}l>{$}r<{$}l@{}}
227 % symbols & \coloncolonequals & col \\
228 % & \mid & col symbol \\
229 % & \mid & symbol col \\
230 % & ; & \\[1ex]
231 % col & \coloncolonequals & '\texttt{:}' \\
232 % & \mid & '\texttt{::}' \\
233 % & ; & \\[1ex]
234 % symbol & \coloncolonequals & '\texttt{=}' \\
235 % & \mid & '\texttt{-}' \\
236 % & \mid & '$\approx$' \\
237 % & \mid & '$\sim$' \\
238 % & ; &
239 % \end{tabular}
240 % \end{center}
241 %
242 % \def\entry#1{\csname #1\endcsname&\cs{#1}\\}
243 % \def\entryset#1{^^A
244 % \entry{colon#1}^^A
245 % \entry{coloncolon#1}^^A
246 % \entry{#1colon}^^A
247 % \entry{#1coloncolon}^^A
248 % }
249 % \begin{longtable}{>{$}l<{$}l}
250 % \caption{All relation symbols}\\
251 % \entry{ratio}
252 % \entry{coloncolon}
253 % \entryset{equals}
254 % \entryset{minus}
255 % \entryset{approx}
256 % \entryset{sim}
257 % \end{longtable}
258 %
259 % \subsection{Fine tuning}
260 %
261 % The distances in composed symbols can be configured:
262 %
263 % \begin{declcs}{colonsep}
264 % \end{declcs}
265 % Macro \cs{colonsep} is executed between the colon and
266 % the other symbol.
267 %
268 % \begin{declcs}{doublecolonsep}
269 % \end{declcs}
270 % Macro \cs{doublecolonsep} controls the distance between
271 % two colons.
272 %
273 % \subsubsection{Example}
274 % \begin{quote}
275 % \verb|\renewcommand*{\colonsep}{\mskip-.5\thinmuskip}|
276 % \end{quote}
277 %
278 %
279 % \StopEventually{
280 % }
281 %
282 % \section{Implementation}
283 %
284 % \subsection{Identification}
285 %
286 % \begin{macrocode}
287 %<*package>
288 \NeedsTeXFormat{LaTeX2e}
289 \ProvidesPackage{colonequals}%
290 [2016/05/16 v1.1 Colon equals symbols (HO)]%
291 % \end{macrocode}
292 %
293 % \subsection{Distance control}
294 %
295 % \begin{macro}{\colonsep}
296 % \begin{macrocode}
297 \newcommand*{\colonsep}{}
298 % \end{macrocode}
299 % \end{macro}
300 %
301 % \begin{macro}{\doublecolonsep}
302 % \begin{macrocode}
303 \newcommand*{\doublecolonsep}{}
304 % \end{macrocode}
305 % \end{macro}
306 %
307 % \subsection{Centered colons}
308 %
309 % \begin{macrocode}
310 \def\@center@colon{%
311 \mathpalette\@center@math{:}%
312 }
313 \def\@center@math#1#2{%
314 \vcenter{%
315 \m@th
316 \hbox{$#1#2$}%
317 }%
318 }
319 % \end{macrocode}
320 %
321 % \begin{macro}{\ratio}
322 % Because the name \cs{colon} is already in use, the Unicode name
323 % \cs{ratio} is used for the centered colon relation symbol.
324 % (The \cs{ratio} of package \textsf{calc} is not used outside
325 % calc expressions.)
326 % \begin{macrocode}
327 \newcommand*{\ratio}{%
328 \ensuremath{%
329 \mathrel{%
330 \@center@colon
331 }%
332 }%
333 }
334 % \end{macrocode}
335 % \end{macro}
336 %
337 % \begin{macro}{\coloncolon}
338 % \begin{macrocode}
339 \newcommand*{\coloncolon}{%
340 \ensuremath{%
341 \mathrel{%
342 \@center@colon
343 \doublecolonsep
344 \@center@colon
345 }%
346 }%
347 }
348 % \end{macrocode}
349 % \end{macro}
350 %
351 % \subsection{Combined symbols}
352 %
353 % \begin{macrocode}
354 \def\@make@colon@set#1#2{%
355 \begingroup
356 \let\@center@colon\relax
357 \let\newcommand\relax
358 \let\ensuremath\relax
359 \let\mathrel\relax
360 \let\colonsep\relax
361 \let\doublecolonsep\relax
362 \def\csx##1{%
363 \expandafter\noexpand\csname ##1\endcsname
364 }%
365 \edef\x{\endgroup
366 \newcommand*{\csx{colon#1}}{%
367 \ensuremath{%
368 \mathrel{%
369 \@center@colon
370 \colonsep
371 {#2}%
372 }%
373 }%
374 }%
375 \newcommand*{\csx{coloncolon#1}}{%
376 \ensuremath{%
377 \mathrel{%
378 \@center@colon
379 \doublecolonsep
380 \@center@colon
381 \colonsep
382 {#2}%
383 }%
384 }%
385 }%
386 \newcommand*{\csx{#1colon}}{%
387 \ensuremath{%
388 \mathrel{%
389 {#2}%
390 \colonsep
391 \@center@colon
392 }%
393 }%
394 }%
395 \newcommand*{\csx{#1coloncolon}}{%
396 \ensuremath{%
397 \mathrel{%
398 {#2}%
399 \colonsep
400 \@center@colon
401 \doublecolonsep
402 \@center@colon
403 }%
404 }%
405 }%
406 }%
407 \x
408 }
409 % \end{macrocode}
410 %
411 % \begin{macrocode}
412 \@make@colon@set{equals}{=}%
413 \@make@colon@set{minus}{-}%
414 \@make@colon@set{approx}{\approx}
415 \@make@colon@set{sim}{\sim}
416 % \end{macrocode}
417 %
418 % \begin{macrocode}
419 %</package>
420 % \end{macrocode}
421 %
422 % \section{Installation}
423 %
424 % \subsection{Download}
425 %
426 % \paragraph{Package.} This package is available on
427 % CTAN\footnote{\CTANpkg{colonequals}}:
428 % \begin{description}
429 % \item[\CTAN{macros/latex/contrib/oberdiek/colonequals.dtx}] The source file.
430 % \item[\CTAN{macros/latex/contrib/oberdiek/colonequals.pdf}] Documentation.
431 % \end{description}
432 %
433 %
434 % \paragraph{Bundle.} All the packages of the bundle `oberdiek'
435 % are also available in a TDS compliant ZIP archive. There
436 % the packages are already unpacked and the documentation files
437 % are generated. The files and directories obey the TDS standard.
438 % \begin{description}
439 % \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
440 % \end{description}
441 % \emph{TDS} refers to the standard ``A Directory Structure
442 % for \TeX\ Files'' (\CTANpkg{tds}). Directories
443 % with \xfile{texmf} in their name are usually organized this way.
444 %
445 % \subsection{Bundle installation}
446 %
447 % \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
448 % TDS tree (also known as \xfile{texmf} tree) of your choice.
449 % Example (linux):
450 % \begin{quote}
451 % |unzip oberdiek.tds.zip -d ~/texmf|
452 % \end{quote}
453 %
454 % \subsection{Package installation}
455 %
456 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
457 % \docstrip\ archive. The files are extracted by running the
458 % \xfile{.dtx} through \plainTeX:
459 % \begin{quote}
460 % \verb|tex colonequals.dtx|
461 % \end{quote}
462 %
463 % \paragraph{TDS.} Now the different files must be moved into
464 % the different directories in your installation TDS tree
465 % (also known as \xfile{texmf} tree):
466 % \begin{quote}
467 % \def\t{^^A
468 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
469 % colonequals.sty & tex/latex/oberdiek/colonequals.sty\\
470 % colonequals.pdf & doc/latex/oberdiek/colonequals.pdf\\
471 % colonequals.dtx & source/latex/oberdiek/colonequals.dtx\\
472 % \end{tabular}^^A
473 % }^^A
474 % \sbox0{\t}^^A
475 % \ifdim\wd0>\linewidth
476 % \begingroup
477 % \advance\linewidth by\leftmargin
478 % \advance\linewidth by\rightmargin
479 % \edef\x{\endgroup
480 % \def\noexpand\lw{\the\linewidth}^^A
481 % }\x
482 % \def\lwbox{^^A
483 % \leavevmode
484 % \hbox to \linewidth{^^A
485 % \kern-\leftmargin\relax
486 % \hss
487 % \usebox0
488 % \hss
489 % \kern-\rightmargin\relax
490 % }^^A
491 % }^^A
492 % \ifdim\wd0>\lw
493 % \sbox0{\small\t}^^A
494 % \ifdim\wd0>\linewidth
495 % \ifdim\wd0>\lw
496 % \sbox0{\footnotesize\t}^^A
497 % \ifdim\wd0>\linewidth
498 % \ifdim\wd0>\lw
499 % \sbox0{\scriptsize\t}^^A
500 % \ifdim\wd0>\linewidth
501 % \ifdim\wd0>\lw
502 % \sbox0{\tiny\t}^^A
503 % \ifdim\wd0>\linewidth
504 % \lwbox
505 % \else
506 % \usebox0
507 % \fi
508 % \else
509 % \lwbox
510 % \fi
511 % \else
512 % \usebox0
513 % \fi
514 % \else
515 % \lwbox
516 % \fi
517 % \else
518 % \usebox0
519 % \fi
520 % \else
521 % \lwbox
522 % \fi
523 % \else
524 % \usebox0
525 % \fi
526 % \else
527 % \lwbox
528 % \fi
529 % \else
530 % \usebox0
531 % \fi
532 % \end{quote}
533 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
534 % TDS installing feature, then some files can already be in the right
535 % place, see the documentation of \docstrip.
536 %
537 % \subsection{Refresh file name databases}
538 %
539 % If your \TeX~distribution
540 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
541 % these. For example, \TeX\,Live\ users run \verb|texhash| or
542 % \verb|mktexlsr|.
543 %
544 % \subsection{Some details for the interested}
545 %
546 % \paragraph{Unpacking with \LaTeX.}
547 % The \xfile{.dtx} chooses its action depending on the format:
548 % \begin{description}
549 % \item[\plainTeX:] Run \docstrip\ and extract the files.
550 % \item[\LaTeX:] Generate the documentation.
551 % \end{description}
552 % If you insist on using \LaTeX\ for \docstrip\ (really,
553 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
554 % about your intention:
555 % \begin{quote}
556 % \verb|latex \let\install=y\input{colonequals.dtx}|
557 % \end{quote}
558 % Do not forget to quote the argument according to the demands
559 % of your shell.
560 %
561 % \paragraph{Generating the documentation.}
562 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
563 % the documentation. The process can be configured by the
564 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
565 % line into this file, if you want to have A4 as paper format:
566 % \begin{quote}
567 % \verb|\PassOptionsToClass{a4paper}{article}|
568 % \end{quote}
569 % An example follows how to generate the
570 % documentation with pdf\LaTeX:
571 % \begin{quote}
572 %\begin{verbatim}
573 %pdflatex colonequals.dtx
574 %makeindex -s gind.ist colonequals.idx
575 %pdflatex colonequals.dtx
576 %makeindex -s gind.ist colonequals.idx
577 %pdflatex colonequals.dtx
578 %\end{verbatim}
579 % \end{quote}
580 %
581 % \begin{thebibliography}{9}
582 %
583 % \bibitem{txfonts}
584 % Young Ryu: \textit{The TX Fonts};
585 % 2000/12/15;
586 % \CTANpkg{txfonts}.
587 %
588 % \bibitem{mathabx}
589 % Anthony Phan: \textit{Mathabx font series};
590 % 2005/05/16;
591 % \CTANpkg{mathabx}.
592 %
593 % \end{thebibliography}
594 %
595 % \begin{History}
596 % \begin{Version}{2006/08/01 v1.0}
597 % \item
598 % First version.
599 % \end{Version}
600 % \begin{Version}{2016/05/16 v1.1}
601 % \item
602 % Documentation updates.
603 % \end{Version}
604 % \end{History}
605 %
606 % \PrintIndex
607 %
608 % \Finale
609 \endinput