| 1 |
# The `luamathalign` package for LuaLaTeX |
| 2 |
|
| 3 |
With `amsmath`'s `align` environment simple equations can be aligned easily, e.g. |
| 4 |
|
| 5 |
```tex |
| 6 |
2 &=1+1\\ |
| 7 |
2-1&=1 |
| 8 |
``` |
| 9 |
|
| 10 |
but even just adding an underline makes this much more complicated. E.g. |
| 11 |
|
| 12 |
```tex |
| 13 |
2 &=1+1\\ |
| 14 |
\underline{2-1&=1} |
| 15 |
``` |
| 16 |
|
| 17 |
is not allowed. Similarly alignment points surrounded by `\left` and `\right` |
| 18 |
or points nested in other environments do not work. |
| 19 |
|
| 20 |
For LuaLaTeX this can be solved with luamathalign. It adds a command `\AlignHere` |
| 21 |
which behaves mustly like `&` except that it's allowed almost anywhere. E.g. |
| 22 |
|
| 23 |
``` |
| 24 |
2 &= 1+1\\ |
| 25 |
\underline{2-1 \AlignHere= 1} |
| 26 |
``` |
| 27 |
|
| 28 |
|
| 29 |
Licensed under the LPPL v1.3c or later. |