Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % File: centernot.dtx
4 % Version: 2016/05/16 v1.4
5 % Info: Centers the not symbol horizontally
6 %
7 % Copyright (C)
8 % 2006, 2007, 2010, 2011 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 centernot.dtx
29 % and the derived files
30 % centernot.sty, centernot.pdf, centernot.ins, centernot.drv.
31 %
32 % Distribution:
33 % CTAN:macros/latex/contrib/oberdiek/centernot.dtx
34 % CTAN:macros/latex/contrib/oberdiek/centernot.pdf
35 %
36 % Unpacking:
37 % (a) If centernot.ins is present:
38 % tex centernot.ins
39 % (b) Without centernot.ins:
40 % tex centernot.dtx
41 % (c) If you insist on using LaTeX
42 % latex \let\install=y\input{centernot.dtx}
43 % (quote the arguments according to the demands of your shell)
44 %
45 % Documentation:
46 % (a) If centernot.drv is present:
47 % latex centernot.drv
48 % (b) Without centernot.drv:
49 % latex centernot.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 centernot.dtx
57 % makeindex -s gind.ist centernot.idx
58 % pdflatex centernot.dtx
59 % makeindex -s gind.ist centernot.idx
60 % pdflatex centernot.dtx
61 %
62 % Installation:
63 % TDS:tex/latex/oberdiek/centernot.sty
64 % TDS:doc/latex/oberdiek/centernot.pdf
65 % TDS:source/latex/oberdiek/centernot.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: centernot 2016/05/16 v1.4 Centers the not symbol horizontally (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: centernot
94 Version: 2016/05/16 v1.4
95
96 Copyright (C)
97 2006, 2007, 2010, 2011 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 centernot.dtx
118 and the derived files
119 centernot.sty, centernot.pdf, centernot.ins, centernot.drv.
120
121 \endpreamble
122 \let\MetaPrefix\DoubleperCent
123
124 \generate{%
125 \file{centernot.ins}{\from{centernot.dtx}{install}}%
126 \file{centernot.drv}{\from{centernot.dtx}{driver}}%
127 \usedir{tex/latex/oberdiek}%
128 \file{centernot.sty}{\from{centernot.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{* centernot.sty}
139 \Msg{*}
140 \Msg{* To produce the documentation run the file `centernot.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{centernot.drv}%
155 [2016/05/16 v1.4 Centers the not symbol horizontally (HO)]%
156 \documentclass{ltxdoc}
157 \makeatletter
158 %\@namedef{[email protected]}{}
159 \@namedef{[email protected]}{}
160 \def\setmathfont#1{}
161 \makeatother
162 \usepackage{holtxdoc}[2011/11/22]
163 \usepackage{centernot}[2016/05/16]
164 \usepackage{amssymb}
165 \DeclareFontFamily{U}{matha}{\hyphenchar\font45}
166 \DeclareFontShape{U}{matha}{m}{n}{%
167 <5> <6> <7> <8> <9> <10> gen * matha %
168 <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12 %
169 }{}
170 \DeclareSymbolFont{matha}{U}{matha}{m}{n}
171 \DeclareMathSymbol{\notdivides}{3}{matha}{"1F}
172 \DeclareMathSymbol{\notrightarrow}{3}{matha}{"DB}
173 \begin{document}
174 \DocInput{centernot.dtx}%
175 \end{document}
176 %</driver>
177 % \fi
178 %
179 %
180 %
181 % \GetFileInfo{centernot.drv}
182 %
183 % \title{The \xpackage{centernot} package}
184 % \date{2016/05/16 v1.4}
185 % \author{Heiko Oberdiek\thanks
186 % {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
187 %
188 % \maketitle
189 %
190 % \begin{abstract}
191 % This package provides \cs{centernot} that prints the symbol
192 % \cs{not} on the following argument. Unlike \cs{not} the symbol
193 % is horizontally centered.
194 % \end{abstract}
195 %
196 % \tableofcontents
197 %
198 % \section{User interface}
199 %
200 % If a negated relational symbol is not available, \cs{not}
201 % can be used to create the negated variant of the relational
202 % symbol. The disadvantage of \cs{not} is that it is put at
203 % a fixed location regardless of the width of the relational
204 % symbol. Therefore \cs{centernot} takes an argument and
205 % measures its width to achieve a better placement of the
206 % symbol \cs{not}.
207 % Examples:
208 % \begin{quote}
209 % \begin{tabular}{@{}cccl@{}}
210 % symbol & \cs{not} & \cs{centernot} &\\
211 % \hline
212 % |=| & $\not=$ & $\centernot=$ & \textit{(definition)}\\
213 % \cs{parallel} & $\not\parallel$ & $\centernot\parallel$\\
214 % \cs{longrightarrow} &
215 % $\not\longrightarrow$ & $\centernot\longrightarrow$
216 % \end{tabular}
217 % \end{quote}
218 % But do not forget that most negated symbols are already
219 % available, e.g.:
220 % \begin{quote}
221 % \begin{tabular}{@{}lllc@{}}
222 % case & package & code & result\\
223 % \hline
224 % \cs{parallel}:
225 % &\xpackage{centernot} & |$A \centernot\parallel B$|
226 % & $A \centernot\parallel B$\\
227 % &\xpackage{amssymb} & |$A \nparallel B$|
228 % & $A\nparallel B$\\
229 % \hline
230 % \cs{mid}:
231 % &\xpackage{centernot} & |$A \centernot\mid B$|
232 % & $A \centernot\mid B$\\
233 % &\xpackage{amssymb} & |$A \nmid B$|
234 % & $A \nmid B$\\
235 % &\xpackage{mathabx} & |$A \notdivides B$|
236 % & $A \notdivides B$\\
237 % \hline
238 % \cs{rightarrow}:
239 % &\xpackage{centernot} & |$A \centernot\rightarrow B$|
240 % & $A \centernot\rightarrow B$\\
241 % &\xpackage{amssymb} & |$A \nrightarrow B$|
242 % & $A \nrightarrow B$\\
243 % &\xpackage{mathabx} & |$A \nrightarrow B$|
244 % & $A \notrightarrow B$\\
245 % \end{tabular}
246 % \end{quote}
247 %
248 % \StopEventually{
249 % }
250 %
251 % \section{Implementation}
252 %
253 % \begin{macrocode}
254 %<*package>
255 \NeedsTeXFormat{LaTeX2e}
256 \ProvidesPackage{centernot}
257 [2016/05/16 v1.4 Centers the not symbol horizontally (HO)]%
258 % \end{macrocode}
259 %
260 % \noindent
261 % \cs{not} is a \cs{mathrel} atom with zero width. It prints itself
262 % outside its character box, similar to \cs{rlap}. The next
263 % \cs{mathrel} symbol is then print on top of it. \TeX\ does not
264 % add space between two \cs{mathrel} atoms. The following implementation
265 % assumes that the math font is designed in such a way that the
266 % position of \cs{not} fits well on the equal symbol.
267 %
268 % The blue boxes marks the character bounding boxes seen by \TeX:
269 % \begin{quote}
270 % \setlength{\fboxrule}{.8pt}
271 % \setlength{\fboxsep}{.8pt}
272 % \def\xbox#1{^^A
273 % \begingroup
274 % \large
275 % \color{blue}%
276 % \fbox{\color{black}\boldmath$#1$}^^A
277 % \kern-2\fboxsep
278 % \kern-2\fboxrule
279 % \endgroup
280 % }
281 % \begin{tabular}{@{}c@{\qquad}c@{\qquad}c@{}}
282 % |\not| & |=| & |\not=|\\
283 % \xbox{\not} & \xbox{=} & \xbox{\not}\xbox{=}
284 % \end{tabular}
285 % \end{quote}
286 % \begin{macro}{\centernot}
287 % \cs{centernot} is not a symbol but a macro that takes
288 % one argument. It measures the width of the argument
289 % and places \cs{not} horizontally centered on that argument.
290 % The result is a \cs{mathrel} atom.
291 % \begin{macrocode}
292 \newcommand*{\centernot}{%
293 \mathpalette\@centernot
294 }
295 \def\@centernot#1#2{%
296 \mathrel{%
297 \rlap{%
298 \settowidth\dimen@{$\m@th#1{#2}$}%
299 \kern.5\dimen@
300 \settowidth\dimen@{$\m@th#1=$}%
301 \kern-.5\dimen@
302 $\m@th#1\not$%
303 }%
304 {#2}%
305 }%
306 }
307 % \end{macrocode}
308 % \end{macro}
309 %
310 % \begin{macrocode}
311 %</package>
312 % \end{macrocode}
313 %
314 % \section{Installation}
315 %
316 % \subsection{Download}
317 %
318 % \paragraph{Package.} This package is available on
319 % CTAN\footnote{\CTANpkg{centernot}}:
320 % \begin{description}
321 % \item[\CTAN{macros/latex/contrib/oberdiek/centernot.dtx}] The source file.
322 % \item[\CTAN{macros/latex/contrib/oberdiek/centernot.pdf}] Documentation.
323 % \end{description}
324 %
325 %
326 % \paragraph{Bundle.} All the packages of the bundle `oberdiek'
327 % are also available in a TDS compliant ZIP archive. There
328 % the packages are already unpacked and the documentation files
329 % are generated. The files and directories obey the TDS standard.
330 % \begin{description}
331 % \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
332 % \end{description}
333 % \emph{TDS} refers to the standard ``A Directory Structure
334 % for \TeX\ Files'' (\CTANpkg{tds}). Directories
335 % with \xfile{texmf} in their name are usually organized this way.
336 %
337 % \subsection{Bundle installation}
338 %
339 % \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
340 % TDS tree (also known as \xfile{texmf} tree) of your choice.
341 % Example (linux):
342 % \begin{quote}
343 % |unzip oberdiek.tds.zip -d ~/texmf|
344 % \end{quote}
345 %
346 % \subsection{Package installation}
347 %
348 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
349 % \docstrip\ archive. The files are extracted by running the
350 % \xfile{.dtx} through \plainTeX:
351 % \begin{quote}
352 % \verb|tex centernot.dtx|
353 % \end{quote}
354 %
355 % \paragraph{TDS.} Now the different files must be moved into
356 % the different directories in your installation TDS tree
357 % (also known as \xfile{texmf} tree):
358 % \begin{quote}
359 % \def\t{^^A
360 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
361 % centernot.sty & tex/latex/oberdiek/centernot.sty\\
362 % centernot.pdf & doc/latex/oberdiek/centernot.pdf\\
363 % centernot.dtx & source/latex/oberdiek/centernot.dtx\\
364 % \end{tabular}^^A
365 % }^^A
366 % \sbox0{\t}^^A
367 % \ifdim\wd0>\linewidth
368 % \begingroup
369 % \advance\linewidth by\leftmargin
370 % \advance\linewidth by\rightmargin
371 % \edef\x{\endgroup
372 % \def\noexpand\lw{\the\linewidth}^^A
373 % }\x
374 % \def\lwbox{^^A
375 % \leavevmode
376 % \hbox to \linewidth{^^A
377 % \kern-\leftmargin\relax
378 % \hss
379 % \usebox0
380 % \hss
381 % \kern-\rightmargin\relax
382 % }^^A
383 % }^^A
384 % \ifdim\wd0>\lw
385 % \sbox0{\small\t}^^A
386 % \ifdim\wd0>\linewidth
387 % \ifdim\wd0>\lw
388 % \sbox0{\footnotesize\t}^^A
389 % \ifdim\wd0>\linewidth
390 % \ifdim\wd0>\lw
391 % \sbox0{\scriptsize\t}^^A
392 % \ifdim\wd0>\linewidth
393 % \ifdim\wd0>\lw
394 % \sbox0{\tiny\t}^^A
395 % \ifdim\wd0>\linewidth
396 % \lwbox
397 % \else
398 % \usebox0
399 % \fi
400 % \else
401 % \lwbox
402 % \fi
403 % \else
404 % \usebox0
405 % \fi
406 % \else
407 % \lwbox
408 % \fi
409 % \else
410 % \usebox0
411 % \fi
412 % \else
413 % \lwbox
414 % \fi
415 % \else
416 % \usebox0
417 % \fi
418 % \else
419 % \lwbox
420 % \fi
421 % \else
422 % \usebox0
423 % \fi
424 % \end{quote}
425 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
426 % TDS installing feature, then some files can already be in the right
427 % place, see the documentation of \docstrip.
428 %
429 % \subsection{Refresh file name databases}
430 %
431 % If your \TeX~distribution
432 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
433 % these. For example, \TeX\,Live\ users run \verb|texhash| or
434 % \verb|mktexlsr|.
435 %
436 % \subsection{Some details for the interested}
437 %
438 % \paragraph{Unpacking with \LaTeX.}
439 % The \xfile{.dtx} chooses its action depending on the format:
440 % \begin{description}
441 % \item[\plainTeX:] Run \docstrip\ and extract the files.
442 % \item[\LaTeX:] Generate the documentation.
443 % \end{description}
444 % If you insist on using \LaTeX\ for \docstrip\ (really,
445 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
446 % about your intention:
447 % \begin{quote}
448 % \verb|latex \let\install=y\input{centernot.dtx}|
449 % \end{quote}
450 % Do not forget to quote the argument according to the demands
451 % of your shell.
452 %
453 % \paragraph{Generating the documentation.}
454 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
455 % the documentation. The process can be configured by the
456 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
457 % line into this file, if you want to have A4 as paper format:
458 % \begin{quote}
459 % \verb|\PassOptionsToClass{a4paper}{article}|
460 % \end{quote}
461 % An example follows how to generate the
462 % documentation with pdf\LaTeX:
463 % \begin{quote}
464 %\begin{verbatim}
465 %pdflatex centernot.dtx
466 %makeindex -s gind.ist centernot.idx
467 %pdflatex centernot.dtx
468 %makeindex -s gind.ist centernot.idx
469 %pdflatex centernot.dtx
470 %\end{verbatim}
471 % \end{quote}
472 %
473 % \begin{History}
474 % \begin{Version}{2006/12/02 v1.0}
475 % \item
476 % First version.
477 % \end{Version}
478 % \begin{Version}{2007/05/31 v1.1}
479 % \item
480 % Real symbols added in documentation part.
481 % \end{Version}
482 % \begin{Version}{2010/03/29 v1.2}
483 % \item
484 % Documentation fix: `negotiated' to `negated' (Hartmut Henkel).
485 % \end{Version}
486 % \begin{Version}{2011/07/11 v1.3}
487 % \item
488 % Superfluous \cs{makeatother} removed (Martin M\"unch).
489 % \end{Version}
490 % \begin{Version}{2016/05/16 v1.4}
491 % \item
492 % Documentation updates.
493 % \end{Version}
494 % \end{History}
495 %
496 % \PrintIndex
497 %
498 % \Finale
499 \endinput