fix: replace invalid orientation parameter with flipped in Typst templates
- 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 <noreply@anthropic.com>
This commit is contained in:
4 files changed
+32
-8
No files matched your search
@@ -99,9 +99,15 @@
|
|||||||
// Set page layout with conditional height based on export format
|
// Set page layout with conditional height based on export format
|
||||||
set page(
|
set page(
|
||||||
paper: paper,
|
paper: paper,
|
||||||
orientation: orientation,
|
flipped: orientation == "landscape",
|
||||||
margin: page-margin,
|
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,
|
numbering: pagenumbering,
|
||||||
header: context {
|
header: context {
|
||||||
if counter(page).get().first() > 1 [
|
if counter(page).get().first() > 1 [
|
||||||
|
|||||||
@@ -97,9 +97,15 @@
|
|||||||
// Set page layout with conditional height based on export format
|
// Set page layout with conditional height based on export format
|
||||||
set page(
|
set page(
|
||||||
paper: paper,
|
paper: paper,
|
||||||
flipped: false,
|
flipped: orientation == "landscape",
|
||||||
margin: (top: 2.5cm, right: 1.5cm, bottom: 2cm, left: 2.5cm),
|
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,
|
numbering: pagenumbering,
|
||||||
header: context {
|
header: context {
|
||||||
if counter(page).get().first() > 1 [
|
if counter(page).get().first() > 1 [
|
||||||
|
|||||||
@@ -94,9 +94,15 @@
|
|||||||
// Set page layout with conditional height based on export format
|
// Set page layout with conditional height based on export format
|
||||||
set page(
|
set page(
|
||||||
paper: paper,
|
paper: paper,
|
||||||
orientation: orientation,
|
flipped: orientation == "landscape",
|
||||||
margin: (top: 2.5cm, right: 1.5cm, bottom: 2cm, left: 2.5cm),
|
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,
|
numbering: pagenumbering,
|
||||||
fill: rgb("#fafafa")
|
fill: rgb("#fafafa")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -105,9 +105,15 @@
|
|||||||
// Set page layout with conditional height based on export format
|
// Set page layout with conditional height based on export format
|
||||||
set page(
|
set page(
|
||||||
paper: paper,
|
paper: paper,
|
||||||
orientation: orientation,
|
flipped: orientation == "landscape",
|
||||||
margin: page-margin,
|
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,
|
numbering: pagenumbering,
|
||||||
header: context {
|
header: context {
|
||||||
let page-num = counter(page).get().first()
|
let page-num = counter(page).get().first()
|
||||||
|
|||||||
Reference in new issue
Block a user