mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Add latex settings (#152350)
- Fixes #147027 - Only lualatex can build our 3K pages PDF with reasonable quality, xelatex runs out of memory and pdflatex just fails. - Move notes under the same toctree as python-api which is needed for the PDF but doesn't change how the HTML is generated. This is the produced PDF: [pytorch.pdf](https://github.com/user-attachments/files/19945450/pytorch.pdf) Pull Request resolved: https://github.com/pytorch/pytorch/pull/152350 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
e6e1ca1996
commit
e58c73be44
37
README.md
37
README.md
@ -35,6 +35,7 @@ Our trunk health (Continuous Integration signals) can be found at [hud.pytorch.o
|
||||
- [Using pre-built images](#using-pre-built-images)
|
||||
- [Building the image yourself](#building-the-image-yourself)
|
||||
- [Building the Documentation](#building-the-documentation)
|
||||
- [Building a PDF](#building-a-pdf)
|
||||
- [Previous Versions](#previous-versions)
|
||||
- [Getting Started](#getting-started)
|
||||
- [Resources](#resources)
|
||||
@ -426,8 +427,6 @@ make -f docker.Makefile
|
||||
To build documentation in various formats, you will need [Sphinx](http://www.sphinx-doc.org)
|
||||
and the pytorch_sphinx_theme2.
|
||||
|
||||
|
||||
|
||||
Before you build the documentation locally, ensure `torch` is
|
||||
installed in your environment. For small fixes, you can install the
|
||||
nightly version as described in [Getting Started](https://pytorch.org/get-started/locally/).
|
||||
@ -466,6 +465,40 @@ If you get a katex error run `npm install katex`. If it persists, try
|
||||
When you make changes to the dependencies run by CI, edit the
|
||||
`.ci/docker/requirements-docs.txt` file.
|
||||
|
||||
#### Building a PDF
|
||||
|
||||
To compile a PDF of all PyTorch documentation, ensure you have
|
||||
`texlive` and LaTeX installed. On macOS, you can install them using:
|
||||
|
||||
```
|
||||
brew install --cask mactex
|
||||
```
|
||||
|
||||
To create the PDF:
|
||||
|
||||
1. Run:
|
||||
|
||||
```
|
||||
make latexpdf
|
||||
```
|
||||
|
||||
This will generate the necessary files in the `build/latex` directory.
|
||||
|
||||
2. Navigate to this directory and execute:
|
||||
|
||||
```
|
||||
make LATEXOPTS="-interaction=nonstopmode"
|
||||
```
|
||||
|
||||
This will produce a `pytorch.pdf` with the desired content. Run this
|
||||
command one more time so that it generates the correct table
|
||||
of contents and index.
|
||||
|
||||
> [!NOTE]
|
||||
> To view the Table of Contents, switch to the **Table of Contents**
|
||||
> view in your PDF viewer.
|
||||
|
||||
|
||||
### Previous Versions
|
||||
|
||||
Installation instructions and binaries for previous PyTorch versions may be found
|
||||
|
Reference in New Issue
Block a user