l3kernel
Implements core programming interfaces and conventions for LaTeX3 development, providing essential foundations for modern LaTeX package creation.
Overview
Serves as the fundamental programming layer for LaTeX3, offering a comprehensive API that modernizes LaTeX development and enables more sophisticated package creation. This essential bundle bridges traditional LaTeX2e with modern LaTeX3 conventions.
- Provides consistent programming interfaces and conventions for LaTeX developers
- Enables modern package development with improved syntax and functionality
- Forms the foundation for future LaTeX kernel development
- Allows seamless integration of LaTeX3 programming features within LaTeX2e documents
- Essential for package authors developing modern LaTeX tools and extensions
Getting Started
To use l3kernel
, include it in your document preamble:
\documentclass{article}
\usepackage{expl3}
This package is primarily intended for package authors. The main functionality is:
% Basic LaTeX3 programming example
\ExplSyntaxOn
% LaTeX3 code here
\ExplSyntaxOff
Examples
Basic LaTeX3 programming with expl3 syntax for defining variables and functions.
\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
% Define variables
\int_new:N \l_my_counter_int
\int_set:Nn \l_my_counter_int {5}
% Define a function to square a number
\cs_new:Npn \my_square:n #1
{
\int_eval:n {#1 * #1}
}
% Define a document-level command that uses our function
\NewDocumentCommand{\Square}{m}
{
The~square~of~#1~is~\my_square:n{#1}.
}
\ExplSyntaxOff
\begin{document}
LaTeX3 programming example:
We defined a counter with value: $\ExplSyntaxOn \int_use:N \l_my_counter_int \ExplSyntaxOff$
Using our square function: \Square{4}
Squaring our counter: \ExplSyntaxOn The~square~of~\int_use:N \l_my_counter_int~is~\my_square:n{\l_my_counter_int}. \ExplSyntaxOff
\end{document}