rmarkdown這個想法是在in上復制 PDF 輸出quarto,在這種情況下,是在單個檔案上創建多頁方向。在rmarkdown我可以通過使用這個技巧輕松做到這一點。但是,我無法在 quarto 中做到這一點,它一直在發送錯誤訊息
compilation failed- error
Undefined control sequence.
l.201 \blandscape
這是我的代碼:
---
title: "Portrait and Landscape"
format:
pdf:
include-in-header:
- packages.tex
---
# Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
\newpage
\blandscape
# Running Code
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
You can add options to executable code like this
The `echo: false` option disables the printing of code (only output is displayed).
\elandscape
有趣的是,我可以通過修改 YAML 并插入原始乳膠來開始和結束橫向頁面來創建多頁面方向,但它會洗掉所有rmarkdown格式并將其轉換為橫向頁面內的普通文本:
---
title: "Portrait and Landscape"
format:
pdf:
include-in-header:
text: |
\usepackage{pdflscape}
---
\begin{landscape}
bla bla bla
\end{landscape}
有沒有解決這個問題的方法?
PS:我的 header.tex 包含這些東西
\usepackage{pdflscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
uj5u.com熱心網友回復:
選項 01
您可以使用lscape LaTeX包。這會旋轉頁面內容,但不會旋轉頁碼。
---
title: "Portrait and Landscape"
format:
pdf:
include-in-header:
text: |
\usepackage{lscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
---
# Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
\newpage
\blandscape
# Running Code
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
You can add options to executable code like this
The `echo: false` option disables the printing of code (only output is displayed).
\elandscape
選項 02
您也可以使用typeareaKOMA-Script 包來執行此操作。據我了解,它不僅改變了頁面內容的方向,而且還設定了 pdf 頁面旋轉屬性,使得具有該屬性的頁面在使用 PDF 查看器查看時將以橫向顯示。并且還保留了頁碼位置。
---
title: "Portrait and Landscape"
format:
pdf:
include-in-header:
text: |
\usepackage{typearea}
---
# Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
\newpage
<!-- changing the orientation to landscape --------------------------------- -->
\KOMAoptions{paper=landscape,pagesize}
\recalctypearea
# Running Code (Landscape)
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
You can add options to executable code like this
The `echo: false` option disables the printing of code (only output is displayed).
\newpage
<!-- % changing the orientation to portrait again -------------------------- -->
\KOMAoptions{paper=portrait,pagesize}
\recalctypearea
# Quarto (Portrait)
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/524687.html
標籤:pdf景观四开
上一篇:為什么這種垂直文本定位有效?
