Skip to content

Mediawiki generates invalid LaTeX #9296

@pepijndevos

Description

@pepijndevos

Explain the problem.

The wikipedia page for Maxwell's equations contains a table with equations, which when converted to LaTeX throws a bunch of errors:

! Package amsmath Error: \begin{align} allowed only in paragraph mode.
FEATURED_TITLE="Maxwell's_equations"
pandoc --from mediawiki --to latex -s -V papersize=a5 -V geometry:margin=1cm -V mainfont="Liberation Serif" "$FEATURED_TITLE.txt" -o "$FEATURED_TITLE.tex"
lualatex --interaction=nonstopmode "$FEATURED_TITLE.tex"

Maxwell's_equations.txt

There are other issues with the output but this is the most breaking one.

Pandoc version?

Arch Linux:

$ pandoc --version
pandoc 3.1.6
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/pepijn/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions