gpt4 book ai didi

pdf - 在单个四开 PDF 输出中创建多页面方向

转载 作者:行者123 更新时间:2023-12-02 01:27:06 24 4
gpt4 key购买 nike

想法是在 quarto 中复制 rmarkdown 上的 PDF 输出,在本例中,是在单个文档上创建多页方向。在 rmarkdown 中,我可以使用 trick 轻松完成.但是,我无法在四开本中这样做,它一直在发送错误消息

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 并插入原始 latex 来开始和结束横向页面来创建多页面方向,但它会清除所有 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}}

最佳答案

选项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

您还可以使用 typearea package of KOMA-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>.

关于pdf - 在单个四开 PDF 输出中创建多页面方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74229798/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com