# mathformule

`mathformule` provides the numbered `formule` display environment for both
single-line and aligned multiline mathematics. Multiline displays may carry
one overall equation number or configurable subnumbers on individual rows.
They may also be enclosed by an extensible brace on either side, with optional
math material outside the brace. Global, per-environment, and per-row spacing
corrections are available. If no top-level ampersand is present, multiline
rows share a left edge automatically. A leading ampersand is valid, and
explicit ampersands retain the conventional right-before/left-after column
alignment.

The package does not explicitly require or load an auxiliary package. Its
typesetting core uses TeX primitives and LaTeX kernel facilities and does not
wrap the `equation`, `align`, or `aligned` environments. It shares LaTeX's
standard `equation` counter and integrates with the usual numbering and
cross-reference mechanisms. It is designed to coexist with the principal AMS
mathematics and common cross-reference packages.

Version 0.6 is intended for current LaTeX2e formats and has been verified with
pdfLaTeX, XeLaTeX, and LuaLaTeX. It is not a plain TeX macro file.

## Files

- `README.md`: package overview, installation notes, and license statement
- `mathformule.sty`: package implementation
- `mathformule-doc-en.pdf`: English manual
- `mathformule-doc-en.tex`: source of the English manual
- `mathformule-doc-zh.pdf`: Chinese manual
- `mathformule-doc-zh.tex`: source of the Chinese manual
- `mwe.tex`: complete minimal example
- `CHANGELOG.md`: release history
- `LICENSE`: complete text of the LPPL 1.3c

## Installation

For local use, place `mathformule.sty` beside the document and load it with:

```tex
\usepackage{mathformule}
```

For a system-wide installation, place the style file under a suitable local
TeX tree, for example `tex/latex/mathformule/`, and refresh the file database
when required by the TeX distribution.

## Documentation

Build the English manual with pdfLaTeX:

```text
pdflatex mathformule-doc-en.tex
pdflatex mathformule-doc-en.tex
```

Build the Chinese manual with XeLaTeX and a TeX distribution containing
`ctex` and the Fandol fonts:

```text
xelatex mathformule-doc-zh.tex
xelatex mathformule-doc-zh.tex
```

The documentation loads additional packages for page layout, links, and
Chinese typesetting. They are documentation-only requirements and are not
loaded by `mathformule.sty`.

## Compatibility

Version 0.6 has been tested with pdfLaTeX, XeLaTeX, and LuaLaTeX. Tests also
cover section- and chapter-based equation numbering, `leqno`, `fleqn`, AMS
mathematics packages, and common hyperlink and cross-reference packages.
No conflict is currently known from the tested combinations, but behaviour in
an arbitrary document can still depend on the document class, package
versions, and loading order.

## Author and license

Copyright (C) 2026 Quan Sun  
Contact: <rmm74845@gmail.com>

This material is subject to the LaTeX Project Public License, version 1.3c or
later. The license text is available at
<https://www.latex-project.org/lppl/lppl-1-3c/>.

The Work, as defined by the LPPL, consists of the files listed in the
**Files** section of this README.

This work has LPPL maintenance status **maintained**. The Current Maintainer
is Quan Sun.

This work is distributed without warranty, to the extent permitted by
applicable law.
