R语言 在单个夸托PDF输出中创建多个页面方向时,在横向页面上使用“几何”

aor9mmx1  于 2023-02-17  发布在  其他
关注(0)|答案(1)|浏览(171)

我使用typearea package of KOMA-Script在一个PDF文档中生成纵向和横向页面-请参见Option 2 here
然而,几何设置只适用于纵向页面,而不适用于横向页面。

1.使用标题中的几何设置?

2.在KOMA命令中设置横向页面的几何图形?

---
title: "Portrait and Landscape"
format:
  pdf:
    geometry:
      - top=80mm
      - bottom=30mm
      - left=30mm
      - right=30mm
    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>.
gjmwrych

gjmwrych1#

usegeometry选项在这种情况下会很有帮助。
通常typearea并不关心你是否在任何配置下使用它和geometry包,特别是,这意味着geometry并不识别typearea对页面参数所做的任何改变,例如当它改变纸张大小时--这不是geometry本身所提供的功能。
一旦设置了选项usegeometrytypearea就会尝试将其所有选项转换为geometry的选项。如果在文档中激活新参数,typearea甚至会调用\newgeometry。由于geometry不支持使用\newgeometry更改纸张大小或页面方向,typearea使用内部命令和几何长度来根据需要提供此类更改。

---
title: "Portrait and Landscape"
format:
  pdf:
    geometry:
      - showframe
      - top=80mm
      - bottom=20mm
      - left=30mm
      - right=30mm
    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{usegeometry, paper=landscape,pagesize}
\recalctypearea
\newgeometry{right=80mm,left=20mm,top=30mm,bottom=30mm}

# 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
\newgeometry{top=80mm,bottom=20mm,left=30mm,right=30mm}

# 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>.

此外,请参阅TeXStackExchange提供的this优秀答案,该答案演示了使用和不使用geometry包时实现此操作的方法。

  • 注意:我使用几何封装选项showframe只是为了显示边距 *

相关问题