> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/zh-cn/ge-shi-hua/08-single-sided-and-double-sided-documents.md).

# 单面和双面文档

## 引言

LaTeX 附带若干“标准”文档类，可用于创建不同类型的文档，包括： `article`, `book`, `报告`, `letter`, `幻灯片` 和 `proc` （用于会议论文集）。LaTeX 还提供了 `minimal` 文档类，用于调试，或者作为编写你自己的类文件的基础。许多额外的文档类发布在 [Overleaf 模板图库](https://www.overleaf.com/latex/templates)，或者可以 [从 CTAN 下载](https://ctan.org/topic/class).

## 创建双面文档

要创建双面文档，请将 `twoside` 选项传递给 `\documentclass` 声明；例如：

```latex
\documentclass[twoside]{article}
```

**注意**:

* 该 `book` 文档类默认是双面，因此你无需添加 `twoside` 选项。
* 该 `幻灯片` 文档类不支持 `twoside` 选项——也许因为让演示幻灯片这样做没有意义。

### 用于探索文档版式的 Overleaf 示例

下面的示例提供了一个小型 Overleaf 项目，它使用 `布局` 包来创建图形，显示所选文档类的初始（*默认*）文档版式。这些默认值可以通过加载诸如 `geometry`之类的宏包来更改，这些宏包会修改 LaTeX 页面布局参数的默认值。参见文章 [页面大小和页边距](/latex/zh-cn/ge-shi-hua/07-page-size-and-margins.md) 和 [LaTeX 页面布局参数可视化指南](/latex/zh-cn/shen-ru-wen-zhang/04-a-visual-guide-to-latex-s-page-layout-parameters.md) 以获取更多信息。

对于双面文档， `book` 文档类，以及其他使用 `twoside` 选项的文档类，该示例将为左页和右页分别创建图形。打开项目后，你会看到左页和右页，适用于 `\documentclass[twoside]{article}`.

```latex
% 选择要可视化其版式的文档类：取消注释
% 取消你想要的那一项，对其余项加注释。
% \documentclass[a4paper]{article} %生成一页（基于 A4 纸张大小）
% \documentclass[a4paper]{report} %生成一页（基于 A4 纸张大小）
% \documentclass[twoside,a4paper]{report} %生成两页（基于 A4 纸张大小）
% \documentclass[a4paper]{book} %生成两页（基于 A4 纸张大小）
% \documentclass[a4paper]{letter} %生成一页（基于 A4 纸张大小）
% \documentclass[twoside, a4paper]{letter} %生成两页（基于 A4 纸张大小）
\documentclass[twoside,a4paper]{article} %生成两页（基于 A4 纸张大小）
\usepackage{layout}
\begin{document}
\layout
\end{document}
```

[打开此项目，探索标准 LaTeX 文档类的版式。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=document+class+layout\&snip=%25+Choose+the+document+class+whose+layout+you+want+to+visualize%3A+uncomment%0A%25+the+one+you+want%2C+comment+out+the+others.%0A%25+%5Cdocumentclass%5Ba4paper%5D%7Barticle%7D+%25Produces+one+page+%28based+on+A4+paper+size%29%0A%25+%5Cdocumentclass%5Ba4paper%5D%7Breport%7D+%25Produces+one+page+%28based+on+A4+paper+size%29%0A%25+%5Cdocumentclass%5Btwoside%2Ca4paper%5D%7Breport%7D+%25Produces+two+pages+%28based+on+A4+paper+size%29%0A%25+%5Cdocumentclass%5Ba4paper%5D%7Bbook%7D+%25Produces+two+pages+%28based+on+A4+paper+size%29%0A%25+%5Cdocumentclass%5Ba4paper%5D%7Bletter%7D+%25Produces+one+page+%28based+on+A4+paper+size%29%0A%25+%5Cdocumentclass%5Btwoside%2C+a4paper%5D%7Bletter%7D+%25Produces+two+pages+%28based+on+A4+paper+size%29%0A%5Cdocumentclass%5Btwoside%2Ca4paper%5D%7Barticle%7D+%25Produces+two+pages+%28based+on+A4+paper+size%29%0A%5Cusepackage%7Blayout%7D%0A%5Cbegin%7Bdocument%7D%0A%5Clayout%0A%5Cend%7Bdocument%7D)

此示例会生成如下图所示的图形。请注意，下图为了本文展示清晰已被裁剪/编辑。

![LaTeX 文档版式示意图](/files/b632fb471b71830229facbeeffb2b3268faa6ef7)

## 进一步阅读

* [`geometry` 包文档](https://ctan.org/pkg/geometry?lang=en)
* [LaTeX 页面布局参数可视化指南](/latex/zh-cn/shen-ru-wen-zhang/04-a-visual-guide-to-latex-s-page-layout-parameters.md)
* [页面大小和页边距](/latex/zh-cn/ge-shi-hua/07-page-size-and-margins.md)
* [脚注](/latex/zh-cn/ge-shi-hua/14-footnotes.md)
* [边注](/latex/zh-cn/ge-shi-hua/15-margin-notes.md)
* [页眉和页脚](/latex/zh-cn/ge-shi-hua/02-headers-and-footers.md)
* [章节和小节](/latex/zh-cn/wen-dang-jie-gou/01-sections-and-chapters.md)
* [大型项目中的管理](/latex/zh-cn/wen-dang-jie-gou/07-management-in-a-large-project.md)
* [多文件 LaTeX 项目](/latex/zh-cn/wen-dang-jie-gou/08-multi-file-latex-projects.md)
* [文本对齐](/latex/zh-cn/ge-shi-hua/06-text-alignment.md)
* [字体大小、字体族和样式](/latex/zh-cn/zi-ti/01-font-sizes-families-and-styles.md)
* [插入图片](/latex/zh-cn/geng-duo-zhu-ti/27-inserting-images.md)
* [图片和表格的位置](/latex/zh-cn/tu-biao-he-biao-ge/02-positioning-images-and-tables.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/zh-cn/ge-shi-hua/08-single-sided-and-double-sided-documents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
