我想将
R
代码及其输出移至四开渲染 PDF 文档的右侧。你能帮我实现这个目标吗?以下是我正在使用的 YAML
标头:
---
title: |
\huge \textbf{Title}
format:
pdf:
fig-width: 4
fig-height: 3
fig-align: center
out.width: '100%'
fig-format: pdf
include-in-header:
text: |
\usepackage[none]{hyphenat}
\usepackage{enumitem}
\setlist[enumerate]{font=\bfseries}
\usepackage{float}
\usepackage{scrlayer-scrpage}
\usepackage[a4paper,
bindingoffset=0.2in,
left=0.5in,
right=0.5in,
top=0.85in,
bottom=0.85in,
footskip=0.5in]{geometry}
\usepackage{titling}
\setlength{\droptitle}{-2cm}
\clearpairofpagestyles
\lohead*{\textbf{Stat-8010}}
\cohead*{\textbf{Statistical Methods I}}
\rohead*{\textbf{Spring 2025}}
\cofoot*{\pagemark}
\usepackage{etoolbox}
\AtBeginEnvironment{verbatim}{\setlength{\leftskip}{5cm}} % Adjust left margin for verbatim
\AtBeginEnvironment{knitrout}{\setlength{\leftskip}{2cm}} % Adjust left margin for knitrout
execute:
warning: false
message: false
error: false
echo: true
---
# Intro
1. This is a simple use of quarto.
```{r}
1 + 1
```
这是因为你的缩进不正确。我假设“向右移动”是指代码的缩进和右侧的输出。 元素应与列表的第一个字符对齐。 以下将正常工作:
---
title: |
\huge \textbf{Title}
format:
pdf:
fig-width: 4
fig-height: 3
fig-align: center
out.width: '100%'
fig-format: pdf
include-in-header:
text: |
\usepackage[none]{hyphenat}
\usepackage{enumitem}
\setlist[enumerate]{font=\bfseries}
\usepackage{float}
\usepackage{scrlayer-scrpage}
\usepackage[a4paper,
bindingoffset=0.2in,
left=0.5in,
right=0.5in,
top=0.85in,
bottom=0.85in,
footskip=0.5in]{geometry}
\usepackage{titling}
\setlength{\droptitle}{-2cm}
\clearpairofpagestyles
\lohead*{\textbf{Stat-8010}}
\cohead*{\textbf{Statistical Methods I}}
\rohead*{\textbf{Spring 2025}}
\cofoot*{\pagemark}
execute:
warning: false
message: false
error: false
echo: true
---
# Intro
1. This is a simple use of quarto.
```{r}
x <- 1 + 1
x
```