Debian Codegraph @

texmf-dist/doc/man/man1/edtx2dtx.1

raw
1 .\" Automatically generated by Pandoc 3.1.11.1
2 .\"
3 .TH "edtx2dtx" "1" "November 23, 2024" "edtx2dtx 0.2.0" "User Manual"
4 .SH NAME
5 edtx2dtx \- Convert .edtx into .dtx
6 .SH SYNOPSIS
7 \f[B]edtx2dtx\f[R] \f[I]filename.edtx\f[R] > \f[I]filename.dtx\f[R]
8 .SH DESCRIPTION
9 This utility wraps code chunks by a (commented and properly indented)
10 \f[CR]\[rs]begin{macrocode}\f[R] and \f[CR]\[rs]end{macrocode}\f[R]
11 pair.
12 A code chunk is any sequence of lines not introduced by a single
13 (possibly indented) comment character (\f[CR]%\f[R]); i.e.\ both
14 non\-commented lines and lines introduced by multiple comment characters
15 count as code, and documentation lines may be indented.
16 .PP
17 The part of the file which should be processed should be marked by a
18 \f[CR]\[rs]begin{macrocode}\f[R] and \f[CR]\[rs]end{macrocode}\f[R]
19 pair.
20 In other words, everything preceding \f[CR]\[rs]begin{macrocode}\f[R] is
21 considered a header and not changed, and everything following
22 \f[CR]\[rs]end{macrocode}\f[R] is considered a trailer and not changed.
23 In fact, any number of \f[CR]\[rs]begin{macrocode}\f[R] \[em]
24 \f[CR]\[rs]end{macrocode}\f[R] pairs is allowed.
25 (The system allows for the driver to remain as is, and also makes it
26 easy to paste a \f[CR].dtx\f[R] file into an \f[CR].edtx\f[R], as using
27 this utility on a \f[CR].dtx\f[R] does not change the file.)
28 .PP
29 The utility furthermore replaces the first occurrence of
30 \f[CR]<filename>.edtx\f[R] in the header, followed by an optional
31 parenthesized note, with \f[CR]<filename>.dtx\f[R], plus the note on how
32 the file was generated.
33 .SH OPTIONS
34 .TP
35 \f[B]\-c, \-\-comment\f[R]
36 The input comment character; the default is \f[CR]%\f[R].
37 (Any input comment characters in the header and the trailer will be
38 replaced by the output comment character, which is always \f[CR]%\f[R].)
39 .PP
40 \f[B]\-b, \-\-begin\-macrocode\f[R] \f[I]regex\f[R]
41 .PD 0
42 .P
43 .PD
44 .TP
45 \f[B]\-e, \-\-end\-macrocode\f[R] \f[I]regex\f[R]
46 Use these options to change the default \f[I]input\f[R]
47 \f[CR]\[rs]begin{macrocode}\f[R] and \f[CR]\[rs]end{macrocode}\f[R]
48 markers.
49 (The \f[I]output\f[R] markers are always
50 \f[CR]\[rs]begin{macrocode}\f[R] and \f[CR]\[rs]end{macrocode}\f[R].)
51 The markers should be given as regular expressions matching the entire
52 line.
53 The input markers are not kept in the file, i.e.\ they are replaced by
54 the output markers.
55 .PP
56 \f[B]\-B, \-\-Begin\-macrocode\f[R] \f[I]regex\f[R]
57 .PD 0
58 .P
59 .PD
60 .TP
61 \f[B]\-E, \-\-End\-macrocode\f[R] \f[I]regex\f[R]
62 As \f[CR]\-b\f[R] and \f[CR]\-e\f[R], but the input markers are kept in
63 the output.
64 .TP
65 \f[B]\-s, \-\-strip\-empty\f[R]
66 If this option is given, empty lines are not included in the output.
67 .TP
68 \f[B]\-h, \-\-help\f[R]
69 Show help and exit.
70 .TP
71 \f[B]\-V, \-\-version\f[R]
72 Show the version number and exit.
73 .SH EXAMPLES
74 If \f[CR]input.edtx\f[R] is just like a \f[CR]dtx\f[R] file, just
75 without \f[CR]\[rs]begin{macrocode}\f[R] and
76 \f[CR]\[rs]end{macrocode}\f[R] around every chunk of code:
77 .IP
78 .EX
79 edtx2dtx input.edtx > output.dtx
80 .EE
81 .PP
82 Memoize uses the invocation below to produce a \f[CR].dtx\f[R] from
83 documented Python code of \f[CR]memoize\-extract.py\f[R].
84 The value of \f[CR]\-c\f[R] adapts the \f[CR]edtx2dtx\f[R] to Python
85 comments.
86 \f[CR]\-B\f[R] marks everything preceding the version number statement
87 as a header, and keeps the version number statement in the output.
88 Similarly, \f[CR]\-E\f[R] says that the processing should stop when
89 encountering Emacs\[cq] local variables (which are kept, unchanged, in
90 the output).
91 .IP
92 .EX
93 edtx2dtx \-s \-c \[aq]#\[aq] \-B \[aq]\[ha]__version__\[aq] \-E \[aq]\[ha]# Local Variables:\[aq] $< \[rs]
94 .EE
95 .SH SEE ALSO
96 easydoctex.el