Skip to content

v0.1.0

Latest

Choose a tag to compare

@dbjoshua dbjoshua released this 20 Jul 11:33
2eb4287

🎉 Initial Release (v0.1.0)

We are pleased to announce the initial public release of cssyntax (Control Sequence Syntax), a standalone LaTeX2e package that provides a syntax layer for writing structured, self-describing internal command names.

Originally developed as the core of the lingwrit bundle, it is now a standalone package usable by any LaTeX package or class. cssyntax is entirely domain-agnostic and contains no specific assumptions about fields like linguistics or mathematics; it solely provides the naming infrastructure for package authors. By temporarily activating _, :, and / as letter-category characters, it allows authors to replace cryptic flat names with hierarchically organized control sequences that remain highly maintainable over time, without altering how TeX actually works.


🚀 Key Features

1. Extended Catcode Syntax

  • Activates _, :, and / as letters (catcode 11) within the current scope via \csSyntaxOn / \csSyntaxOff.
  • Structured names follow a clear hierarchical pattern: \container_module_type_sub-type/description.
  • \csSyntaxOff safely restores standard category codes (_ → 8, : → 12, / → 12).
  • Semantically clear synonyms \csSyntaxEnabled and \csSyntaxDisabled are also provided.

2. Readable Aliases for TeX Primitives

  • All internal primitives utilize the \_fun_ root prefix with / and : separators.
  • Every / command automatically receives a matching : synonym created safely with \NewCommandCopy (e.g., \_fun_copy/cs and \_fun_copy:cs).
  • Included Toolkit:
    • Definition / Copying: Includes tools like \_fun_copy/cs, \_fun_define/cs, \_fun_define/exp, \_fun_define/global, and \_fun_define/protected_exp.
    • Expansion & Introspection: Commands such as \_fun_expand/after, \_fun_expand/prevent, \_fun_build/cs, and \_fun_get/cs_meaning.
    • Grouping: Explicit scoping commands including \_fun_enter/group, \_fun_exit/group, \_fun_enter/token_group, and \_fun_exit/token_group.
    • Sequence Management: A save, use, reset, and swap toolkit (\_fun_save/cs, \_fun_use/cs, \_fun_reset/cs, \_fun_swap/cs).
    • Selection & Gobbling: Basic token utilities like \_fun_pick/first, \_fun_pick/second, \_fun_gobble/one, and \_fun_gobble/two.
    • File Loading: Input workflows via \_fun_load/, \_fun_load/if_exists, \_fun_enter/source, and \_fun_exit/source.

3. Low-Level Environment Declaration

  • \_fun_declare/env: Declares basic environments without automatic grouping, giving the author explicit scoping control.
  • \_fun_declare/auto_group: Declares environments that automatically wrap the enter and exit code within \begingroup...\endgroup.

4. Boolean Handling (via xifthen)

  • Easily declare new booleans using the command \_fun_declare/bool, which applies a protective internal _user_bool/ prefix to prevent namespace collisions.
  • Manage boolean states with \_fun_set_true/bool and \_fun_set_false/bool.
  • Retrieve conditional tokens using \_fun_enter/test_bool and \_fun_exit/test_bool for direct integration within \ifthenelse.

5. Bootstrap-Safe Design

  • Core mechanism setup commands never contain _, :, or / in their own macro names.
  • This deliberate separation ensures they remain fully callable before the extended syntax layer is activated.

📦 Required Dependencies

The package automatically loads the following extensions before the extended syntax layer is enabled:

  • xifthen
  • xparse
  • expl3
  • l3keys2e

📄 License

This package is released under the LaTeX Project Public License (LPPL) v1.3c or later.


Full Commit History: https://github.com/dbjoshua/cssyntax/commits/v0.1.0