fix(docs): remove broken abbreviations float caption
This commit is contained in:
@@ -25,5 +25,3 @@
|
|||||||
\renewcommand{\arraystretch}{1.3}
|
\renewcommand{\arraystretch}{1.3}
|
||||||
|
|
||||||
% \hypersetup{pdfauthor={lda.chat}, pdftitle={Design and Implementation of lda.chat}}
|
% \hypersetup{pdfauthor={lda.chat}, pdftitle={Design and Implementation of lda.chat}}
|
||||||
\usepackage{newfloat}
|
|
||||||
\DeclareFloatingEnvironment{none}
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ diagram:
|
|||||||
|
|
||||||
# List of Abbreviations {.unnumbered}
|
# List of Abbreviations {.unnumbered}
|
||||||
|
|
||||||
|
<!-- The heading identifies this captionless table; it has no table number. -->
|
||||||
| Abbreviation | Meaning |
|
| Abbreviation | Meaning |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| API | Application Programming Interface |
|
| API | Application Programming Interface |
|
||||||
@@ -61,8 +62,6 @@ diagram:
|
|||||||
| RPC | Remote Procedure Call |
|
| RPC | Remote Procedure Call |
|
||||||
| USTH | University of Science and Technology of Hanoi |
|
| USTH | University of Science and Technology of Hanoi |
|
||||||
|
|
||||||
: Abbreviations used in the thesis. {#tbl:abbreviations .unnumbered}
|
|
||||||
|
|
||||||
# Abstract {.unnumbered}
|
# Abstract {.unnumbered}
|
||||||
|
|
||||||
Preparing reports, transforming documents, and collecting workspace information
|
Preparing reports, transforming documents, and collecting workspace information
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
"""Exercise the abbreviations table through the actual Pandoc/LaTeX boundary."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
THESIS = ROOT / "docs/thesis"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
any(shutil.which(tool) is None for tool in ("pandoc", "xelatex", "pdftotext")),
|
||||||
|
reason="Pandoc, XeLaTeX, and pdftotext are needed for the front-matter build",
|
||||||
|
)
|
||||||
|
def test_abbreviations_compile_without_a_dummy_float(tmp_path: Path) -> None:
|
||||||
|
"""Catch the unnumbered longtable/caption 'none' float failure in isolation."""
|
||||||
|
manuscript = (THESIS / "system-design-implementation.md").read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
|
abbreviations = manuscript.split("# List of Abbreviations", 1)[1]
|
||||||
|
abbreviations = "# List of Abbreviations" + abbreviations.split("# Abstract", 1)[0]
|
||||||
|
output = tmp_path / "abbreviations.pdf"
|
||||||
|
# Use the real preamble: the caption-package interaction is absent from a
|
||||||
|
# plain table-only Pandoc build. XeLaTeX also matches the thesis generator.
|
||||||
|
result = subprocess.run(
|
||||||
|
[
|
||||||
|
"pandoc",
|
||||||
|
"--from=markdown",
|
||||||
|
"--standalone",
|
||||||
|
"--pdf-engine=xelatex",
|
||||||
|
"--metadata=documentclass:report",
|
||||||
|
"--include-in-header",
|
||||||
|
str(THESIS / "header-includes.tex"),
|
||||||
|
"--output",
|
||||||
|
str(output),
|
||||||
|
],
|
||||||
|
input=abbreviations,
|
||||||
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
capture_output=True,
|
||||||
|
check=False,
|
||||||
|
timeout=90,
|
||||||
|
)
|
||||||
|
assert result.returncode == 0, result.stderr
|
||||||
|
assert output.read_bytes().startswith(b"%PDF-")
|
||||||
|
rendered = subprocess.run(
|
||||||
|
["pdftotext", "-layout", str(output), "-"],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
check=True,
|
||||||
|
timeout=15,
|
||||||
|
).stdout
|
||||||
|
assert "API" in rendered
|
||||||
|
assert "Application Programming Interface" in rendered
|
||||||
|
assert "None 1" not in rendered
|
||||||
Reference in New Issue
Block a user