Skip to content

Conversation

Copy link

Copilot AI commented Nov 9, 2025

Complete rewrite of brlex2 using modern LaTeX3 programming layer (expl3) while maintaining 100% backward compatibility. All existing commands, options, and output remain unchanged.

Implementation

Core Architecture

  • Pure expl3 syntax with proper namespace (brlex_ prefix for all internal functions)
  • Type-safe variables: \bool_new:N, \tl_new:N, \int_new:N, \dim_new:N
  • 12 logical modules with clear separation of concerns
  • Direct integer operations replacing LaTeX2e counters for better performance

Options System

  • Modern key-value interface via \keys_define:nn
  • Legacy syntax preserved: \documentclass[calibri,artbold]{brlex3}
  • New syntax available: \documentclass[font=calibri, article-bold=true]{brlex3}

Message System

  • Centralized error/warning definitions using \msg_new:nnn
  • Improved user guidance with structured messages

Example Migration

% Before (brlex2)
\documentclass{brlex2}
\begin{document}
\art Este é um artigo.
\end{document}

% After (brlex3) - identical output
\documentclass{brlex3}
\begin{document}
\art Este é um artigo.
\end{document}

Code Quality

  • 638 lines of documented expl3 code
  • 30+ namespaced functions with proper argument specifiers (:n, :N, :nn, :TF)
  • 29 typed variables with explicit scoping (\l__brlex_*, \g__brlex_*)

Documentation

  • CHANGELOG.md: Version history and detailed improvements
  • MIGRATION.md: User migration guide with examples
  • UPGRADE_DETAILS.md: Technical deep-dive on implementation
  • SUMMARY.md: Executive overview
  • IMPROVEMENTS_LIST.md: 30+ itemized improvements across 10 categories

Compatibility

All brlex2 syntax works unchanged via command aliases. Examples updated to use brlex3. Legacy brlex2.cls preserved.

Original prompt

brlex2 is a latex class that provides (and the examples illustrates) the creation of brazillian legal texts, like bills.

we will now do a major update in the class, releasing brlex3. as we're now on 2025 (and as the classname itself suggests), the new code will be in modern LaTeX and will use expl3.

plan this upgrade and details each improvement and change that'll be done. you can improve user interface, just explain clearly.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 9, 2025 01:44
…entation

Co-authored-by: hellmrf <25724069+hellmrf@users.noreply.github.com>
Co-authored-by: hellmrf <25724069+hellmrf@users.noreply.github.com>
Co-authored-by: hellmrf <25724069+hellmrf@users.noreply.github.com>
Copilot AI changed the title [WIP] Update brlex2 to brlex3 with modern LaTeX and expl3 Upgrade brlex2 to brlex3 with LaTeX3 (expl3) rewrite Nov 9, 2025
Copilot AI requested a review from hellmrf November 9, 2025 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants