Next steps for breqn
Morten Høgholm
Technical University of Denmark

TUG 2009, Notre Dame University

Technical University of Denmark

1/14

Outline

1

What breqn doesTechnical University of Denmark

2/14

A quick example\begin{dmath*}f(x) = \sum_{k=0}^{\infty}\frac{f^{(k)}(c)}{k!}(x-c)^{k}= f(c)+f’(c)(x-c) +\frac{f’’(c)}{2!}(x-c)^{2}+ \frac{f^{(3)}(c)}{3!}(x-c)^{3}+\cdots\end{dmath*}f (k) (c)(x − c)kk!
k=0∞

f (x) = ∑= f (c) + f 0 (c)(x − c) ++Technical University of Denmarkf 00 (c)(x − c)22!

f (3) (c)(x − c)3 + · · ·3!
3/14

Another example\begin{dgroup*}\begin{dmath}f(x) = \sum_{k=0}^{\infty}\frac{f^{(k)}(c)}{k!}(x-c)^{k}= f(c)+f’(c)(x-c) +\frac{f’’(c)}{2!}(x-c)^{2}+ \frac{f^{(3)}(c)}{3!}(x-c)^{3}+\cdots\end{dmath}\begin{dmath*}
E=mc^2\end{dmath*}\end{dgroup*}

Technical University of Denmark

4/14

Another example, cont.

f (k) (c)(x − c)kk!
k=0∞

f (x) = ∑= f (c) + f 0 (c)(x − c) +f 00 (c)(x − c)22!

(1)

f (3) (c)(x − c)3 + · · ·3!
E = mc 2+

Technical University of Denmark

5/14

How breqn works

Categorizing math symbols into classes
Spacing classes — same as TEX.
Breaking classes. Left delimiters and right delimiters should
act differently.
Making every math character a macro: \mathcode"8000

Technical University of Denmark

6/14

What about amsmath, memoir, you name it?

Many small bug fixes to make it not break everything else, so. . .
Good news! It works with amsmath.
And memoir.
And most other things.
But beware of catcodes!

Technical University of Denmark

7/14

Problems in use

Not all environments work as advertised
Lacking QED support
Interference with other packages changing document catcodes.
Lacking proper manual overrides.

Technical University of Denmark

8/14

Tag placement
The tag placement is currently not exactly as desired.
The original implementation would center tag vertically1k=q23π(2)

New algorithm tries to be a little smarter
1k=q(2)23π

However, this is a little more complicated. . .

Technical University of Denmark

9/14

The line breaking

It works most of the time
But can occasionally produce sub-optimal results
The algorithm just isn’t perfect.
Needs an inspection/more detailed specification.
Why do everything yourself? The new version of Presentation
MathML contains many ideas as to how to do this.
Get it to work properly with the paragraph shapes within
LATEX.

Technical University of Denmark

10/14

Implementing the line breaking

Currently spaghetti code
Needs to be rewritten into a more functional/readable style
This ought to ease maintenance!
And also porting to other languages.

Technical University of Denmark

11/14

UnicodeDifficult!
Many things have to change under the hood
But don’t worry – it’s already been done in the development
versionTechnical University of Denmark

12/14

Accessibility

Also difficult!
But since breqn reflows a math expression. . .
Let’s add pdf tagging!
Hope to commence this work soon.

Technical University of Denmark

13/14

Other nice things to have

Breaking of binary operators in Slavic style
Automatic ligatures sin → sin.
Automatic scaling of delimiters, i.e., do what nath does.
In short: To make it simple for the user!
And that it doesn’t break other packages.

Technical University of Denmark

14/14