> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-pro.ayaka.space/latex/zh-cn/ge-shi-hua/08-single-sided-and-double-sided-documents.md).

# 单面与双面文档

## 引言

LaTeX 随附若干“标准”文档类，可用于创建不同类型的文档，包括： `article`, `book`, `report`, `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-du-wen-zhang/04-a-visual-guide-to-latex-s-page-layout-parameters.md) 以获取更多信息。

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

```latex
% Choose the document class whose layout you want to visualize: uncomment
% the one you want, comment out the others.
% \documentclass[a4paper]{article} %Produces one page (based on A4 paper size)
% \documentclass[a4paper]{report} %Produces one page (based on A4 paper size)
% \documentclass[twoside,a4paper]{report} %Produces two pages (based on A4 paper size)
% \documentclass[a4paper]{book} %Produces two pages (based on A4 paper size)
% \documentclass[a4paper]{letter} %Produces one page (based on A4 paper size)
% \documentclass[twoside, a4paper]{letter} %Produces two pages (based on A4 paper size)
\documentclass[twoside,a4paper]{article} %Produces two pages (based on A4 paper size)
\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-du-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-xing-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://ayakaleaf-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.
