2.1. 创建项目¶
让我们从零开始创建一个简单的项目。
2.1.1. 从零开始创建项目¶
首先,为我们的项目创建一个文件夹。
!mkdir -p mybook
然后创建两个页面。index.md
是索引页,它包含目录(TOC),目录中包括了另一个页面 get_started.md
。请注意,目录是在带有 toc
标签的代码块中定义的。如果你熟悉 Sphinx,你会发现这与 Sphinx 中定义目录的方式相似。请参阅第 2.5 节,了解更多 d2lbook
为 Markdown 增加的扩展功能。另请注意,我们使用了 Jupyter 提供的内置魔法命令 writefile
,将代码块保存到文件中。
%%writefile mybook/index.md
# My Book
The starting page of my book with `d2lbook`.
````toc
get_started
````
Writing mybook/index.md
%%writefile mybook/get_started.md
# Getting Started
Please first install my favorite package `numpy`.
Writing mybook/get_started.md
现在,让我们构建 HTML 版本。
!cd mybook && d2lbook build html
[d2lbook:build.py:L147] INFO 2 notebooks are outdated
[d2lbook:build.py:L149] INFO [1] ./index.md
[d2lbook:build.py:L149] INFO [2] ./get_started.md
[d2lbook:build.py:L153] INFO Evaluating notebooks in parallel with 8 CPU workers and 8 GPU workers
[d2lbook:resource.py:L196] INFO Starting task "Evaluating ./index.md" on CPU [7]
[d2lbook:resource.py:L159] INFO Status: 1 running tasks, 0 done, 1 not started
[d2lbook:resource.py:L164] INFO - Task "Evaluating ./index.md" on CPU [7] is running for 00:00:00
[d2lbook:resource.py:L196] INFO Starting task "Evaluating ./get_started.md" on CPU [3]
[d2lbook:resource.py:L159] INFO Status: 2 running tasks, 0 done, 0 not started
[d2lbook:resource.py:L164] INFO - Task "Evaluating ./index.md" on CPU [7] is running for 00:00:02
[d2lbook:resource.py:L164] INFO - Task "Evaluating ./get_started.md" on CPU [3] is running for 00:00:00
[d2lbook:resource.py:L223] INFO Task "Evaluating ./index.md" on CPU [7] is finished in 00:00:03
[d2lbook:resource.py:L223] INFO Task "Evaluating ./get_started.md" on CPU [3] is finished in 00:00:02
[d2lbook:resource.py:L142] INFO All 2 tasks are done, sorting by runtime:
[d2lbook:resource.py:L148] INFO - 00:00:02 on CPU [3] for Evaluating ./get_started.md
[d2lbook:resource.py:L148] INFO - 00:00:03 on CPU [7] for Evaluating ./index.md
[d2lbook:build.py:L56] INFO === Finished "d2lbook build eval" in 00:00:11
[d2lbook:build.py:L322] INFO 2 rst files are outdated
[d2lbook:build.py:L324] INFO Convert _build/eval/index.ipynb to _build/rst/index.rst
[d2lbook:build.py:L324] INFO Convert _build/eval/get_started.ipynb to _build/rst/get_started.rst
[d2lbook:build.py:L56] INFO === Finished "d2lbook build rst" in 00:00:12
[d2lbook:build.py:L56] INFO === Finished "d2lbook build ipynb" in 00:00:00
[d2lbook:build.py:L56] INFO === Finished "d2lbook build colab" in 00:00:00
[d2lbook:build.py:L56] INFO === Finished "d2lbook build sagemaker" in 00:00:00
Running Sphinx v5.3.0
making output directory... done
checking bibtex cache... out of date
parsing bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/mybook/_build/rst... WARNING: could not open bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/mybook/_build/rst.
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.
The HTML pages are in _build/html.
[d2lbook:build.py:L56] INFO === Finished "d2lbook build html" in 00:00:13
构建完成后,HTML 索引页位于 mybook/_build/html/index.html
。
2.1.2. 配置¶
你可以通过根目录下的 config.ini
文件来自定义构建和发布的结果。
%%writefile mybook/config.ini
[project]
# Specify the PDF filename to mybook.pdf
name = mybook
# Specify the authors names in PDF
author = Adam Smith, Alex Li
[html]
# Add two links on the navbar. A link consists of three
# items: name, URL, and a fontawesome icon. Items are separated by commas.
header_links = PDF, https://book.d2l.ai/d2l-book.pdf, fas fa-file-pdf,
Github, https://github.com/d2l-ai/d2l-book, fab fa-github
Writing mybook/config.ini
让我们清除并重新构建。
!cd mybook && rm -rf _build && d2lbook build html
[d2lbook:config.py:L12] INFO Load configure from config.ini
[d2lbook:build.py:L147] INFO 2 notebooks are outdated
[d2lbook:build.py:L149] INFO [1] ./index.md
[d2lbook:build.py:L149] INFO [2] ./get_started.md
[d2lbook:build.py:L153] INFO Evaluating notebooks in parallel with 8 CPU workers and 8 GPU workers
[d2lbook:resource.py:L196] INFO Starting task "Evaluating ./index.md" on CPU [5]
[d2lbook:resource.py:L159] INFO Status: 1 running tasks, 0 done, 1 not started
[d2lbook:resource.py:L164] INFO - Task "Evaluating ./index.md" on CPU [5] is running for 00:00:00
[d2lbook:resource.py:L196] INFO Starting task "Evaluating ./get_started.md" on CPU [0]
[d2lbook:resource.py:L159] INFO Status: 2 running tasks, 0 done, 0 not started
[d2lbook:resource.py:L164] INFO - Task "Evaluating ./index.md" on CPU [5] is running for 00:00:02
[d2lbook:resource.py:L164] INFO - Task "Evaluating ./get_started.md" on CPU [0] is running for 00:00:00
[d2lbook:resource.py:L223] INFO Task "Evaluating ./index.md" on CPU [5] is finished in 00:00:03
[d2lbook:resource.py:L223] INFO Task "Evaluating ./get_started.md" on CPU [0] is finished in 00:00:02
[d2lbook:resource.py:L142] INFO All 2 tasks are done, sorting by runtime:
[d2lbook:resource.py:L148] INFO - 00:00:02 on CPU [0] for Evaluating ./get_started.md
[d2lbook:resource.py:L148] INFO - 00:00:03 on CPU [5] for Evaluating ./index.md
[d2lbook:build.py:L56] INFO === Finished "d2lbook build eval" in 00:00:09
[d2lbook:build.py:L322] INFO 2 rst files are outdated
[d2lbook:build.py:L324] INFO Convert _build/eval/index.ipynb to _build/rst/index.rst
[d2lbook:build.py:L324] INFO Convert _build/eval/get_started.ipynb to _build/rst/get_started.rst
[d2lbook:build.py:L56] INFO === Finished "d2lbook build rst" in 00:00:10
[d2lbook:build.py:L56] INFO === Finished "d2lbook build ipynb" in 00:00:00
[d2lbook:build.py:L56] INFO === Finished "d2lbook build colab" in 00:00:00
[d2lbook:build.py:L56] INFO === Finished "d2lbook build sagemaker" in 00:00:00
Running Sphinx v5.3.0
making output directory... done
checking bibtex cache... out of date
parsing bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/mybook/_build/rst... WARNING: could not open bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/mybook/_build/rst.
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.
The HTML pages are in _build/html.
[d2lbook:build.py:L56] INFO === Finished "d2lbook build html" in 00:00:11
如果你再次打开 index.html
,你会在导航栏上看到这两个链接。
我们来构建 PDF 输出,你会在输出日志中找到 Output written on mybook.pdf (7 pages).
。
!cd mybook && d2lbook build pdf
[d2lbook:config.py:L12] INFO Load configure from config.ini [d2lbook:build.py:L147] INFO 0 notebooks are outdated [d2lbook:build.py:L153] INFO Evaluating notebooks in parallel with 8 CPU workers and 8 GPU workers [d2lbook:build.py:L56] INFO === Finished "d2lbook build eval" in 00:00:00 [d2lbook:build.py:L322] INFO 0 rst files are outdated [d2lbook:build.py:L56] INFO === Finished "d2lbook build rst" in 00:00:00 Running Sphinx v5.3.0 making output directory... done checking bibtex cache... out of date parsing bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/mybook/_build/rst... WARNING: could not open bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/mybook/_build/rst. building [mo]: targets for 0 po files that are out of date building [latex]: all documents updating environment: [new config] 2 added, 0 changed, 0 removed looking for now-outdated files... none found pickling environment... done checking consistency... done processing mybook.tex... index get_started resolving references... done writing... done copying TeX support files... copying TeX support files... done build succeeded, 1 warning. The LaTeX files are in _build/pdf. Run 'make' in that directory to run these through (pdf)latex (use `make latexpdf' here to do that automatically). latexmk -pdf -dvi- -ps- 'mybook.tex' Latexmk: This is Latexmk, John Collins, 1 January 2015, version: 4.41. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Rules & subrules not known to be previously run: pdflatex Rule 'pdflatex': The following rules & subrules became out-of-date: 'pdflatex' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'xelatex -recorder "mybook.tex"' ------------ This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex) restricted write18 enabled. entering extended mode (./mybook.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 84 language(s) loaded. (./sphinxmanual.cls Document Class: sphinxmanual 2019/12/01 v2.3.0 Document class (Sphinx manual) (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls Document Class: report 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))) (/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty Package cmap Warning: pdftex not detected - exiting. ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) (/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))) (./sphinxoptionshyperref.sty) (./sphinxoptionsgeometry.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty) (/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty) (/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (./sphinxlatexgraphics.sty) (./sphinxpackageboxes.sty) (./sphinxlatexadmonitions.sty (/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty)) (./sphinxlatexliterals.sty (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix <2008/02/07> (tvz)) (/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty) (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty)) (./sphinxlatexshadowbox.sty) (./sphinxlatexcontainers.sty) (./sphinxhighlight.sty) (./sphinxlatextables.sty (/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty)) (./sphinxlatexnumfig.sty (/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty)) (./sphinxlatexlists.sty) (./sphinxpackagefootnote.sty) (./sphinxlatexindbibtoc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)) (./sphinxlatexstylepage.sty (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty) (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)) (./sphinxlatexstyleheadings.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)) (./sphinxlatexstyletext.sty) (./sphinxlatexobjects.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty) (./sphinxmessages.sty) (/usr/share/texlive/texmf-dist/tex/latex/blindtext/blindtext.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)) (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty) Writing index file mybook.idx (./mybook.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) geometry driver: auto-detecting geometry detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) Package hyperref Warning: Rerun to get /PageLabels entry. (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] [1] [2] [1] [2] Chapter 1. No file mybook.ind. [3] (./mybook.aux) LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. ) Output written on mybook.pdf (7 pages). Transcript written on mybook.log. Latexmk: Index file 'mybook.idx' was written Latexmk: References changed. Latexmk: Missing input file: 'mybook.ind' from line 'No file mybook.ind.' Latexmk: References changed. Latexmk: Log file says output to 'mybook.pdf' Latexmk: applying rule 'makeindex mybook.idx'... Rule 'makeindex mybook.idx': File changes, etc: Non-existent destination files: 'mybook.ind' ------------ Run number 1 of rule 'makeindex mybook.idx' ------------ ------------ Running 'internal xindy -L english -C utf8 -M sphinx.xdy -o "mybook.ind" "mybook.idx"' ------------ Latexmk: calling xindy( -L english -C utf8 -M sphinx.xdy -o mybook.ind mybook.idx ) Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'mybook.aux' 'mybook.ind' ------------ Run number 2 of rule 'pdflatex' ------------ ------------ Running 'xelatex -recorder "mybook.tex"' ------------ This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex) restricted write18 enabled. entering extended mode (./mybook.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 84 language(s) loaded. (./sphinxmanual.cls Document Class: sphinxmanual 2019/12/01 v2.3.0 Document class (Sphinx manual) (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls Document Class: report 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))) (/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty Package cmap Warning: pdftex not detected - exiting. ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) (/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))) (./sphinxoptionshyperref.sty) (./sphinxoptionsgeometry.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty) (/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty) (/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (./sphinxlatexgraphics.sty) (./sphinxpackageboxes.sty) (./sphinxlatexadmonitions.sty (/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty)) (./sphinxlatexliterals.sty (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix <2008/02/07> (tvz)) (/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty) (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty)) (./sphinxlatexshadowbox.sty) (./sphinxlatexcontainers.sty) (./sphinxhighlight.sty) (./sphinxlatextables.sty (/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty)) (./sphinxlatexnumfig.sty (/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty)) (./sphinxlatexlists.sty) (./sphinxpackagefootnote.sty) (./sphinxlatexindbibtoc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)) (./sphinxlatexstylepage.sty (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty) (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)) (./sphinxlatexstyleheadings.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)) (./sphinxlatexstyletext.sty) (./sphinxlatexobjects.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty) (./sphinxmessages.sty) (/usr/share/texlive/texmf-dist/tex/latex/blindtext/blindtext.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)) (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty) Writing index file mybook.idx (./mybook.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) geometry driver: auto-detecting geometry detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./mybook.out) (./mybook.out) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] (./mybook.toc) [1] [2] [1] [2] Chapter 1. (./mybook.ind) [3] (./mybook.aux) ) Output written on mybook.pdf (7 pages). Transcript written on mybook.log. Latexmk: Index file 'mybook.idx' was written Latexmk: Log file says output to 'mybook.pdf' Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'mybook.out' 'mybook.toc' ------------ Run number 3 of rule 'pdflatex' ------------ ------------ Running 'xelatex -recorder "mybook.tex"' ------------ This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex) restricted write18 enabled. entering extended mode (./mybook.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 84 language(s) loaded. (./sphinxmanual.cls Document Class: sphinxmanual 2019/12/01 v2.3.0 Document class (Sphinx manual) (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls Document Class: report 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))) (/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty Package cmap Warning: pdftex not detected - exiting. ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) (/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))) (./sphinxoptionshyperref.sty) (./sphinxoptionsgeometry.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty) (/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty) (/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (./sphinxlatexgraphics.sty) (./sphinxpackageboxes.sty) (./sphinxlatexadmonitions.sty (/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty)) (./sphinxlatexliterals.sty (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix <2008/02/07> (tvz)) (/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty) (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty)) (./sphinxlatexshadowbox.sty) (./sphinxlatexcontainers.sty) (./sphinxhighlight.sty) (./sphinxlatextables.sty (/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty)) (./sphinxlatexnumfig.sty (/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty)) (./sphinxlatexlists.sty) (./sphinxpackagefootnote.sty) (./sphinxlatexindbibtoc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)) (./sphinxlatexstylepage.sty (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty) (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)) (./sphinxlatexstyleheadings.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)) (./sphinxlatexstyletext.sty) (./sphinxlatexobjects.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty) (./sphinxmessages.sty) (/usr/share/texlive/texmf-dist/tex/latex/blindtext/blindtext.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)) (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty) Writing index file mybook.idx (./mybook.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) geometry driver: auto-detecting geometry detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./mybook.out) (./mybook.out) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] (./mybook.toc) [1] [2] [1] [2] Chapter 1. (./mybook.ind) [3] (./mybook.aux) ) Output written on mybook.pdf (7 pages). Transcript written on mybook.log. Latexmk: Index file 'mybook.idx' was written Latexmk: Log file says output to 'mybook.pdf' Latexmk: All targets (mybook.pdf) are up-to-date [d2lbook:build.py:L56] INFO === Finished "d2lbook build pdf" in 00:00:04
我们将在后续章节中介绍更多配置选项。你可以查看 default_config.ini 来了解所有配置选项及其默认值。也可以查看以下项目中的 config.ini
示例:
最后,让我们清理一下工作区。
!rm -rf mybook