Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % File: chemarr.dtx
4 % Version: 2016/05/16 v1.3
5 % Info: Arrows for chemical reactions
6 %
7 % Copyright (C)
8 % 2001, 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 chemarr.dtx
29 % and the derived files
30 % chemarr.sty, chemarr.pdf, chemarr.ins, chemarr.drv,
31 % chemarr-example.tex.
32 %
33 % Distribution:
34 % CTAN:macros/latex/contrib/oberdiek/chemarr.dtx
35 % CTAN:macros/latex/contrib/oberdiek/chemarr.pdf
36 %
37 % Unpacking:
38 % (a) If chemarr.ins is present:
39 % tex chemarr.ins
40 % (b) Without chemarr.ins:
41 % tex chemarr.dtx
42 % (c) If you insist on using LaTeX
43 % latex \let\install=y\input{chemarr.dtx}
44 % (quote the arguments according to the demands of your shell)
45 %
46 % Documentation:
47 % (a) If chemarr.drv is present:
48 % latex chemarr.drv
49 % (b) Without chemarr.drv:
50 % latex chemarr.dtx; ...
51 % The class ltxdoc loads the configuration file ltxdoc.cfg
52 % if available. Here you can specify further options, e.g.
53 % use A4 as paper format:
54 % \PassOptionsToClass{a4paper}{article}
55 %
56 % Program calls to get the documentation (example):
57 % pdflatex chemarr.dtx
58 % makeindex -s gind.ist chemarr.idx
59 % pdflatex chemarr.dtx
60 % makeindex -s gind.ist chemarr.idx
61 % pdflatex chemarr.dtx
62 %
63 % Installation:
64 % TDS:tex/latex/oberdiek/chemarr.sty
65 % TDS:doc/latex/oberdiek/chemarr.pdf
66 % TDS:doc/latex/oberdiek/chemarr-example.tex
67 % TDS:source/latex/oberdiek/chemarr.dtx
68 %
69 %<*ignore>
70 \begingroup
71 \catcode123=1 %
72 \catcode125=2 %
73 \def\x{LaTeX2e}%
74 \expandafter\endgroup
75 \ifcase 0\ifx\install y1\fi\expandafter
76 \ifx\csname processbatchFile\endcsname\relax\else1\fi
77 \ifx\fmtname\x\else 1\fi\relax
78 \else\csname fi\endcsname
79 %</ignore>
80 %<*install>
81 \input docstrip.tex
82 \Msg{************************************************************************}
83 \Msg{* Installation}
84 \Msg{* Package: chemarr 2016/05/16 v1.3 Arrows for chemical reactions (HO)}
85 \Msg{************************************************************************}
86
87 \keepsilent
88 \askforoverwritefalse
89
90 \let\MetaPrefix\relax
91 \preamble
92
93 This is a generated file.
94
95 Project: chemarr
96 Version: 2016/05/16 v1.3
97
98 Copyright (C)
99 2001, 2006 Heiko Oberdiek
100 2016-2019 Oberdiek Package Support Group
101
102 This work may be distributed and/or modified under the
103 conditions of the LaTeX Project Public License, either
104 version 1.3c of this license or (at your option) any later
105 version. This version of this license is in
106 https://www.latex-project.org/lppl/lppl-1-3c.txt
107 and the latest version of this license is in
108 https://www.latex-project.org/lppl.txt
109 and version 1.3 or later is part of all distributions of
110 LaTeX version 2005/12/01 or later.
111
112 This work has the LPPL maintenance status "maintained".
113
114 The Current Maintainers of this work are
115 Heiko Oberdiek and the Oberdiek Package Support Group
116 https://github.com/ho-tex/oberdiek/issues
117
118
119 This work consists of the main source file chemarr.dtx
120 and the derived files
121 chemarr.sty, chemarr.pdf, chemarr.ins, chemarr.drv,
122 chemarr-example.tex.
123
124 \endpreamble
125 \let\MetaPrefix\DoubleperCent
126
127 \generate{%
128 \file{chemarr.ins}{\from{chemarr.dtx}{install}}%
129 \file{chemarr.drv}{\from{chemarr.dtx}{driver}}%
130 \usedir{tex/latex/oberdiek}%
131 \file{chemarr.sty}{\from{chemarr.dtx}{package}}%
132 \usedir{doc/latex/oberdiek}%
133 \file{chemarr-example.tex}{\from{chemarr.dtx}{example}}%
134 }
135
136 \catcode32=13\relax% active space
137 \let =\space%
138 \Msg{************************************************************************}
139 \Msg{*}
140 \Msg{* To finish the installation you have to move the following}
141 \Msg{* file into a directory searched by TeX:}
142 \Msg{*}
143 \Msg{* chemarr.sty}
144 \Msg{*}
145 \Msg{* To produce the documentation run the file `chemarr.drv'}
146 \Msg{* through LaTeX.}
147 \Msg{*}
148 \Msg{* Happy TeXing!}
149 \Msg{*}
150 \Msg{************************************************************************}
151
152 \endbatchfile
153 %</install>
154 %<*ignore>
155 \fi
156 %</ignore>
157 %<*driver>
158 \NeedsTeXFormat{LaTeX2e}
159 \ProvidesFile{chemarr.drv}%
160 [2016/05/16 v1.3 Arrows for chemical reactions (HO)]%
161 \documentclass{ltxdoc}
162 \usepackage{chemarr}[2016/05/16]
163 \usepackage{holtxdoc}[2011/11/22]
164 \begin{document}
165 \DocInput{chemarr.dtx}%
166 \end{document}
167 %</driver>
168 % \fi
169 %
170 %
171 %
172 % \GetFileInfo{chemarr.drv}
173 %
174 % \title{The \xpackage{chemarr} package}
175 % \date{2016/05/16 v1.3}
176 % \author{Heiko Oberdiek\thanks
177 % {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
178 %
179 % \maketitle
180 %
181 % \begin{abstract}
182 % Very often chemists need a longer version
183 % of reaction arrows (\cs{rightleftharpoons}) with
184 % the possibility to put text above and below.
185 % Analogous to \xpackage{amsmath}'s \cs{xrightarrow} and
186 % \cs{xleftarrow} this package provides the macro
187 % \cs{xrightleftharpoons}.
188 % \end{abstract}
189 %
190 % \tableofcontents
191 %
192 % \section{Usage}
193 %
194 % \DescribeMacro{\xrightleftharpoons}
195 % This \LaTeX\ package defines \cs{xrightleftharpoons}. It prints
196 % extensible arrows (harpoons), usually used in chemical reactions.
197 % It allows to put some text above and below the harpoons and can
198 % be used inside and outside of math mode.
199 %
200 % The package is based on \xpackage{amsmath}, thus it loads it,
201 % if necessary.
202 %
203 % \subsection{Example}
204 %
205 % \begin{macrocode}
206 %<*example>
207 \documentclass{article}
208 \usepackage{chemarr}
209 \begin{document}
210 \begin{center}
211 left
212 \xrightleftharpoons[\text{below}]{\text{above}}
213 right
214 \end{center}
215 \[
216 A
217 \xrightleftharpoons[T \geq 400\,\mathrm{K}]{p > 10\,\mathrm{hPa}}
218 B
219 \]
220 \end{document}
221 %</example>
222 % \end{macrocode}
223 % The result:
224 % \begin{center}
225 % left
226 % \xrightleftharpoons[\text{below}]{\text{above}}
227 % right
228 % \end{center}
229 % \[
230 % A
231 % \xrightleftharpoons[T \geq 400\,\mathrm{K}]{p > 10\,\mathrm{hPa}}
232 % B
233 % \]
234 %
235 % \StopEventually{
236 % }
237 %
238 % \section{Implementation}
239 %
240 % \begin{macrocode}
241 %<*package>
242 % \end{macrocode}
243 % Package identification.
244 % \begin{macrocode}
245 \NeedsTeXFormat{LaTeX2e}
246 \ProvidesPackage{chemarr}%
247 [2016/05/16 v1.3 Arrows for chemical reactions (HO)]
248 % \end{macrocode}
249 %
250 % \begin{macrocode}
251 \RequirePackage{amsmath}
252 % \end{macrocode}
253 % The package \xpackage{amsmath} is needed for the following commands:
254 % \begin{quote}
255 % \cs{ext@arrow}, \cs{@ifnotempty}, \cs{arrowfill@}\\
256 % \cs{relbar}, \cs{std@minus}\\
257 % \cs{@ifempty}, \cs{@xifempty}, \cs{@xp}
258 % \end{quote}
259 %
260 % \begin{macro}{\xrightleftharpoons}
261 % In \xfile{fontmath.ltx} \cs{rightleftharpoons} is defined with
262 % a vertical space of 2pt.
263 % \begin{macrocode}
264 \newcommand{\xrightleftharpoons}[2][]{%
265 \ensuremath{%
266 \mathrel{%
267 \settoheight{\dimen@}{\raise 2pt\hbox{$\rightharpoonup$}}%
268 \setlength{\dimen@}{-\dimen@}%
269 \edef\CA@temp{\the\dimen@}%
270 \settoheight\dimen@{$\rightleftharpoons$}%
271 \addtolength{\dimen@}{\CA@temp}%
272 \raisebox{\dimen@}{%
273 \rlap{%
274 \raisebox{2pt}{%
275 $%
276 \ext@arrow 0359\rightharpoonupfill@{\hphantom{#1}}{#2}%
277 $%
278 }%
279 }%
280 \hbox{%
281 $%
282 \ext@arrow 3095\leftharpoondownfill@{#1}{\hphantom{#2}}%
283 $%
284 }%
285 }%
286 }%
287 }%
288 }
289 % \end{macrocode}
290 % \end{macro}
291 % \begin{macro}{\leftharpoondownfill@}
292 % \begin{macrocode}
293 \newcommand*{\leftharpoondownfill@}{%
294 \arrowfill@\leftharpoondown\relbar\relbar
295 }
296 % \end{macrocode}
297 % \end{macro}
298 % \begin{macro}{\rightharpoonupfill@}
299 % \begin{macrocode}
300 \newcommand*{\rightharpoonupfill@}{%
301 \arrowfill@\relbar\relbar\rightharpoonup
302 }
303 % \end{macrocode}
304 % \end{macro}
305 % \begin{macrocode}
306 %</package>
307 % \end{macrocode}
308 %
309 % \section{Installation}
310 %
311 % \subsection{Download}
312 %
313 % \paragraph{Package.} This package is available on
314 % CTAN\footnote{\CTANpkg{chemarr}}:
315 % \begin{description}
316 % \item[\CTAN{macros/latex/contrib/oberdiek/chemarr.dtx}] The source file.
317 % \item[\CTAN{macros/latex/contrib/oberdiek/chemarr.pdf}] Documentation.
318 % \end{description}
319 %
320 %
321 % \paragraph{Bundle.} All the packages of the bundle `oberdiek'
322 % are also available in a TDS compliant ZIP archive. There
323 % the packages are already unpacked and the documentation files
324 % are generated. The files and directories obey the TDS standard.
325 % \begin{description}
326 % \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
327 % \end{description}
328 % \emph{TDS} refers to the standard ``A Directory Structure
329 % for \TeX\ Files'' (\CTANpkg{tds}). Directories
330 % with \xfile{texmf} in their name are usually organized this way.
331 %
332 % \subsection{Bundle installation}
333 %
334 % \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
335 % TDS tree (also known as \xfile{texmf} tree) of your choice.
336 % Example (linux):
337 % \begin{quote}
338 % |unzip oberdiek.tds.zip -d ~/texmf|
339 % \end{quote}
340 %
341 % \subsection{Package installation}
342 %
343 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
344 % \docstrip\ archive. The files are extracted by running the
345 % \xfile{.dtx} through \plainTeX:
346 % \begin{quote}
347 % \verb|tex chemarr.dtx|
348 % \end{quote}
349 %
350 % \paragraph{TDS.} Now the different files must be moved into
351 % the different directories in your installation TDS tree
352 % (also known as \xfile{texmf} tree):
353 % \begin{quote}
354 % \def\t{^^A
355 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
356 % chemarr.sty & tex/latex/oberdiek/chemarr.sty\\
357 % chemarr.pdf & doc/latex/oberdiek/chemarr.pdf\\
358 % chemarr-example.tex & doc/latex/oberdiek/chemarr-example.tex\\
359 % chemarr.dtx & source/latex/oberdiek/chemarr.dtx\\
360 % \end{tabular}^^A
361 % }^^A
362 % \sbox0{\t}^^A
363 % \ifdim\wd0>\linewidth
364 % \begingroup
365 % \advance\linewidth by\leftmargin
366 % \advance\linewidth by\rightmargin
367 % \edef\x{\endgroup
368 % \def\noexpand\lw{\the\linewidth}^^A
369 % }\x
370 % \def\lwbox{^^A
371 % \leavevmode
372 % \hbox to \linewidth{^^A
373 % \kern-\leftmargin\relax
374 % \hss
375 % \usebox0
376 % \hss
377 % \kern-\rightmargin\relax
378 % }^^A
379 % }^^A
380 % \ifdim\wd0>\lw
381 % \sbox0{\small\t}^^A
382 % \ifdim\wd0>\linewidth
383 % \ifdim\wd0>\lw
384 % \sbox0{\footnotesize\t}^^A
385 % \ifdim\wd0>\linewidth
386 % \ifdim\wd0>\lw
387 % \sbox0{\scriptsize\t}^^A
388 % \ifdim\wd0>\linewidth
389 % \ifdim\wd0>\lw
390 % \sbox0{\tiny\t}^^A
391 % \ifdim\wd0>\linewidth
392 % \lwbox
393 % \else
394 % \usebox0
395 % \fi
396 % \else
397 % \lwbox
398 % \fi
399 % \else
400 % \usebox0
401 % \fi
402 % \else
403 % \lwbox
404 % \fi
405 % \else
406 % \usebox0
407 % \fi
408 % \else
409 % \lwbox
410 % \fi
411 % \else
412 % \usebox0
413 % \fi
414 % \else
415 % \lwbox
416 % \fi
417 % \else
418 % \usebox0
419 % \fi
420 % \end{quote}
421 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
422 % TDS installing feature, then some files can already be in the right
423 % place, see the documentation of \docstrip.
424 %
425 % \subsection{Refresh file name databases}
426 %
427 % If your \TeX~distribution
428 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
429 % these. For example, \TeX\,Live\ users run \verb|texhash| or
430 % \verb|mktexlsr|.
431 %
432 % \subsection{Some details for the interested}
433 %
434 % \paragraph{Unpacking with \LaTeX.}
435 % The \xfile{.dtx} chooses its action depending on the format:
436 % \begin{description}
437 % \item[\plainTeX:] Run \docstrip\ and extract the files.
438 % \item[\LaTeX:] Generate the documentation.
439 % \end{description}
440 % If you insist on using \LaTeX\ for \docstrip\ (really,
441 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
442 % about your intention:
443 % \begin{quote}
444 % \verb|latex \let\install=y\input{chemarr.dtx}|
445 % \end{quote}
446 % Do not forget to quote the argument according to the demands
447 % of your shell.
448 %
449 % \paragraph{Generating the documentation.}
450 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
451 % the documentation. The process can be configured by the
452 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
453 % line into this file, if you want to have A4 as paper format:
454 % \begin{quote}
455 % \verb|\PassOptionsToClass{a4paper}{article}|
456 % \end{quote}
457 % An example follows how to generate the
458 % documentation with pdf\LaTeX:
459 % \begin{quote}
460 %\begin{verbatim}
461 %pdflatex chemarr.dtx
462 %makeindex -s gind.ist chemarr.idx
463 %pdflatex chemarr.dtx
464 %makeindex -s gind.ist chemarr.idx
465 %pdflatex chemarr.dtx
466 %\end{verbatim}
467 % \end{quote}
468 %
469 % \begin{History}
470 % \begin{Version}{2001/06/21 v1.0}
471 % \item
472 % First public version.
473 % \end{Version}
474 % \begin{Version}{2001/06/22 v1.1}
475 % \item
476 % Documentation fixes.
477 % \end{Version}
478 % \begin{Version}{2006/02/20 v1.2}
479 % \item
480 % DTX framework.
481 % \item
482 % Example added.
483 % \end{Version}
484 % \begin{Version}{2016/05/16 v1.3}
485 % \item
486 % Documentation updates.
487 % \end{Version}
488 % \end{History}
489 %
490 % \PrintIndex
491 %
492 % \Finale
493 \endinput