Skip to content

GWEB 0.2.0

Choose a tag to compare

@sjnam sjnam released this 26 Jun 10:56

GWEB 0.2.0 brings Korean literate programming — and, found while writing the
first Korean example, a CWEB-conformance fix for section-name matching.

Korean documentation (new)

Put \input kotexgweb.tex in a .w file's limbo and typeset the woven output
with luatex (not pdftex) to get a fully Korean document — Hangul body,
running heads, contents page, section-name list, and cross-reference notes — with
blue cross-reference links and a Korean PDF outline (bookmark) pane.

  • tex/kotexgweb.tex is one self-contained file: it loads luatexko, sets the
    Noto Serif/Sans CJK KR fonts, restates gweave's fixed wording in Korean, and
    supplies a LuaTeX PDF back end (gwebmac's links/bookmarks use pdfTeX
    primitives luatex lacks). PDF outline titles are emitted as UTF-16BE so Korean
    bookmarks render correctly.
  • The running-head Hangul is set in a sans face to match the small-caps Latin,
    and the contents-page title is sized to match English gweb.
  • Localization is language-agnostic: every fixed string gweave/gwebmac emit
    goes through a macro (\GU, \GNused, \Gsectionword, \Gheadfont, …), so
    another language needs only its own \input file. install.sh installs
    kotexgweb.tex next to gwebmac.tex.

Bug fix

  • Section-name whitespace. As in CWEB, runs of spaces, tabs, and newlines in
    a section name are now collapsed to a single space and trimmed, so a long name
    wrapped across lines in one place matches the same name written on one line.
    Previously such a reference resolved to section 0 — which also crashed luatex's
    PDF backend.

Typesetting refinements (gweave / gwebmac)

  • const and iota names are set in typewriter, like CWEB's @d macros; nil,
    true, false are typewriter (not bold); @d marks an imported name (e.g.
    http.StatusOK) as typewriter.
  • Type names are set in boldface.
  • A narrower, tunable thin space (\Gthin, 2mu) before (.
  • TeX is passed through in section names (so \.{x} works), and @(file@>=
    output names are typeset as escaped typewriter paths (underscores, etc.).

New example programs

hangul.w (Korean Fibonacci), pipeline.w (lazy iter.Seq transforms bridged
to a channel fan-out), pairsums.w (max pair-product over subarrays via a Li
Chao tree), squint.w (McIlroy's lazy power series as channel networks),
topswops.w / topswops_fwd.w (Conway's game), and fast_cancel.w.

Tooling & docs

  • gtangle -version / gweave -version report 0.2.0.
  • .gitignore covers CWEB-style aux files (*.idx, *.scn).
  • VS Code: control codes after leading whitespace are highlighted; VSIX install
    is recommended.
  • README and manual updates.