Releases: Xerdi/comment2tex
Releases · Xerdi/comment2tex
Release list
Release 1.1
Four source languages, two render modes, and a manual that documents itself.
New
- YAML and Make styles —
\includeyamland\includemakejoin\includebash
and\includelua, covering Bash, Lua, YAML and Makefiles. --tangle— strip the doc-comments to recover the runnable source
(style-aware; replaces the oldsedstep).- Verbatim / listings switch —
\ctxuselistingsand\ctxuseverbatimpick the
renderer anywhere in a document.
Changed
- Under LaTeX the include macros now default to a dependency-free numbered
verbatim instead oflistings. Opt back intolistings(syntax highlighting,
line breaking) with\ctxuselistings. Heads-up for v1.0 users who relied on the
listings output. - The verbatim line-number gutter auto-sizes to the file, and tabs are expanded
when weaving. - Extensionless names (
Makefile) and directory-qualified paths
(.github/workflows/build.yml) are now accepted.
Fixed
- A spurious
%on the first line of a plain-TeX wrapper listing.
Docs
- The manual now uses comment2tex on itself throughout — the converter, the
Makefile, the test suite and the CI/CD workflows are all typeset by the package
itself — plus a short "is it literate programming?" discussion and section
cross-references.
Full Changelog: v1.0...1.1
Release v1.0
comment2tex v1.0 (2026/06/08)
First public release.
comment2tex typesets a source file that carries its own documentation in
special comments: doc-comment lines become ordinary LaTeX, everything else
becomes a listing.
Highlights
- Two public macros.
\includebash{file}and\includelua{file}read a
source file, convert it, and input the result — no manual build step. - One Lua converter, two roles.
comment2tex.luaruns both as atexlua
command-line program and as an in-process library loaded by the TeX wrappers. - Engine coverage.
- LuaLaTeX (recommended): converts in process via
\directlua— no shell
escape, no separate run. - pdfLaTeX with
--shell-escape: converts through\write18. - pdfLaTeX without shell escape: pre-build the fragments, then a plain run
inputs them; a missing fragment raises an error naming the command to run. - plain TeX:
comment2tex.texprovides the same two macros, with a built-in
verbatim listing in place oflistings.
- LuaLaTeX (recommended): converts in process via
- Configurable styles. Presets for Bash (
##) and Lua (---), each pairing
a doc-comment prefix with a listing language;--comment,--language,
--begin, and--endoverride individual fields. - Continuous listing numbers. Code blocks split by prose keep a single,
continuous line numbering (firstnumber=last). The runtimecomment2tex.lua
in this release ships with its doc-comments stripped, so its line numbers match
the listing numbers in the documentation.
Installation
Run tex comment2tex.ins to extract comment2tex.sty and comment2tex.tex,
then place those and comment2tex.lua in a directory searched by TeX. Build the
documentation with lualatex comment2tex.dtx.