edtx2dtx(1)
β¨ edtx2dtx β the little glow-up machine for your .edtx files β¨
okay bestie, so this is edtx2dtx, a User Manual classic, and it's literally the tool that takes a .edtx and turns it into a .dtx. that's it. that's the whole vibe. π
πΈ NAME πΈ
edtx2dtx β convert .edtx into .dtx π¦
β¨ SYNOPSIS β¨
edtx2dtx filename.edtx > filename.dtx
like. redirect it. it's giving pipeline couture. π
π DESCRIPTION π
So here's the tea β β this utility wraps code chunks in a commented-and-properly-indented \begin{macrocode} / \end{macrocode} pair. and a "code chunk", per the lore, is any sequence of lines that is NOT introduced by a single (possibly indented) comment character (%). which means:
- plain non-commented lines? code. β
- lines introduced by multiple comment characters? also code. β
(yes queen, multiple
%s still count as code) - documentation lines? they may be indented, it's fine. β
Then: the part of the file that should actually get processed has to be marked by a \begin{macrocode} and \end{macrocode} pair. in other words, bestie β
- everything preceding
\begin{macrocode}= the header, and it is not changed. not a single character. - everything following
\end{macrocode}= the trailer, and it is not changed either.
and fr fr, you can have any number of \begin{macrocode} β \end{macrocode} pairs. go wild. π«Ά
the system allows for the driver to remain as is, and it also makes it super easy to paste a.dtxfile into an.edtxβ because using this utility on a.dtxdoes not change the file. iconic behaviour honestly.
Oh and ALSO π
β the utility replaces the first occurrence of <filename>.edtx in the header β followed by an optional parenthesized note β with <filename>.dtx, plus the note on how the file was generated. cute, right?
π OPTIONS π
-c,--commentβ the input comment character. default is%. and heads up: any input comment characters in the header and the trailer will be replaced by the output comment character, which is always%.-b,--begin-macrocode regexβ change the default input\begin{macrocode}marker.-e,--end-macrocode regexβ change the default input\end{macrocode}marker.
okay so both of those together: use these options to change the default input \begin{macrocode} and \end{macrocode} markers. (the output markers are always \begin{macrocode} and \end{macrocode}, no negotiating.) the markers should be given as regular expressions matching the entire line. and note: the input markers are not kept in the file, i.e. they get replaced by the output markers.
-B,--Begin-macrocode regexβ same as-b, but the input markers are kept in the output. (capital letter, capital energy π)-E,--End-macrocode regexβ same as-e, but the input markers are kept in the output.-s,--strip-emptyβ if this option is given, empty lines are not included in the output. bye bye blank space. π-h,--helpβ show help and exit. we love a helpful queen.-V,--versionβ show the version number and exit. β
π EXAMPLES π
π¦ example the first
if input.edtx is just like a dtx file β just without \begin{macrocode} and \end{macrocode} around every chunk of code:
edtx2dtx input.edtx > output.dtx
slay. done. β¨
π§ example the second
Memoize uses the invocation below to produce a .dtx from documented Python code of memoize-extract.py.
- the value of
-cadaptsedtx2dtxto Python comments. -Bmarks everything preceding the version number statement as a header, and keeps the version number statement in the output.- similarly,
-Esays the processing should stop when encountering Emacs' local variables β which are kept, unchanged, in the output.
edtx2dtx -s -c '#' -B '^__version__' -E '^# Local Variables:' $< \
(and yes, that trailing \ is really there. don't @ me. π)
π SEE ALSO π
easydoctex.el
π and that's the whole page, bestie. go forth and convert. no cap. π«Ά
edtx2dtx 0.2.0 πΈ β November 23, 2024 π β that's the version and the date, mwah, thanks for reading, ily, bye!! π β¨
π¦ where this page comes from
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- debian trixie: texlive-extra-utils 2024.20250309-2
- fedora 44: texlive-easydtx 12:svn72952-105.fc44 Β· GPL-3.0-or-later
- fedora 44: texlive-easydtx 12:svn72952-111.fc44 Β· GPL-3.0-or-later
- opensuse-leap 16.0: texlive-easydtx-doc 2025.221.0.0.2.0svn72952-160000.3.1 Β· GPL-2.0-or-later
- ubuntu questing: texlive-extra-utils 2024.20250309-2
- ubuntu resolute: texlive-extra-utils 2025.20260124-1
- ubuntu stonking: texlive-extra-utils 2026.20260711-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms