Skip to content

Breaking change(?) to algorithms #325

@djn-ams

Description

@djn-ams

At some point, something changed with how algorithms (specifically, captions, I think) are generated. The following compiles fine with TeX, but causes errors with TeXML:

\documentclass{amsart}

\usepackage{algorithm2e}

\begin{document}

\begin{algorithm}
  foo
  \caption{bar}
\end{algorithm}

\end{document}

Specifically, it will cause the following errors (main.tex being the name of the test file):

! Missing \endcsname inserted.
main.aux, l. 2>
                \@writefile{\ext@algocf }{\contentsline {algocf}{\numberline
{}{1}{\TeXML@caption }{ltxid1}}{\thepage }}

! Missing \endcsname inserted.
main.aux, l. 2>
                \@writefile{\ext@algocf }{\contentsline {algocf}{\numberline
{}{1}{\TeXML@caption }{ltxid1}}{\thepage }}

! Missing number, treated as zero.
main.aux, l. 2>
                \@writefile{\ext@algocf }{\contentsline {algocf}{\numberline
{}{1}{\TeXML@caption }{ltxid1}}{\thepage }}

! Missing { inserted.
main.aux, l. 2>
                \@writefile{\ext@algocf }{\contentsline {algocf}{\numberline
{}{1}{\TeXML@caption }{ltxid1}}{\thepage }}

))
! Emergency stop
! You ran out of file, mate!.
<unknown>, l. 1>
                 \@writefile{\ext@algocf }{\contentsline {algocf}{\numberline
{}{1}{\TeXML@caption }{ltxid1}}{\thepage }}

You ran out of file, mate!

Note that adding the algorithm package back in fixes things, i.e.,

\documentclass{amsart}

\usepackage{algorithm2e}
\usepackage{algorithm}

\begin{document}

\begin{algorithm}
  foo
  \caption{bar}
\end{algorithm}

\end{document}

will compile with TeXML. (Also note that this breaks compilation with TeX, so you have to use a nasty hack to get both TeX and TeXML to compile)

A cursory look shows that we've generated and posted/published papers before using only the algorithm2e so it seems like some change has broken the behavior recently. I don't see any recent changes to the algorithm package shims themselves, so I suspect it's somewhere else.


Whoopsie, I made a minor mistake. TeXML works fine if algorithm is loaded after algorithm2e. It still breaks if algorithm is loaded before algorithm2e.


Papers affected

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions