fix: Pandoc-Weg – EPUB-Links, Formeln im EPUB, portables TeX (QA3-04 bis QA3-06)

Prüfung aller 5 Beispielbücher über die Befehle der Buch-README (HTML,
EPUB, PDF mit weasyprint und xelatex):

- QA3-04: Der EPUB-Befehl der Buch-README hatte kein --mathml; im
  Mathebuch blieben 1072 Formeln als TeX-Text. Jetzt 4904 als MathML.
- QA3-05: Kapitel-Startanker von epub2md_merge.py begannen mit einer
  Ziffer (039-…). Pandocs EPUB-Writer löst Links darauf nicht auf (C-Buch
  32, Mathebuch 20 tote Links). Jetzt kap-039-…; book.lua erkennt beide.
- QA3-06: portable_tex() passt Verlags-TeX für texmath an (\"u, \O,
  @{…} und \arraycolsep in array, leeres \displaystyle vor Zellenende).
  Mathebuch: 1 statt 9 nicht umsetzbare Formeln.
- Cover ohne Seitenzahl (print.css, book.lua).

Neue Tests: tests/test_pandoc.py (nur mit installiertem pandoc),
Parametertests für portable_tex. Andere Bücher byte-identisch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-10-06 21:41:13 +02:00
commit 64d0cb0357

View file

@ -34,10 +34,10 @@ def test_merge_complete_book(convert, tmp_path):
# links between chapters point into the merged file; colliding id "sec" renamed in chapter B
assert '<a id="sec"></a>' in text and '<a id="c002-sec"></a>' in text
assert "[B](#c002-sec)" in text and "[A](#sec)" in text and "[hier](#sec)" in text
assert "[Kapitel B](#002-kapitel-b)" in text and '<a id="002-kapitel-b"></a>' in text
assert "[Kapitel B](#kap-002-kapitel-b)" in text and '<a id="kap-002-kapitel-b"></a>' in text
# media paths relative to the merged file, also inside image links
assert "![Bild](media/images/0001-bild.png)" in text
assert "[![Bildlink](media/images/0001-bild.png)](#002-kapitel-b)" in text
assert "[![Bildlink](media/images/0001-bild.png)](#kap-002-kapitel-b)" in text
# code untouched
assert '[kein](link.md) id="sec" `code`' in text
# footnote defined in both chapters -> only once in the merged file
@ -63,8 +63,8 @@ def test_merge_to_other_location_rewrites_media_paths(convert, tmp_path):
text = target.read_text(encoding="utf-8")
assert not text.startswith("---")
assert f"![Bild](../{run.out.name}/media/images/0001-bild.png)" in text
assert "1. [Kapitel A](#001-kapitel-a)" in text
assert "001-kapitel-a" in anchors_in(text)
assert "1. [Kapitel A](#kap-001-kapitel-a)" in text
assert "kap-001-kapitel-a" in anchors_in(text)
def test_merge_invalid_directory(tmp_path):