Skip to content

Commit

Permalink
Add pdf guide
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfcyx committed Apr 6, 2023
1 parent 99ca7fe commit 78072bf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source/setup-sphinx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@

1. ``pip install autoload`` 安装 Sphinx 自动加载插件。
2. 在项目根目录下 ``sphinx-autobuild source build/html`` 即可在浏览器中访问 `http://127.0.0.1:8000/` 查看本地构建的主页。

.. note::

**如何生成教程pdf电子版**

注意:经过尝试在 wsl 环境下无法生成 pdf ,请使用原生的 Ubuntu Desktop 或者虚拟机。

1. 首先 ``sudo apt update`` ,然后通过 ``sudo apt install`` 安装如下软件包: latexmk texlive-latex-recommended texlive-latex-extra texlive-xetex fonts-freefont-otf texlive-fonts-recommended texlive-lang-chinese tex-gyre.
2. 从 Node.js 官方网站下载最新版的 Node.js ,配置好环境变量并通过 ``npm --version`` 确认配置正确。然后通过 ``npm install -g @mermaid-js/mermaid-cli`` 安装 mermaid 命令行工具。
3. 确认 Python 环境配置正确,也即 ``make html`` 可以正常生成 html 。
4. 打上必要的补丁:在根目录下执行 ``git apply --reject scripts/latexpdf.patch`` 。
5. 构建:在根目录下执行 ``make latexpdf`` ,过程中会有很多 latex 的警告,但可以忽略。
6. 构建结束后,电子版 pdf 可以在 ``build/latex/rcore-tutorial-book-v3.pdf`` 找到。

0 comments on commit 78072bf

Please sign in to comment.