From 305df30c85341581ec21056cef9ff17c37cab733 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Wed, 3 Sep 2025 10:49:19 +0200 Subject: [PATCH] fix: replace invalid orientation parameter with flipped in Typst templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace orientation: orientation with flipped: orientation == "landscape" - Add conditional width: auto for single-page landscape exports - Ensure all templates use correct Typst page() parameters - Fix compilation errors in modern, article, report, and default templates Resolves Typst compilation error: "unexpected argument: orientation" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- templates/article.typ | 10 ++++++++-- templates/default.typ | 10 ++++++++-- templates/modern.typ | 10 ++++++++-- templates/report.typ | 10 ++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/templates/article.typ b/templates/article.typ index 5d2cf79..8eb2d9f 100644 --- a/templates/article.typ +++ b/templates/article.typ @@ -99,9 +99,15 @@ // Set page layout with conditional height based on export format set page( paper: paper, - orientation: orientation, + flipped: orientation == "landscape", margin: page-margin, - ..if export_format == "single-page" { (height: auto,) } else { (:) }, + ..if export_format == "single-page" and orientation == "landscape" { + (width: auto,) + } else if export_format == "single-page" { + (height: auto,) + } else { + (:) + }, numbering: pagenumbering, header: context { if counter(page).get().first() > 1 [ diff --git a/templates/default.typ b/templates/default.typ index f0f2996..31d5412 100644 --- a/templates/default.typ +++ b/templates/default.typ @@ -97,9 +97,15 @@ // Set page layout with conditional height based on export format set page( paper: paper, - flipped: false, + flipped: orientation == "landscape", margin: (top: 2.5cm, right: 1.5cm, bottom: 2cm, left: 2.5cm), - ..if export_format == "single-page" { (height: auto,) } else { (:) }, + ..if export_format == "single-page" and orientation == "landscape" { + (width: auto,) + } else if export_format == "single-page" { + (height: auto,) + } else { + (:) + }, numbering: pagenumbering, header: context { if counter(page).get().first() > 1 [ diff --git a/templates/modern.typ b/templates/modern.typ index b360d10..bc0de43 100644 --- a/templates/modern.typ +++ b/templates/modern.typ @@ -94,9 +94,15 @@ // Set page layout with conditional height based on export format set page( paper: paper, - orientation: orientation, + flipped: orientation == "landscape", margin: (top: 2.5cm, right: 1.5cm, bottom: 2cm, left: 2.5cm), - ..if export_format == "single-page" { (height: auto,) } else { (:) }, + ..if export_format == "single-page" and orientation == "landscape" { + (width: auto,) + } else if export_format == "single-page" { + (height: auto,) + } else { + (:) + }, numbering: pagenumbering, fill: rgb("#fafafa") ) diff --git a/templates/report.typ b/templates/report.typ index 853376e..b1d4175 100644 --- a/templates/report.typ +++ b/templates/report.typ @@ -105,9 +105,15 @@ // Set page layout with conditional height based on export format set page( paper: paper, - orientation: orientation, + flipped: orientation == "landscape", margin: page-margin, - ..if export_format == "single-page" { (height: auto,) } else { (:) }, + ..if export_format == "single-page" and orientation == "landscape" { + (width: auto,) + } else if export_format == "single-page" { + (height: auto,) + } else { + (:) + }, numbering: pagenumbering, header: context { let page-num = counter(page).get().first()