Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
\documentclass{article}
\usepackage{amsmath}

\begin{document}

\section*{Hello World!}

This is a simple LaTeX document saying Hello World! Below is a mathematical formula from linear algebra, representing the dot product of two vectors:

\[
\mathbf{a} \cdot \mathbf{b} = a_1b_1 + a_2b_2 + \dots + a_nb_n
\]

\end{document}
Binary file not shown.
17 changes: 17 additions & 0 deletions tex2pdf-service/tests/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,3 +752,20 @@ def test_makeindex(docker_container):
# pdflatex (creates .idx), makeindex (creates .ind), pdflatex, pdflatex
assert len(meta["converters"][0]["runs"]) == 4
assert meta["converters"][0]["runs"][1]["step"] == "makeindex_run"


@pytest.mark.integration
def test_texlive_version_autodetect_set(docker_container):
"""Test that texlive_version is correctly set in outcome and in zzrm when auto-detected."""
url = docker_container + "/convert"
tarball = os.path.join(
SELF_DIR, "fixture/tarballs/test-texlive-version-auto-detect-set/test-texlive-version-auto-detect-set.tar.gz"
)
outcome = os.path.join(SELF_DIR, "output/test-texlive-version-auto-detect-set.outcome.tar.gz")
meta, status = submit_tarball(url, tarball, outcome, api_args={"auto_detect": "true"})
assert status == 200
assert meta is not None
assert meta["texlive_version"] is not None
assert meta["texlive_version"].startswith("20")
assert "texlive_version" in meta["zzrm"]["generated"]
assert "texlive_version" in meta["zzrm"]["content"]
5 changes: 5 additions & 0 deletions tex2pdf-service/tex2pdf/converter_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
GIT_COMMIT_HASH,
ID_TAG,
MAX_TIME_BUDGET,
TEXLIVE_BASE_RELEASE,
catalog_files,
file_props,
file_props_in_dir,
Expand Down Expand Up @@ -161,6 +162,7 @@ def generate_pdf(self) -> str | None:

# this might raise various exceptions, that should be reported to the API down the line
self.zzrm = ZeroZeroReadMe(self.in_dir)
assert self.zzrm is not None

self.outcome = {
ID_TAG: self.tag,
Expand All @@ -171,6 +173,7 @@ def generate_pdf(self) -> str | None:
"use_addon_tree": self.use_addon_tree,
"max_tex_files": self.max_tex_files,
"max_appending_files": self.max_appending_files,
"texlive_version": TEXLIVE_BASE_RELEASE,
}
if self.water.text:
self.outcome["watermark"] = self.water
Expand All @@ -193,6 +196,8 @@ def generate_pdf(self) -> str | None:
raise Exception("Preflight didn't succeed!")
if not self.zzrm.update_from_preflight(preflight_response):
raise ZZRMUnderspecified("Cannot determine compiler from preflight and sources")
if not self.zzrm.texlive_version or self.zzrm.texlive_version is None:
self.zzrm.texlive_version = int(TEXLIVE_BASE_RELEASE)

# we should now be ready to go
if not self.zzrm.is_ready_for_compilation:
Expand Down
Loading