Skip to content

Releases: Xerdi/comment2tex

Release 1.1

Choose a tag to compare

@github-actions github-actions released this 22 Jul 19:02
1.1
a6993db

Four source languages, two render modes, and a manual that documents itself.

New

  • YAML and Make styles\includeyaml and \includemake join \includebash
    and \includelua, covering Bash, Lua, YAML and Makefiles.
  • --tangle — strip the doc-comments to recover the runnable source
    (style-aware; replaces the old sed step).
  • Verbatim / listings switch\ctxuselistings and \ctxuseverbatim pick the
    renderer anywhere in a document.

Changed

  • Under LaTeX the include macros now default to a dependency-free numbered
    verbatim
    instead of listings. Opt back into listings (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

Choose a tag to compare

@MacLotsen MacLotsen released this 08 Jun 10:35
283e464

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.lua runs both as a texlua
    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.tex provides the same two macros, with a built-in
      verbatim listing in place of listings.
  • Configurable styles. Presets for Bash (##) and Lua (---), each pairing
    a doc-comment prefix with a listing language; --comment, --language,
    --begin, and --end override individual fields.
  • Continuous listing numbers. Code blocks split by prose keep a single,
    continuous line numbering (firstnumber=last). The runtime comment2tex.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.