summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/context
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-31 21:54:05 +0000
committerKarl Berry <karl@freefriends.org>2023-03-31 21:54:05 +0000
commit2f04c186edd02736d8445a9a9eafd12da076b765 (patch)
tree30749331b6daee5136595791ae27c505afe53af1 /Master/texmf-dist/doc/context
parent10b6c3cef07d58d2339df9fbef8db60a3b65e878 (diff)
context-notes-zh-cn (31mar23)
git-svn-id: svn://tug.org/texlive/trunk@66725 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/context')
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/LICENSE674
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/README.md11
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdfbin2002991 -> 2035457 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/01.tex30
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/02.tex82
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/03.tex100
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/04.tex34
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/05.tex48
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/06.tex8
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/08.tex53
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/09.tex138
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/10.tex353
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/11.tex903
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/12.tex806
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/13.tex351
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/14.tex271
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bib-style.tex18
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex2
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.bib21
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex15
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex67
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/cmd-window.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cmd-window.png)bin23633 -> 23633 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/foo.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/foo.pdf)bin5906 -> 5906 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/win-r.jpg (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/win-r.jpg)bin150002 -> 150002 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/aligned-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/aligned-1.pdf)bin3333 -> 3333 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/aligned-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/aligned-2.pdf)bin7408 -> 7408 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/fakewords.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fakewords.pdf)bin3506 -> 3506 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/letter.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/letter.pdf)bin11003 -> 11003 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/lines.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/lines.pdf)bin3941 -> 3941 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/parindentcolor.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/parindentcolor.pdf)bin4668 -> 4668 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-2.pdf)bin4612 -> 4612 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-3.pdf)bin4671 -> 4671 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-4.pdf)bin4656 -> 4656 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-5.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-5.pdf)bin4678 -> 4678 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars.pdf)bin3506 -> 3506 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/starting-area.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/starting-area.pdf)bin5909 -> 5909 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/true-words.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/true-words.pdf)bin6128 -> 6128 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/bad-latin.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bad-latin.pdf)bin8311 -> 8311 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-1.pdf)bin7736 -> 7736 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-2.pdf)bin7754 -> 7754 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-3.pdf)bin7793 -> 7793 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-4.pdf)bin7776 -> 7776 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-5.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-5.pdf)bin13115 -> 13115 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/defaultfonts.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/defaultfonts.pdf)bin31097 -> 31097 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/fallbacks.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fallbacks.pdf)bin19558 -> 19558 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/fontsize-level.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fontsize-level.pdf)bin5056 -> 5056 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/indenting-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/indenting-1.pdf)bin8168 -> 8168 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/indenting-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/indenting-2.pdf)bin8168 -> 8168 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/msfonts.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/msfonts.png)bin62524 -> 62524 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/qian.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/qian.pdf)bin11728 -> 11728 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/setupbodyfont.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/setupbodyfont.pdf)bin8166 -> 8166 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/tex-root.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/tex-root.png)bin30218 -> 30218 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/pagenumber.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pagenumber.png)bin22295 -> 22295 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/style-file.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/style-file.png)bin114762 -> 114762 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-2.pdf)bin10503 -> 10503 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-3.pdf)bin10501 -> 10501 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-4.pdf)bin13028 -> 13028 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-5.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-5.pdf)bin13022 -> 13022 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu.pdf)bin10127 -> 10127 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-2.pdf)bin10334 -> 10334 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-3.pdf)bin8986 -> 8986 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-4.pdf)bin9125 -> 9125 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-5.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-5.pdf)bin9096 -> 9096 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-6.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-6.pdf)bin9171 -> 9171 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-7.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-7.pdf)bin9535 -> 9535 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-8.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-8.pdf)bin9534 -> 9534 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list.pdf)bin9536 -> 9536 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-05.pdfbin9205 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-01.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-01.pdf)bin17332 -> 17332 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-02.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-02.pdf)bin18967 -> 18967 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-03.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-03.pdf)bin18945 -> 18945 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-04.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-04.pdf)bin11612 -> 11612 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/ctxnotes-2.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ctxnotes-2.png)bin19843 -> 19843 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/ctxnotes.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ctxnotes.png)bin32313 -> 32313 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-2.pdf)bin5697 -> 5697 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-3.pdf)bin7465 -> 7465 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-4.pdf)bin49791 -> 49791 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb.pdf)bin5697 -> 5697 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-1.pdf)bin23993 -> 23993 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-2.pdf)bin23976 -> 23976 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-3.pdf)bin24494 -> 24494 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert.pdf)bin26055 -> 26055 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/metapost.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-metapost.pdf)bin8520 -> 8520 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/01.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-01.pdf)bin49780 -> 49780 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/02.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-02.pdf)bin10311 -> 10311 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/03.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-03.pdf)bin8190 -> 8190 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/04.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-04.pdf)bin8569 -> 8569 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/three-line-table.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-three-line-table.pdf)bin9141 -> 9141 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10/colors.pngbin0 -> 23373 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11/vbox-and-hbox.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08-vbox-and-hbox.pdf)bin7327 -> 7327 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-1.pdf)bin6085 -> 6085 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-2.pdf)bin6342 -> 6342 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-3.pdf)bin8381 -> 8381 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-4.pdf)bin5575 -> 5575 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/watermark.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-watermark.png)bin71998 -> 71998 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/ConTeXt-layout.svg (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ConTeXt-layout.svg)0
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/layout-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-layout-1.pdf)bin9908 -> 9908 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/m_k_i_v_ConTeXt-layout_svg_c60ccda70ef92e32d7a6334f31c23259.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/m_k_i_v_ConTeXt-layout_svg_c60ccda70ef92e32d7a6334f31c23259.pdf)bin66096 -> 66096 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-1.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-1.pdf)bin9421 -> 9421 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-2.pdf)bin14431 -> 14431 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-3.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-3.pdf)bin12839 -> 12839 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-4.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-4.pdf)bin26414 -> 26414 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-finished.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/slides-finished.pdf)bin35012 -> 35012 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/slides.pdf)bin34689 -> 34689 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/bookmarks.png (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-bookmarks.png)bin91322 -> 91322 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/toc-2.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-toc-2.pdf)bin6105 -> 6105 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/toc.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-toc.pdf)bin6054 -> 6054 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bookmark.pngbin33739 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cow.pdfbin5526 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/gardeninglion.jpgbin59719 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/header.pngbin30981 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hello.pngbin6557 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/linux-terminal-icon.pngbin16045 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/search.pngbin29154 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/01.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-01.pdf)bin9993 -> 9993 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/02.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-02.pdf)bin9472 -> 9472 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/03.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-03.pdf)bin14420 -> 14420 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/none-zhfonts.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/none-zhfonts.pdf)bin28173 -> 28173 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/zhfonts.pdf (renamed from Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts.pdf)bin28688 -> 28688 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/license.tex12
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/postscript.tex2
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/preface.tex14
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex20
123 files changed, 1736 insertions, 2297 deletions
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/LICENSE b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/LICENSE
deleted file mode 100644
index f288702d2fa..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/LICENSE
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README.md b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README.md
index 19e4d1d0005..da1e5cb92ac 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README.md
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README.md
@@ -1 +1,10 @@
-This tutorial is completely rewritten. It comprehensively introduces how to use ConTeXt (>= MkIV) to typeset Simplified Chinese documents, mainly including the installation of ConTeXt LMTX, how to use Chinese fonts, and how to typeset lists, references, illustrations, tables, and framed texts. Furthermore, it is described how to use the MetaPost language for drawing in ConTeXt. Finally, how to make slides and books is introduced.
+This is an introductory tutorial on ConTeXt in Chinese written by Li Yanrui.
+
+This tutorial is completely rewritten fourteen years later after its predecessor was released. Now it comprehensively introduces how to use ConTeXt (>= MkIV) to typeset Simplified Chinese documents, mainly including the installation of ConTeXt LMTX, how to use Chinese fonts, and how to typeset lists, references, figures, tables, verbatim text and framed text. Furthermore, it is described how to use the MetaPost language for drawing in ConTeXt. Finally, how to make slides and books is introduced.
+
+This package is licensed in GPL v3 (The GNU General Public License v3.0). The document ctxnotes.pdf is licensed in GFDL (The GNU Free Documentation License).
+
+If you are interested in the process of development you may observe https://github.com/liyanrui/ConTeXt-notes
+
+Report or give feedback to https://github.com/liyanrui/ConTeXt-notes/issues or lyr.m2@live.cn
+
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf
index 7fde3eef9e5..6f1ce04d648 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/01.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/01.tex
index 4086af389ec..178be4c6fe4 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/01.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/01.tex
@@ -1,6 +1,6 @@
\chapter[Installation]{不怕命令行 }
-无论是安装还是使用 \ConTeXt,皆需要对命令行环境有所了解。原本未有介绍这方面知识的计划,但是考虑到我正在写一份世上最好的 \ConTeXt\ 入门文档,便有了些许动力。本章先分别介绍 Windows、Linux 和 macOS 系统的命令行环境的基本用法,以刚好满足安装和运行 \ConTeXt\ 的需求为要。倘若对命令行环境已颇为熟悉,可直接阅读 \in[installation] 和 \in[quick-installation] 节。
+无论是安装还是使用 \ConTeXt,皆需要对命令行环境有所了解。原本未有介绍这方面知识的计划,但是考虑到我正在写一份世上最好的 \ConTeXt\ 入门文档,便有了些许动力。本章先分别介绍 Windows、Linux 和 macOS 系统的命令行环境的基本用法,以刚好满足安装和运行 \ConTeXt\ 的需求为要。倘若对命令行环境已颇为熟悉,可直接阅读 \in[installation] 和 \in[ctx-in-texlive] 节。
\section{任务}
@@ -15,10 +15,10 @@ Windows 用户似乎畏惧甚至厌憎命令行环境,甚至很多人认为命
\startplacefigure[location=none]
\startfloatcombination[nx=2,ny=1]
\startplacefigure[title={「\type{Win + R}」 组合键},reference=win-r]
-\externalfigure[win-r.jpg][height=6cm]
+\externalfigure[01/win-r.jpg][height=6cm]
\stopplacefigure
\startplacefigure[title={Windows 命令行窗口},reference=cmd-window]
-\externalfigure[cmd-window.png][height=6cm]
+\externalfigure[01/cmd-window.png][height=6cm]
\stopplacefigure
\stopfloatcombination
\stopplacefigure
@@ -166,10 +166,12 @@ $ echo 'export PATH=$HOME/foo:$PATH' >> .zshrc
$ source .zshrc
\stoptyping
-\section[installation]{安装 \ConTeXt\ LMTX}
+\section[installation]{安装 \ConTeXt\ LMTX 最新版本}
+
+安装 \CONTEXT\ LMTX 有两种方式,一种是安装 \CONTEXT\ 开发者提供的 \CONTEXT\ 包,该包仅包含 \CONTEXT\ 环境;另一种是安装 \TEX\ Live 中的 \CONTEXT\ 包。本节介绍前者,下一节介绍后者。
\useURL[installation][https://wiki.contextgarden.net/Installation]
-\ConTeXt\ 的最新版本是 \ConTeXt\ LMTX,目前尚在开发和试验阶段,功能虽不稳定,但对于入门而言并无妨碍。从 \bluebox{\from[installation]} 下载对应操作系统类型的 \ConTeXt\ LMTX 安装包,按照该网址的相关介绍进行安装即可。授人以鱼,不如授人以渔,安装过程所需要的全部知识皆已在上文介绍完毕。不过,我总担心 Windows 用户无法安装成功,下文以 Windows 64 位系统为例,给出完整的安装过程。
+\ConTeXt\ 的最新版本是 \ConTeXt\ LMTX,目前尚在开发和试验阶段,功能虽不稳定,但对于入门而言并无妨碍。从 \bluebox{\from[installation]} 下载对应操作系统类型的 \ConTeXt\ LMTX 安装包,按照该网址的相关介绍进行安装即可,安装过程所需要的全部知识皆已在上文介绍完毕。下文以 Windows 64 位系统为例,给出详细的的安装过程。
\useURL[win-64-version][http://lmtx.pragma-ade.com/install-lmtx/context-win64.zip]
首先,从链接 \bluebox{\from[win-64-version]} 获得面向 Windows 64 位系统的安装包 \type{context-win64.zip} 并假设将其放在 \type{D:\} 解开,所得目录为 \type{context-win64},其结构如下:
@@ -207,29 +209,19 @@ D:\context-win64
> context foo.tex
\stoptyping
-\noindent 倘若在 \type{D:\context\test} 目录下能够得到 \type{foo.pdf} 文件,且其内容为 \lower.3em\hbox{\externalfigure[foo.pdf]},则意味着已成功安装 \ConTeXt\ LMTX。
+\noindent 倘若在 \type{D:\context\test} 目录下能够得到 \type{foo.pdf} 文件,且其内容为 \lower.3em\hbox{\externalfigure[01/foo.pdf]},则意味着已成功安装 \ConTeXt\ LMTX。
最后,将 \type{D:\context\tex\texmf-win64\bin} 添加到系统 \type{PATH} 变量,便可在任一目录使用 \type{context} 命令将扩展名为 \type{.tex} 的文本文件编译成 PDF 文件了。
-\section[quick-installation]{投机取巧}
-
-倘若因为网络不畅甚至不通等问题无法成功安装 \ConTeXt\ LMTX,可以考虑下载我打包的整个 \ConTeXt\ LMTX 环境,目前仅有 Windows 64 位和 Linux 64 位版本,下载地址为:
-
-\useURL[win64v][https://pan.baidu.com/s/1r5gMqsk-peGQhOmcp_dNlw?pwd=eejf]
-\useURL[linux64v][https://pan.baidu.com/s/1iBHN-8Zroyd9rGOjRpQrYg?pwd=r2hp]
-\startitemize[packed]
-\item Windows amd64 版本:\bluebox{\from[win64v]}
-\item Linux amd64 版本:\bluebox{\from[linux64v]}
-\stopitemize
+\section[ctx-in-texlive]{\TEX\ Live 中的 \CONTEXT}
-\useURL[quick-installation][https://www.bilibili.com/video/BV1q84y1c7Je/]
-以 Windows 系统为例,从上述链接获得压缩包,以 \type{D:\} 作为解压缩目录,解压后可得 \type{D:\context} 目录,然后按照上一节所述方式修改系统 \type{PATH} 变量即可得到完整的 \ConTeXt\ LMTX 环境,日后依然可执行 \type{D:\context\install.bat} 对其进行更新。我已将该过程录制为视频,网络链接为 \bluebox{\from[quick-installation]}。
+若你熟悉 \TEX\ Live\cite[texlive],推荐使用它提供的 \CONTEXT\ 版本,其功能较为稳定,且国内有镜像网站,在线安装更为便捷。若是新安装 \TEX\ Live,在安装时可直接选择 \type{ConTeXt scheme} 或在 \type{collections} 列表中选择 \type{ConTeXt and packages}。若你的系统中已安装 \TEX\ Live,只是无 \CONTEXT,可使用 TeXLive 包管理器 \type{tlmgr} 安装 \type{collection-context} 即可。
\section{小结}
在一个桌面操作系统中,命令行环境能完成的工作,图形界面通常也能完成,但对于有些任务,命令行环境比图形界面更为高效,反之亦然,原本无需厚此薄彼,但尺有所短,寸有所长,Windows,Linux 和 macOS 也是如此。
-\startitemize
+\startitemize[packed]
\item Windows 系统的命令行环境,前身是 MS DOS 系统,长期未得进化,现在用起来,捉襟见肘。现代的 PowerShell 更为适用,但因 \ConTeXt\ 目前不能直接在 PowerShell 环境里完成安装,故而上文未曾言及。
\item macOS 无论图形界面还是命令行环境皆胜于 Windows 和 Linux,但其缺点是在不违法的情况下,它只能运行于苹果公司的计算机,费用不菲。
\item Linux 系统的图形界面不及 Windows 和 macOS,但命令行环境优于 Windows\footnote{自 Windows 10 开始,微软在 Windows 系统中构建了 Linux 子系统(WSL),允许用户在 Windows 系统中使用 Linux 命令行环境,但是该环境无法利用 Windows 和 Linux 的图形界面功能。},与 macOS 相当,但 Linux 最显著的特点是,它能帮助每一个使用计算机的人,让他深刻觉察自己以往所宣称的那样热爱自由是否真实。
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/02.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/02.tex
index fe7e6ed58e3..4f59ab58a9b 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/02.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/02.tex
@@ -28,12 +28,12 @@ $ context foo.tex
排版命令 \type{\startTEXpage...\stopTEXpage} 称为 \type{TEXpage} 环境,我将其称为新手村。这一对排版命令所包含的内容,例如「\type{Hello \ConTeXt!}」会被排版于一个恰好能包含它的矩形排版空间。\type{frame} 参数用于控制边框是否开启,其值为 \type{off} 或省略对它的设定时,关闭边框。\type{offset} 参数可用于对排版空间进行扩大或缩小,如示例 \in[starting-area] 所示,排版空间从中心向四周被扩大 2.5 mm。
-\startsamplecode\startnarrowtyping
+\startsample
\startTEXpage[frame=on,offset=2.5mm]
Hello \ConTeXt!
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[starting-area]{新手村}{starting-area.pdf}
+\stopsample
+\sample[option=TEX][starting-area]{新手村}{\externalfigure[02/starting-area.pdf]}
之所以称 \type{TEXpage} 环境为新手村,是因它足够简单,将其用于观察大多数排版命令的效果时无需关心版面的天头、地脚、订口、翻口、版心、页码等元素的设定。
@@ -43,23 +43,23 @@ Hello \ConTeXt!
如示例 \in[true-words] 所示,排版两行文字,每行由 5 个单词组成。示例 \in[true-words] 给出了伪文字的效果。同样是两行文字,每一行由 3~5 个单词构成。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual] % 加载可视化模块
\startTEXpage[frame=on,offset=2.5mm]
This is the first line.\\ % 强制换行
This is the second line.
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[true-words]{两行真实文字}{true-words.pdf}
+\stopsample
+\sample[option=TEX][true-words]{两行真实文字}{\externalfigure[02/true-words.pdf]}
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm]
\fakewords{3}{5}\\
\fakewords{3}{5}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[fakewords]{两行伪文字}{fakewords.pdf}
+\stopsample
+\sample[option=TEX][fakewords]{两行伪文字}{\externalfigure[02/fakewords.pdf]}
\section{注释}
@@ -86,7 +86,7 @@ This is the first line.\\ This is the second line.
\type{\crlf} 也能用于对文字强制进行断行。倘若不希望对每一行都输入断行命令,也可以考虑使用 \type{lines} 环境,请参考示例 \in[lines]。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm]
\startlines
@@ -95,14 +95,14 @@ This is the first line.\\ This is the second line.
\fakewords{5}{9}
\stoplines
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[lines]{排版多行文本}{lines.pdf}
+\stopsample
+\sample[option=TEX][lines]{排版多行文本}{\externalfigure[02/lines.pdf]}
\section{分段}
观察示例 \in[pars],虽然排版结果依然是两行,但实际上它是两段。\type{\par} 是分段命令。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm]
\startlines
@@ -110,24 +110,24 @@ This is the first line.\\ This is the second line.
\fakewords{3}{5}
\stoplines
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[pars]{分段}{pars.pdf}
+\stopsample
+\sample[option=TEX][pars]{分段}{\externalfigure[02/pars.pdf]}
通常很少使用分段符对文本进行分段,因为在 \ConTeXt\ 源文档中,只需在两段文字之间空一行便可实现分段。示例 \in[pars-2] 使用空行进行分段,并通过限定「新手村」的宽度为 6 cm,从而在促狭的空间里展示了多行伪文字构成的段落。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm,width=6cm]
\fakewords{9}{15}
\fakewords{9}{15}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[pars-2]{多行文本构成的段落}{pars-2.pdf}
+\stopsample
+\sample[option=TEX][pars-2]{多行文本构成的段落}{\externalfigure[02/pars-2.pdf]}
段落可以设置首行缩进。中文排版的惯例是,段落首行需缩进 2 个汉字的宽度,示例 \in[pars-3] 实现了该需求,排版结果中段落开头的蓝色矩形区域表示文字缩进后产生的空白区域。尺寸 2em 即英文字母 \type{M} 的宽度的 2 倍,刚好与两个汉字的宽度相同。还有一个常用的尺寸单位 ex,它是英文字母 \type{x} 的高度。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm,width=6cm]
\setupindenting[first,always,2em]
@@ -135,12 +135,12 @@ This is the first line.\\ This is the second line.
\fakewords{9}{15}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[pars-3]{设置段落首行缩进}{pars-3.pdf}
+\stopsample
+\sample[option=TEX][pars-3]{设置段落首行缩进}{\externalfigure[02/pars-3.pdf]}
根据文档「Faking text and more」\cite[faking-text]的提示,可将段落缩进区域的颜色定义为白色,从而可避免蓝色矩形块对视觉的干扰,见示例 \in[parindentcolor]。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm,width=6cm]
\setupindenting[first,always,2em]
@@ -150,12 +150,12 @@ This is the first line.\\ This is the second line.
\fakewords{9}{15}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[parindentcolor]{消除段落缩进色块}{parindentcolor.pdf}
+\stopsample
+\sample[option=TEX][parindentcolor]{消除段落缩进色块}{\externalfigure[02/parindentcolor.pdf]}
在设定段落首行缩进后,若不希望某个段落的首行被缩进,可在段落开头放置命令 \type{\noindent}。示例 \in[noindent],第二段消除了第二段文字的首行缩进。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm,width=6cm]
\setupindenting[first,always,2em]
@@ -164,14 +164,14 @@ This is the first line.\\ This is the second line.
\noindent\fakewords{9}{15}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[noindent]{消除第二段的首行缩进}{pars-4.pdf}
+\stopsample
+\sample[option=TEX][noindent]{消除第二段的首行缩进}{\externalfigure[02/pars-4.pdf]}
\section[interlinespace]{行间距}
\ConTeXt\ 默认的段落内各行文字的间距是 2.8 ex,约等于 \ConTeXt\ 默认的正文字体大小 12 pt。可使用 \type{\setupinterlinespace} 对行间距进行调整。如示例 \in[pars-5] 将行间距设为 1.75 倍默认行距。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm,width=6cm]
\setupindenting[first,always,2em]
@@ -181,24 +181,24 @@ This is the first line.\\ This is the second line.
\fakewords{9}{15}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[pars-5]{多行文本构成的段落}{pars-5.pdf}
+\stopsample
+\sample[option=TEX][pars-5]{多行文本构成的段落}{\externalfigure[02/pars-5.pdf]}
不过,我发现示例 \in[pars-5] 的行间距设定语句若放在 \type{\startTEXpage} 语句之前则无效\footnote{在 \in[context-world] 节中会介绍 \type{\starttext ... \stoptext},直接以默认行距倍数的方式设置行间距,若设定语句位于 \type{\starttext} 之前则同样无效。},也许是当前的 \ConTeXt\ LMTX 版本存在 bug。
-不过,还有一种段落内行间距设定方法。等到掌握第 \in[chinese-fonts] 章中讲述的设定 \ConTeXt\ 字体的方法,在你已经清楚正文字体的大小时,例如 11 pt,可采取以下方式设定 1.75 倍行距:
+还有一种行间距设定方法。待你掌握第 \in[chinese-fonts] 章中讲述的 \ConTeXt\ 字体设定方法,并清楚正文字体的大小时,可使用 \type{line} 参数设定最大行高。例如,若正文字体大小为 11 pt,以下代码可设定行间距为 1.75 倍:
\starttyping[option=TEX]
\setupinterlinespace[line=19.25pt]
\stoptyping
-\noindent 之所以是 19.25 pt,是因它等于 $1.75\times 11$ pt。上述代码设定的是一行文字的最大高度。在后文中,本文档皆使用这种方式设定段落内行间距。
+\noindent 之所以是 19.25 pt,是因它等于 $1.75\times 11$ pt。最大行高即行间距,因为在 \CONTEXT\ 中,行间距是相邻两行文字的基线距离,恰好等于一行文字的最大高度。本文档在后文示中皆使用该方式设定段落内行间距。
\section{对齐}
有时,希望将一行文字居左、居中或居右放置,可分别使用 \type{\leftaligned},\type{\midaligned} 和\type{\rightaligned} 进行排版,请参考示例 \in[aligned-1]。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage
[frame=on,offset=2.5mm,width=6cm]
@@ -206,12 +206,12 @@ This is the first line.\\ This is the second line.
\midaligned{\fakewords{1}{2}}
\rightaligned{\fakewords{1}{2}}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[aligned-1]{多行文本构成的段落}{aligned-1.pdf}
+\stopsample
+\sample[option=TEX][aligned-1]{多行文本构成的段落}{\externalfigure[02/aligned-1.pdf]}
如果是一段文字需要居左、居中或居右排版,可使用 \type{alignment} 环境,通过该环境的参数控制对齐形式。示例 \in[aligned-2] 展示了段落的三种对齐形式。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage[frame=on,offset=2.5mm,width=6cm]
\startalignment[flushleft] % 左对齐
@@ -224,14 +224,14 @@ This is the first line.\\ This is the second line.
3. \fakewords{5}{15}
\stopalignment
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[aligned-2]{段落对齐}{aligned-2.pdf}
+\stopsample
+\sample[option=TEX][aligned-2]{段落对齐}{\externalfigure[02/aligned-2.pdf]}
\section{写一封谁也看不懂的信}
现在,我们已经有能力用伪文字排版一封谁也看不懂内容的书信了,见示例 \in[letter]。也许现在你很想用汉字给朋友写封信,并告诉他,这封信的排版是你亲手用 \ConTeXt\ 制作的。我劝你暂时最好放弃这个想法,写英文书信是完全可以的。
-\startsamplecode\startnarrowtyping
+\startsample
\usemodule[visual]
\startTEXpage
[frame=on,offset=1cm,width=10cm]
@@ -247,8 +247,8 @@ This is the first line.\\ This is the second line.
\rightaligned{\fakewords{1}{1}}\par
\rightaligned{\fakewords{1}{1}}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[letter]{一封谁也看不懂的信}{letter.pdf}
+\stopsample
+\sample[option=TEX][letter]{一封谁也看不懂的信}{\externalfigure[02/letter.pdf][width=.425\textwidth]}
\section{小结}
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/03.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/03.tex
index 34688f0564f..70881df8363 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/03.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/03.tex
@@ -10,7 +10,7 @@
[here,force]
[msfonts]
{\type{C:\Windows\Fonts}}
- {\externalfigure[msfonts.png][width=.6\textwidth]}
+ {\externalfigure[03/msfonts.png][width=.6\textwidth]}
在开始安装字体之前,需要给出一个术语,\TeX\ 根目录。以 Windows 系统为例,若 \ConTeXt\ 安装在 \type{D:\context} 目录,则该目录中的子目录和文件当如图 \in[tex-root] 所示。在这种情况下,\type{D:\context\tex} 目录即为 \TeX\ 根目录。同理,对于 Linux 和 macOS 系统,若 \ConTeXt\ 安装在 \type{$HOME/context} 目录,则 \type{$HOME/context/tex} 为 \TeX\ 根目录。
@@ -18,11 +18,13 @@
[here,force]
[tex-root]
{\TeX\ 根目录}
- {\externalfigure[tex-root.png][width=.6\textwidth]}
+ {\externalfigure[03/tex-root.png][width=.6\textwidth]}
为了便于描述,从现在开始,以虚构的类 Unix 环境变量风格的 \type{$TEXROOT} 指代 \TeX\ 根目录,不再使用具体路径,因为后者严重依赖于操作系统和用户偏好而缺乏一致性。此外,路径中的目录间隔符也统一使用类 Unix 风格进行表示,即使用「\type{/}」而非 Windows 风格的「\type{\}」,例如 \type{$TEXROOT/texmf} 表示 \TeX\ 根目录的子目录 \type{texmf}。
-向 \ConTeXt\ 安装宋体(simsun.ttc)、黑体(simhei.ttf)和楷体(simkai.ttf)的具体过程如下:
+以上关于 \TEX\ 根目录的讨论,仅针对 \CONTEXT\ 开发者提供的 \CONTEXT\ 包。对于 \TEX\ Live 而言,可将 \type{texmf-local} 目录的上级目录作为 \type{$TEXROOT}。
+
+为 \ConTeXt\ 安装宋体(simsun.ttc)、黑体(simhei.ttf)和楷体(simkai.ttf)的具体过程如下:
\startitemize[n,packed][stopper=,left=(,right=)]
\item 将上述字体文件复制到 \type{$TEXROOT/texmf-local/fonts/truetype/msfonts} 目录,若该目录不存在,则自行创建;
@@ -32,11 +34,9 @@
字体安装完毕后,可以通过查询字体文件名确认字体是否安装成功,例如查询 simhei.ttf:
-
\starttyping
$ mtxrun --script fonts --list --file simhei.ttf
familyname weight style width variant fontname filename ...
-
simhei normal normal normal normal simhei simhei.ttf
\stoptyping
@@ -47,7 +47,6 @@ simhei normal normal normal normal simhei simhei.ttf
\starttyping
$ mtxrun --script fonts --list --all simsun
identifier familyname fontname filename subfont instances
-
nsimsunnormal nsimsun nsimsun simsun.ttc 2
nsimsunregular nsimsun nsimsun simsun.ttc 2
simsun simsun simsun simsun.ttc 1
@@ -63,7 +62,7 @@ simsunregular simsun simsun simsun.ttc 1
示例 \in[hello-hanzi] 演示了如何在新手村里为 \ConTeXt\ 定义大小为 12 pt 的宋体,黑体和楷体等字体切换命令,并使用它们各排版一行文字。
-\startsamplecode\startnarrowtyping
+\startsample
\startTEXpage[frame=on,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\definefont[heiti][name:simhei at 12pt]
@@ -72,8 +71,8 @@ simsunregular simsun simsun simsun.ttc 1
\heiti 见龙在田,利见大人。\\
\kaiti 君子终日乾乾,夕惕若厉,无咎。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[hello-hanzi]{三种汉字字体}{qian.pdf}
+\stopsample
+\sample[option=TEX][hello-hanzi]{三种汉字字体}{\externalfigure[03/qian.pdf]}
需要注意的是,第一次在 \ConTeXt\ 中使用新安装的汉字字体,源文件编译过程会较为缓慢,因为 \ConTeXt\ 需要解析字体文件中的一些编码信息并将解析结果存到它的字体缓存目录。待下一次使用经过缓存后字体时,编译速度便会正常,因此不应急切宣判 \ConTeXt\ 不适合处理中文文档。我的计算机 CPU 是 \type{Intel i5-4300U @ 1.90GHz}。这份文档写至此处,已有 20 页内容,其源文件单次编译时间不到 3 秒。我感觉 \ConTeXt\ 处理中文文档,并不是很慢,但是应当承认,肯定是比基于 \pdfTeX 或 \XeTeX 等引擎的 \TeX\ 要慢一些。
@@ -81,39 +80,39 @@ simsunregular simsun simsun simsun.ttc 1
现在尝试用宋体字排版一段中文,见示例 \in[无法断行]。结果表明,仅仅能在 \ConTeXt\ 中使用汉字字体是不够的,因为 \ConTeXt\ 此刻尚不知在限定宽度的版面内如何对汉字进行断行,以致文字超出版面。究其原因,是汉字之间不像西文单词以空格作为间隔,因此在 \ConTeXt\ 看来,一段汉字文字等同于一个很长的西文单词,是一个无法分隔的单元。
-\startsamplecode\startnarrowtyping
+\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\songti
潜龙勿用。见龙在田,利见大人。%
君子终日乾乾,夕惕若厉,无咎。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[无法断行]{中文段落无法断行}{breakinglines-1.pdf}
+\stopsample
+\sample[option=TEX][无法断行]{中文段落无法断行}{\externalfigure[03/breakinglines-1.pdf]}
需要注意示例 \in[无法断行] 中的注释符的用法。虽然注释内容为空,但注释符可令 \TeX\ 引擎忽略其后的所有空白字符(包括换行符)。倘若将该示例中的注释符去掉,第一行汉字和第二行汉字之间的换行符会被 \TeX\ 引擎视为空白字符,从而让 \ConTeXt\ 觉得,它面对的是两个较长的单词,它们之间可以断行,结果见示例 \in[将错就错],可以断行,但属于误打误撞。
-\startsamplecode\startnarrowtyping
+\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\songti
潜龙勿用。见龙在田,利见大人。
君子终日乾乾,夕惕若厉,无咎。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[将错就错]{中文段落无法断行}{breakinglines-2.pdf}
+\stopsample
+\sample[option=TEX][将错就错]{中文段落无法断行}{\externalfigure[03/breakinglines-2.pdf]}
现在,我们可以灵机一动,既然换行符被 \TeX\ 引擎视为空白字符从而使得 \ConTeXt\ 误打误撞对汉字进行了一次断行,那么倘若在汉字之间手工插入空格字符,\ConTeXt\ 能否实现汉字断行呢?答案是,可行,见源文档显现了空格字符(以 \type[space=on]{ } 表示)的示例 \in[手工断行],只是空格的存在,导致排版结果中的汉字分布较为蓬松。
-\startsamplecode\startnarrowtyping[space=on]
+\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\songti
潜 龙 勿 用。 见 龙 在 田, 利 见 大 人。
君 子 终 日 乾 乾, 夕 惕 若 厉, 无 咎。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[手工断行]{中文段落手工插入空格进行断行}{breakinglines-3.pdf}
+\stopsample
+\sample[option=TEX,space=on][手工断行]{中文段落手工插入空格进行断行}{\externalfigure[03/breakinglines-3.pdf]}
位于 \ConTeXt\ 底层的 \TeX\ 系统提供了粘连(Glue)机制,我们可以用它定义给定宽度且有些许弹性的空格。例如,定义一个宽度为 0,最大可伸展 2 pt 且不可收缩的粘连:
@@ -123,7 +122,7 @@ simsunregular simsun simsun simsun.ttc 1
\noindent 然后用该粘连代替空格,插入到汉字之间,便基本可实现汉字断行,结果见示例 \in[手工插入粘连断行],需要注意的是,\TeX\ 会自动忽略排版命令之后尾随的空格,因此 \type{\foo} 之后虽然有一个空格,但该空格不会在排版结果里出现。
-\startsamplecode\startnarrowtyping[space=on]
+\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\def\foo{\hskip 0pt plus 2pt minus 0pt}
@@ -134,8 +133,8 @@ simsunregular simsun simsun simsun.ttc 1
\foo 君\foo 子\foo 终\foo 日\foo 乾\foo 乾,%
\foo 夕\foo 惕\foo 若\foo 厉,\foo 无\foo 咎。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[手工插入粘连断行]{中文段落手工插入粘连进行断行}{breakinglines-4.pdf}
+\stopsample
+\sample[option=TEX,space=on][手工插入粘连断行]{中文段落手工插入粘连进行断行}{\externalfigure[03/breakinglines-4.pdf]}
由于没有人愿意像示例 \in[手工插入粘连断行] 那样排版汉字,因此 \ConTeXt\ 提供了一个可以自动在汉字之间插入粘连的命令,即
@@ -153,7 +152,7 @@ simsunregular simsun simsun simsun.ttc 1
\section{写一封真正的信}
-\startsamplecode\startnarrowtyping
+\startsample
\startTEXpage[frame=on,width=6cm,offset=6pt]
\definefont[songti][name:simsun at 10.5pt]
\setscript[hanzi] % 中文断行支持
@@ -171,8 +170,8 @@ simsunregular simsun simsun simsun.ttc 1
\rightaligned{孙悟空}
\rightaligned{2035.10.1}
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[孙悟空的信]{孙悟空的信}{breakinglines-5.pdf}
+\stopsample
+\sample[option=TEX][孙悟空的信]{孙悟空的信}{\externalfigure[03/breakinglines-5.pdf]}
从现在开始,在提供示例时,为了节省篇幅,我有时会省略一部分经常重复使用的代码,仅给出关键代码以突出重点,在有兴致动手试验这些代码时,需要你自己动手添加被省略的代码。
@@ -184,7 +183,7 @@ simsunregular simsun simsun simsun.ttc 1
\ConTeXt\ 默认启用的正文字体是衬线字族中的正体。\type{\rm},\type{\ss} 和 \type{\tt} 可分别用于将字体切换为衬线、无衬线和等宽字族的正体。\type{\tf},\type{\bf},\type{\it} 和 {\type{\bi}} 可分别用于切换每个字族中的正体、粗体、斜体和粗斜体等字体。示例 \in[默认字体] 演示了如何切换各种字体以及 \type{{...}} 的用法。在默认情况下,\TeX\ 引擎将一对花括号所包含的内容视为一个整体,\TeX\ 术语称之为编组(Group)。编组内部的排版命令不会对编组外部产生任何影响,但编组外部的排版命令会影响编组内部。
-\startsamplecode\startnarrowtyping
+\startsample
% 衬线字体
Hello. {\bf Hello.}
{\it Hello.} {\bi Hello.}\\
@@ -202,44 +201,44 @@ Math in display mode:
\startformula
\int_a^b f(x)dx
\stopformula
-\stopnarrowtyping\stopsamplecode
-\mysample[默认字体]{\ConTeXt\ 默认字体}{defaultfonts.pdf}
+\stopsample
+\sample[option=TEX][默认字体]{\ConTeXt\ 默认字体}{\externalfigure[03/defaultfonts.pdf]}
\ConTeXt\ 默认正文字体的大小为 12 pt,并以该尺寸为基准,定义了 6 种不同级别的字体尺寸,从小到大依序为:\type{xx},\type{x},\type{a},\type{b},\type{c},\type{d}。\type{x} 级比正文字体小,\type{a} 级比正文字体大。示例 \in[fontsize-level] 演示了无衬线字族的正体字体 7 种大小级别的切换。
-\startsamplecode\startnarrowtyping
+\startsample
\ss {\tfxx A} {\tfx A} A or {\tf A}
{\tfa A} {\tfb A} {\tfc A} {\tfd A}
-\stopnarrowtyping\stopsamplecode
-\mysample[fontsize-level]{字体大小的 7 种级别}{fontsize-level.pdf}
+\stopsample
+\sample[option=TEX][fontsize-level]{字体大小的 7 种级别}{\externalfigure[03/fontsize-level.pdf]}
此外,还需要注意的是,尺寸单位 em 的含义。之前我对它给出解释是字母 \type{M} 宽度,恰好等于 1 个汉字的宽度,这是针对当前所的字体环境而言的。例如,在示例 \in[em-1] 和 \in[em-2] 中,段落首行缩进设定命令出现的位置不同,导致段落缩进距离产生了差异。这是因为,在示例 \in[em-1] 中,设定段落首行缩进时,em 的值是基于 \ConTeXt\ 默认的正文字体尺寸确定的,其值为 12 pt,而在 示例 \in[em-1] 中,em 的值是基于我们自定义的字体 \type{\songti} 的尺寸确定的,其值为 9 pt。
-\startsamplecode\startnarrowtyping
+\startsample
\setscript[hanzi]
\definefont[songti][name:simsun at 9pt]
\setupindenting[always,first,2em]
\songti
我现在五指山挺好的。
虽然我很少写信,其实我很怀念花果山。
-\stopnarrowtyping\stopsamplecode
-\mysample[em-1]{段落缩进距离是 24 pt}{indenting-1.pdf}
+\stopsample
+\sample[option=TEX][em-1]{段落缩进距离是 24 pt}{\externalfigure[03/indenting-1.pdf]}
-\startsamplecode\startnarrowtyping
+\startsample
\setscript[hanzi]
\definefont[songti][name:simsun at 9pt]
\songti
\setupindenting[always,first,2em]
我现在五指山挺好的。
虽然我很少写信,其实我很怀念花果山。
-\stopnarrowtyping\stopsamplecode
-\mysample[em-2]{段落缩进距离是 18 pt}{indenting-2.pdf}
+\stopsample
+\sample[option=TEX][em-2]{段落缩进距离是 18 pt}{\externalfigure[03/indenting-2.pdf]}
\section[define-family]{定义汉字字族}
使用 \type{\definefontfamily} 可将你喜欢的一些汉字字体定义为字族,用以代替 \ConTeXt\ 的默认字族,然后使用 \type{\setupbodyfont} 启用你定义的字族。示例 \in[setupbodyfont] 将 10.5 pt 的宋体作为正文默认字体\footnote{10.5 pt 可对应 MicroSoft Word 中的五号字。}。注意,字族的定义和启用,需在新手村之外进行,否则无效。不过,\type{\setupindenting} 却只能在新手村之内起效,这让我有些不解,但是这就是新手村的规矩,只能接受。
-\startsamplecode\startnarrowtyping
+\startsample
\definefontfamily[myfonts][rm][nsimsun]
\setupbodyfont[myfonts,10.5pt]
\setscript[hanzi]
@@ -248,8 +247,8 @@ Math in display mode:
我现在五指山挺好的。
虽然我很少写信,其实我很怀念花果山。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[setupbodyfont]{定义正文字体并启用}{setupbodyfont.pdf}
+\stopsample
+\sample[option=TEX][setupbodyfont]{定义正文字体并启用}{\externalfigure[03/setupbodyfont.pdf]}
示例 \in[setupbodyfont] 仅定义了 \type{myfonts} 的衬线字族(\type{rm})为 \type{nsimsun},且需要注意的是,此处的 \type{nsimsun} 并非字体名,而是字族名。在 \in[fonts-installation] 节中,将 simsun.ttc 安装至 \ConTeXt\ 环境之后,我们曾查询过它的相关信息,其中有一栏信息是 \type{familyname},其中罗列的便是字体所属的字族名。\ConTeXt\ 会根据字族名自动搜索字体的 \type{identifier} 信息,若某字体,其 identifier 的末尾是 \type{regular} 或 \type{normal}\footnote{identifier 名的末尾为 regular 和 normal 的字体通常是同一个字体。},则该字体会被 \ConTeXt\ 自动作为该字体所属字族的正体。同理,若某字体的 identifier 的末尾是 \type{bold},\type{italic} 或 \type{bolditalic},则该字体会被 \ConTeXt\ 自动作为该字体所属字族的粗体、斜体或粗斜体。
@@ -284,19 +283,18 @@ Math in display mode:
\placefigure
[here,force][bad-latin]
{英文字形比较}
- {\externalfigure[bad-latin.pdf][width=.4\textwidth]}
+ {\externalfigure[03/bad-latin.pdf][width=.4\textwidth]}
-\type{\definefallbackfamily} 可用一种字体中的部分字形替换另一种字体的相应字形,其用法与 \type{\definefontfamily} 类似,只是需要在参数中指定字形覆盖范围。示例 \in[fallbacks] 使用 latinmodernroman 字族里的每种字体的 Unicode 码位区间 $[0\mathrm{x}0000, 0\mathrm{x}0400]$ 中的所有字形强行替换 nsimsun 字族中每种字体(包括替补字体)的相应字形。也可以使用 \ConTeXt\ 已经定义了名字的 Unicode 码位区间代替 16 进制数字形式的区间。例如,
+\type{\definefallbackfamily} 可用一种字体中的部分字形替换另一种字体的相应字形。示例 \in[fallbacks] 使用 latinmodernroman 字族里的每种字体的 Unicode 码位区间 $[0\mathrm{x}0000, 0\mathrm{x}0400]$ 中的所有字形强行替换 nsimsun 字族中每种字体(包括替补字体)的相应字形。也可以使用 \ConTeXt\ 已经定义了名字的 Unicode 码位区间代替 16 进制数字形式的区间。例如,
\starttyping[option=TEX]
-\definefallbackfamily
- [myfonts][rm][latinmodernroman]
- [range={basiclatin,latinsupplement},force=yes]
+\definefallbackfamily[myfonts][rm][latinmodernroman]
+ [range={basiclatin,latinsupplement},force=yes]
\stoptyping
\noindent 指定了 Unicode 码位区间 $\mathrm{[0x0000, 0x00FF]}$ 中的字形作为替换字形。Unicode 码位区间的名字见文档「List of Unicode blocks」\cite[unicode-blocks]。
-\startsamplecode\startnarrowtyping
+\startsample
\definefallbackfamily
[myfonts][rm][latinmodernroman]
[range={0x0000-0x0400},force=yes]
@@ -306,13 +304,11 @@ Math in display mode:
\setupbodyfont[myfonts,16pt]
\setscript[hanzi]
\startTEXpage[frame=on,offset=4pt]
-爱因斯坦 Einstein\\
-\bf 爱因斯坦 Einstein\\
-\it 爱因斯坦 Einstein\\
-\bi 爱因斯坦 Einstein
+爱因斯坦 Einstein\\ \bf 爱因斯坦 Einstein\\
+\it 爱因斯坦 Einstein\\ \bi 爱因斯坦 Einstein
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[fallbacks]{字形替换}{fallbacks.pdf}
+\stopsample
+\sample[option=TEX][fallbacks]{字形替换}{\externalfigure[03/fallbacks.pdf]}
\section{小结}
@@ -324,4 +320,4 @@ Math in display mode:
$ mtxrun --script base --find-file fonts-mkiv.pdf
\stoptyping
-\noindent 请顺便浏览一番这份手册所在的目录里的其他 PDF 文件吧。 \ No newline at end of file
+\noindent 请顺便浏览一番这份手册所在的目录里的其他 PDF 文件吧。
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/04.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/04.tex
index e8c0d0dcfad..769e21e8039 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/04.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/04.tex
@@ -34,7 +34,7 @@
\setupheads[indentnext=yes]
\stoptyping
-\startsamplecode\startnarrowtyping
+\startsample
\setupindenting[first,always,2em]
\title{鲁迅家的后园}
@@ -44,29 +44,29 @@
这上面的夜的天空,奇怪而高,鲁迅生平
没有见过这样奇怪而高的天空。
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[zaoshu]{散文示例 1}{zaoshu.pdf}
+\stopsample
+\sample[option=TEX][zaoshu]{散文示例 1}{\externalfigure[04/zaoshu.pdf]}
现在可以为文章增加作者信息了,虽然他叫无名氏,见示例 \in[zaoshu-2],只是作者距离正文太近了。不要尝试使用一些空行去增大该距离,因为 \TeX\ 引擎在遇到多个空行时,它也只是把它们当成一个空行,并将其视为 \type{\par}。
-\startsamplecode\startnarrowtyping
+\startsample
\setupheads[indentnext=yes]
\setupindenting[first,always,2em]
\title{鲁迅家的后园}
\midaligned{无名氏}
% 省略了正文内容
\stopTEXpage
-\stopnarrowtyping\stopsamplecode
-\mysample[zaoshu-2]{散文示例 2}{zaoshu-2.pdf}
+\stopsample
+\sample[option=TEX][zaoshu-2]{散文示例 2}{\externalfigure[04/zaoshu-2.pdf]}
在版面的竖直方向,段落之间,或标题与段落之间,或标题与标题之间……增加空白,通常可以使用 \type{\blank} 命令。例如,在作者和正文之间增加一个空行的距离,只需 \type{\blank[line]};要增加 $n$ 个空行的距离,只需 \type{\blank[n*line]}。
-\startsamplecode\startnarrowtyping
+\startsample
\midaligned{无名氏}
\blank[line]
% 省略了正文内容
-\stopnarrowtyping\stopsamplecode
-\mysample[zaoshu-3]{散文示例 3}{zaoshu-3.pdf}
+\stopsample
+\sample[option=TEX][zaoshu-3]{散文示例 3}{\externalfigure[04/zaoshu-3.pdf]}
倘若需要将标题居中,而非默认的居左,只需使用 \type{\setuphead}单独为 \type{\title} 设定样式:
@@ -82,7 +82,7 @@
示例 \in[zaoshu-4] 将上述设定综合起来,排版结果已经中规中矩了,只是标题里的汉字的分布有些疏松,这是 \type{\setscript[hanzi]} 命令在汉字之间插入的粘连的伸长特性被 \ConTeXt\ 激活导致的,而它们之所以被激活,大概是 \ConTeXt\ 过于追求精确文字居中对齐而导致的,令 \type{\setuphead} 的参数 \type{align} 的值为 \type{{middle,broad}} 可以让 \ConTeXt\ 在文字居中对齐方面宽松一些\cite[contextref](p86),结果可让汉字的分布变为紧密,见示例 \in[zaoshu-5]。
-\startsamplecode\startnarrowtyping
+\startsample
\setupheads[indentnext=yes]
\setuphead[title][style=\bfc,align=middle]
\setupindenting[first,always,2em]
@@ -90,12 +90,12 @@
\title{鲁迅家的后园}
\midaligned{无名氏}
% 省略了正文内容
-\stopnarrowtyping\stopsamplecode
-\mysample[zaoshu-4]{散文示例 4}{zaoshu-4.pdf}
+\stopsample
+\sample[option=TEX][zaoshu-4]{散文示例 4}{\externalfigure[04/zaoshu-4.pdf]}
不知 \ConTeXt\ 从哪个版本起,有了一个新的对齐方式 \type{center},它与 \type{{middle,broad}} 等价。请记住这个知识,因为以后可能会经常需要设定居中对齐。
-\startsamplecode\startnarrowtyping
+\startsample
\setupheads[indentnext=yes]
\setuphead
[title][style=\bfc,align=center]
@@ -104,8 +104,8 @@
\title{鲁迅家的后园}
\midaligned{无名氏}
% 省略了正文内容
-\stopnarrowtyping\stopsamplecode
-\mysample[zaoshu-5]{散文示例 5}{zaoshu-5.pdf}
+\stopsample
+\sample[option=TEX][zaoshu-5]{散文示例 5}{\externalfigure[04/zaoshu-5.pdf]}
\section[context-world]{正式踏入 \ConTeXt\ 世界}
@@ -150,7 +150,7 @@
\placefigure
[here,force][style-file]
- {内容与样式分离}{\blueframed{\externalfigure[style-file.png][width=.8\textwidth]}}
+ {内容与样式分离}{\blueframed{\externalfigure[04/style-file.png][width=.8\textwidth]}}
一旦熟悉了如何实现排版内容与样式的分离,在使用 \ConTeXt\ 排版愈发复杂的内容时,你的样式文件 foo-env.tex 的内容便会日益丰富。长此以往,你总是能攒出一些样式文件,供不同的文档形式使用。排版内容总是千变万化,但样式却总是寥寥数种且极易与他人分享,这便是 \TeX\ 的优点,但前提是,你需要清晰地理解你所设定的任何一个排版样式。事实上,这也正是学习任何一种 \TeX\ 系统的乐趣所在。
@@ -160,7 +160,7 @@
\placefigure
[here,force][pagenumber]
- {页码}{\blueframed{\externalfigure[pagenumber.png][width=.8\textwidth]}}
+ {页码}{\blueframed{\externalfigure[04/pagenumber.png][width=.8\textwidth]}}
首先,文章标题所在页面,通常不需要页码。该要求,只需在标题样式将页眉和页脚置空,即
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/05.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/05.tex
index 3a1a3cdc0b8..0ec86709d6a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/05.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/05.tex
@@ -6,14 +6,14 @@
在偷偷使用 ChatGPT 给领导起草讲稿之前,先用 \ConTeXt\ 列表安排一下今日待办事项:
-\startsamplecode\startnarrowtyping
+\startsample
2023 年 3 月 22 日
\startitemize
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals[2]
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[todo-list]{待办事项}{05-todo-list.pdf}
+\stopsample
+\sample[option=TEX][todo-list]{待办事项}{\externalfigure[05/todo-list.pdf]}
现在你已经学会了列表的用法了,剩下的,仅仅是设定它的样式。此外,你也学到了如何写大写的罗马数字,至于小写的,将 \type{\Romannumerals} 换成 \type{\romannumerals} 即可。
@@ -30,35 +30,35 @@
将上述代码中的数字 1 换成 2~9 的任何一个数字,可更换另一种列表项符号。例如
-\startsamplecode\startnarrowtyping
+\startsample
\startitemize[8]
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals[2]
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[]{改变列表项符号}{05-todo-list-2.pdf}
+\stopsample
+\sample[option=TEX][]{改变列表项符号}{\externalfigure[05/todo-list-2.pdf]}
\section{有序号列表}
将无序号列表的数字参数换为 n,便可得到有序号列表。例如
-\startsamplecode\startnarrowtyping
+\startsample
\startitemize[n]
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals[2]
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[]{有序号列表}{05-todo-list-3.pdf}
+\stopsample
+\sample[option=TEX][]{有序号列表}{\externalfigure[05/todo-list-3.pdf]}
有时,需要序号形式是带括号的数字,可作以下设定:
-\startsamplecode\startnarrowtyping
+\startsample
\startitemize[n][left=(,right=),stopper=]
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals[2]
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[]{数字带括号的有序号列表}{05-todo-list-4.pdf}
+\stopsample
+\sample[option=TEX][]{数字带括号的有序号列表}{\externalfigure[05/todo-list-4.pdf]}
\noindent 其中「\type{stopper=}」是将参数 \type{stopper} 置空,达到的效果是消除列表项序号的西文句号后缀「\type{.}」。
@@ -68,7 +68,7 @@
你可能会觉得 \ConTeXt\ 为无序号列表提供的列表项符号无法体现你的气质,\ConTeXt\ 说,Do it yourself! 下面我用 \METAPOST\ 代码绘制了一个小正方形,并令其边线略微受到随机扰动,然后将该图形定义为列表项符号:
-\startsamplecode\startnarrowtyping
+\startsample
\startuseMPgraphic{foo}
path p;
p := fullsquare scaled 8pt randomized 1pt;
@@ -82,8 +82,8 @@
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals{2}
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[rsquare]{自定义符号的无序号列表}{05-todo-list-5.pdf}
+\stopsample
+\sample[option=TEX][rsquare]{自定义符号的无序号列表}{\externalfigure[05/todo-list-5.pdf]}
\noindent 现在你不懂上述代码的具体细节也无妨,观其大略即可,知道有一种可以画画的语言,叫 \METAPOST,它的代码可嵌入 \ConTeXt\ 环境作为插图使用,便已足够。
@@ -95,7 +95,7 @@
\noindent 但是这些带圈数字都是文字,并非数字。带圈的数字,无非是数字外面画个圆圈。画圆圈,用 \METAPOST\ 做此事,完全是不费吹灰之力,然后借助 \ConTeXt\ 的 overlay 机制\cite[overlay],将圆圈作为 inframed\cite[framed] 的背景,再用 inframed 套住列表项序号即可,详见
-\startsamplecode\startnarrowtyping
+\startsample
\startuseMPgraphic{foo}
path p;
p := fullcircle scaled 12pt;
@@ -112,8 +112,8 @@
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals{2}
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[number-in-circle]{数字带圆圈的有序号列表}{05-todo-list-6.pdf}
+\stopsample
+\sample[option=TEX][number-in-circle]{数字带圆圈的有序号列表}{\externalfigure[05/todo-list-6.pdf]}
\noindent 你可能依然不知道上述代码具体细节,不必着急,以后会经常和它们打交道,逐渐便可熟悉。
@@ -121,25 +121,25 @@
消除列表项之间的空白,只需
-\startsamplecode\startnarrowtyping
+\startsample
2023 年 3 月 22 日
\startitemize[1,packed]
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals{2}
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[]{消除列表项之间的空白}{05-todo-list-7.pdf}
+\stopsample
+\sample[option=TEX][]{消除列表项之间的空白}{\externalfigure[05/todo-list-7.pdf]}
消除列表前后以及列表项之间的空白,只需
-\startsamplecode\startnarrowtyping
+\startsample
2023 年 3 月 22 日
\startitemize[1,nowhite]
\item 中午,晒十五分钟太阳
\item 晚上,看流浪地球 \Romannumerals{2}
\stopitemize
-\stopnarrowtyping\stopsamplecode
-\mysample[]{消除列表项之间的空白}{05-todo-list-8.pdf}
+\stopsample
+\sample[option=TEX][]{消除列表项之间的空白}{\externalfigure[05/todo-list-8.pdf]}
\section{小结}
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/06.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/06.tex
index e37f5339344..6c29501149d 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/06.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/06.tex
@@ -48,7 +48,7 @@ Knuth 基于文学编程\cite[knuth-1984-literate]技术开发了
\stoptyping
\noindent 编译 foo.tex,可得以下结果:
\blank[line]
-\midaligned{\externalfigure[10-bibtex-example-01.pdf]}
+\midaligned{\externalfigure[06/bibtex-example-01.pdf]}
\blank[line]
\section{文献列表样式}
@@ -61,7 +61,7 @@ Knuth 基于文学编程\cite[knuth-1984-literate]技术开发了
\placelistofpublications
\stoptyping
\blank[line]
-\midaligned{\externalfigure[10-bibtex-example-02.pdf]}
+\midaligned{\externalfigure[06/bibtex-example-02.pdf]}
\blank[line]
对于预定义样式,可以进行调整。例如,缩小文献序号后的空白间距,
@@ -70,7 +70,7 @@ Knuth 基于文学编程\cite[knuth-1984-literate]技术开发了
\setupbtxlist[apa][distance=.5em,width=fit]
\stoptyping
\blank[line]
-\midaligned{\externalfigure[10-bibtex-example-03.pdf]}
+\midaligned{\externalfigure[06/bibtex-example-03.pdf]}
\section{自定义文献列表样式}
@@ -172,7 +172,7 @@ Knuth 发明了文学编程语言 WEB\cite[knuth-1984-literate]。
用于验证上述定义参考文献类表样式 foo 是否可用。结果为
\blank[line]
-\midaligned{\externalfigure[10-bibtex-example-04.pdf]}
+\midaligned{\externalfigure[06/bibtex-example-04.pdf]}
\section{小结}
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/08.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/08.tex
index 052ef77ea69..c0bfd877835 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/08.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/08.tex
@@ -13,13 +13,13 @@
\stoptyping
-\noindent 便可将 ctxnotes.png 作为插图,即 \externalfigure[ctxnotes.png]。显然,这是插图,但很可能并非是我们想要的插图形式。我们想要的是,独占一行且居中放置的插图,这个要求这并不难实现:
+\noindent 便可将 ctxnotes.png 作为插图,即 \externalfigure[08/ctxnotes.png]。显然,这是插图,但很可能并非是我们想要的插图形式。我们想要的是,独占一行且居中放置的插图,这个要求这并不难实现:
\starttyping[option=TEX]
\midaligned{\externalfigure[ctxnotes.png]}
\stoptyping
-\midaligned{\externalfigure[ctxnotes.png]}
+\midaligned{\externalfigure[08/ctxnotes.png]}
如果需要让插图更大一些,例如宽度为 8 cm,高度按图片原有比例自动放大,只需
@@ -30,29 +30,29 @@
\noindent 通常更建议使用相对尺寸,例如 0.3 倍的版心宽度(满行文字的最大宽度):
\starttyping[option=TEX]
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[ctxnotes.png][width=.375\textwidth]}
\stoptyping
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[08/ctxnotes.png][width=.375\textwidth]}
如法炮制,给图片加上标题也很容易:
\starttyping[option=TEX]
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[ctxnotes.png][width=.375\textwidth]}
\midaligned{\tfx \ConTeXt\ 学习笔记封面截图}
\stoptyping
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[08/ctxnotes.png][width=.375\textwidth]}
\midaligned{\tfx\ConTeXt\ 学习笔记封面截图}
\indentation 如果你还希望插图能有编号,对于篇幅较小的文章,手工输入即可,建议在编号后,使用 \type{\quad} 插入一个字宽的空白作为间隔,因为普通的空格只有半个字宽。例如
\starttyping[option=TEX]
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[ctxnotes.png][width=.375\textwidth]}
\midaligned{\tfx 图 1\quad\ConTeXt\ 学习笔记封面截图}
\stoptyping
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[08/ctxnotes.png][width=.375\textwidth]}
\midaligned{\tfx 图 1\quad\ConTeXt\ 学习笔记封面截图}
如果你担心,插图太多,手工输入图片编号难免会出错,可以使用 \ConTeXt\ 的计数器功能,让 \ConTeXt\ 为你自动递增图片序号。首先,定义一个计数器:
@@ -64,20 +64,20 @@
\noindent 然后,每次在给插图添加加标题时,将该计数器增 1,并获取它的当前的值:
\starttyping[option=TEX]
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[ctxnotes.png][width=.375\textwidth]}
\incrementnumber[myfig]
\midaligned{\tfx 图 \getnumber[myfig]\quad\ConTeXt\ 学习笔记封面截图}
\blank[line]
-\midaligned{\externalfigure[ctxnotes-2.png][width=.4\textwidth]}
+\midaligned{\externalfigure[ctxnotes-2.png][width=.375\textwidth]}
\incrementnumber[myfig]
\midaligned{\tfx 图 \getnumber[myfig]\quad 涂鸦版 Hilbert 曲线}
\stoptyping
\definenumber[myfig][prefix=no]
-\midaligned{\externalfigure[ctxnotes.png][width=.4\textwidth]}
+\midaligned{\externalfigure[08/ctxnotes.png][width=.375\textwidth]}
\incrementnumber[myfig]
\midaligned{\tfx 图 \getnumber[myfig]\quad\ConTeXt\ 学习笔记封面截图}
-\midaligned{\externalfigure[ctxnotes-2.png][width=.4\textwidth]}
+\midaligned{\externalfigure[08/ctxnotes-2.png][width=.375\textwidth]}
\incrementnumber[myfig]
\midaligned{\tfx 图 \getnumber[myfig]\quad 涂鸦版 Hilbert 曲线}
@@ -116,7 +116,7 @@
\starttyping[option=TEX]
\placemyfigure
{涂鸦版 Hilbert 曲线}
- {\externalfigure[ctxnotes-2.png][width=.4\textwidth]}
+ {\externalfigure[ctxnotes-2.png][width=.375\textwidth]}
\stoptyping
你可能并不能完全理解 \type{\palcemyfigure} 的定义,但是基于上一节的一些示例,应该能猜出其要义。这已经足够了,日后倘若你觉得有些经常重复使用的排版代码,它们只存在少许差异,便可尝试为它们定义一个宏,用宏的参数代替差异。现在也许你已经隐隐感觉到了,\ConTeXt\ 的排版命令也是 \TeX\ 宏。
@@ -137,24 +137,24 @@
{涂鸦版 Hilbert 曲线}
{\externalfigure[ctxnotes-2.png][width=.3\textwidth]}
\stoptyping
-\midaligned{\externalfigure[hibert.pdf]}
+\midaligned{\externalfigure[08/hibert.pdf]}
\subsection{插图标题样式}
对于 \type{\placefigure} 的结果,可能你已经觉得有些不满意了。在中文排版中,图片的编号前缀不应该是 Figure,而应该是「图」,此外,编号也没必要粗体,而且标题字号应当比正文字体小一级。没有办法,\ConTeXt\ 一切默认的样式,皆针对西文排版。不过,我们可以通过以下命令,将插图标题样式设置成我们所期望的样式:
-\starttyping[option=TEX][space=on]
+\starttyping[option=TEX,space=on]
\setupcaption[figure][style=\tfx,headstyle=\rm]
\setuplabeltext[en][figure={图 }]
\stoptyping
-\midaligned{\externalfigure[hibert-1.pdf]}
+\midaligned{\externalfigure[08/hibert-1.pdf]}
上述设定的样式,已基本符合我们的要求。根据排版结果,很容易能猜出来,\type{\setupcaption} 的 \type{style} 参数用于设定插图字体样式,\type{headstyle} 则用于设定插图编号样式。至于 \type{\setuplabeltext},与 \ConTeXt\ 的语言界面有关,但现在不必涉及太多细节,仅需知道,它可将插图标题的前缀「\type{Figure}」替换为「\type[space=on]{图 }」。不过,依然存在一个细微的问题,标题里的汉字之间的粘连的伸长特性又被 \ConTeXt\ 触发了,导致汉字分布有些疏松。该问题的解决方法与第 \in[post] 章的示例 \in[zaoshu-5] 相似,用将对齐参数设为 \type{center},即
\starttyping[option=TEX]
\setupcaption[figure][style=\tfx,headstyle=\normal,align=center]
\stoptyping
-\midaligned{\externalfigure[hibert-2.pdf]}
+\midaligned{\externalfigure[08/hibert-2.pdf]}
\subsection{插图位置}
@@ -190,7 +190,7 @@
[][Hilbert 曲线]
{涂鸦版 Hilbert 曲线}{\externalfigure[ctxnotes-2.png][width=.3\textwidth]}
\stoptyping
-\midaligned{\blueframed{\externalfigure[hibert-3.pdf]}}
+\midaligned{\blueframed{\externalfigure[08/hibert-3.pdf]}}
\section[figure-matrix]{阵列}
@@ -202,7 +202,7 @@
\placefigure{}{}
\stopfloatcombination
\stoptyping
-\leftaligned{\externalfigure[05-floatcomb.pdf]}
+\leftaligned{\externalfigure[08/floatcomb.pdf]}
\noindent 然后将所得阵列作为插图,便可得到居中放置的插图阵列:
@@ -214,7 +214,7 @@
\stopfloatcombination
}
\stoptyping
-\midaligned{\externalfigure[05-floatcomb-2.pdf]}
+\midaligned{\externalfigure[08/floatcomb-2.pdf]}
上述示例用了 \type{\placefigure} 一个小技巧:当 \type{\placefigure} 的第一个参数含有 \type{none} 时,可以消除插图编号和标题。此外,你应该发现了,\type{\placefigure} 的参数为空时,\ConTeXt\ 会以一个矩形框表示插图,还应当注意到,方括号形式的参数,通常是可以省略的。
@@ -228,7 +228,7 @@
\stopfloatcombination
}
\stoptyping
-\midaligned{\externalfigure[05-floatcomb-3.pdf]}
+\midaligned{\externalfigure[08/floatcomb-3.pdf]}
基于 \type{combination} 环境可实现与上例等效的插图阵列,只是所用代码略多一些,但形式上更为结构化且应用范围更广。例如
@@ -242,7 +242,7 @@
\stopcombination
}
\stoptyping
-\midaligned{\externalfigure[05-floatcomb-4.pdf]}
+\midaligned{\externalfigure[08/floatcomb-4.pdf]}
\section{图片目录}
@@ -264,15 +264,12 @@
\starttyping[option=TEX]
\startuseMPgraphic{metapost 图形}
-path p;
-u := 7cm; v := 3cm;
-p := fullsquare xyscaled (u, v) randomized 0.07u;
-drawpath p;
-drawpoints p;
+path p; p := fullsquare xyscaled (7cm, 3cm) randomized 0.07u;
+drawpath p; drawpoints p;
\stopuseMPgraphic
\placefigure{\MetaFun\ example}{\useMPgraphic{metapost 图形}}
\stoptyping
-\midaligned{\externalfigure[05-metapost.pdf]}
+\midaligned{\externalfigure[08/metapost.pdf]}
上述示例在排版插图标题时,涉及 \TeX\ 宏在使用时即宏调用时的一个细节。例如,\type{\TeX} 之后跟随一个或多个空格,即 \type[space=on]{\TeX },这些空格会被 \TeX\ 引擎吞掉,不会显示在排版结果中,原因是默认情况下,空格是 \TeX\ 引擎需要知道宏的名字的结束符。如果需要在一个宏调用之后插入空格,需要对空格进行转义,即 \type[space=on]{\ },亦即反斜线后跟随一个空格。
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/09.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/09.tex
index 587dd248b56..23356c24669 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/09.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/09.tex
@@ -6,59 +6,41 @@
首先,构造一个 2 行 3 列的表格,第 1 行的内容是 \type{1 2 3},第二行的内容是 \type{4 5 6},排版代码和结果如下:
-\starttyping[option=TEX]
-\starttabulate
-\NC 1 \NC 2 \NC 3\NC\NR
-\NC 4 \NC 5 \NC 6\NC\NR
-\stoptabulate
-\stoptyping
+\startsample
\starttabulate
\NC 1 \NC 2 \NC 3\NC\NR
\NC 4 \NC 5 \NC 6\NC\NR
\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\null}
+\getsample
-结果第 3 列跑到版面最右侧了。这是因为我们尚未定义表格各列的对齐方式。对齐方式不外乎三种,左、中、右,Tabulate 分别使用缩写 \type{l},\type{c} 和 \type{r} 指代它们。例如,若令表格第 1 列居左,第 2 列居中,第 3 列居右,只需
+\noindent 结果第 3 列跑到版面最右侧了。这是因为我们尚未定义表格各列的对齐方式。对齐方式不外乎三种,左、中、右,Tabulate 分别使用缩写 \type{l},\type{c} 和 \type{r} 指代它们。例如,若令表格第 1 列居左,第 2 列居中,第 3 列居右,只需
-\starttyping[option=TEX]
-\starttabulate[|l|c|r|]
-\NC 1 \NC 2 \NC 3\NC\NR
-\NC 4 \NC 5 \NC 6\NC\NR
-\stoptabulate
-\stoptyping
+\startsample
\starttabulate[|l|c|r|]
\NC 1 \NC 2 \NC 3\NC\NR
\NC 4 \NC 5 \NC 6\NC\NR
\stoptabulate
-
-现在看上去像表格了,但是由于表格尚无边框线,无法看出表格各列内容的对齐状态。
+\stopsample
+\simplesample[option=TEX]{\getsample}
+\noindent 现在看上去像表格了,但是由于表格尚无边框线,无法看出表格各列内容的对齐状态。
想必你已经猜测出了,\type{\NC} 用于在表格的某一行构造一个单元格,上述示例中,表格内容的每一行最后一个 \type{\NC} 实际上是多余的,\ConTeXt\ 会忽略它,但是你可以将它理解为表格的单元格的边界。\type{\NR} 用于构造一个新行,即下一行。上述示例里,表格只有两行,实际上第 2 个 \type{\NR} 也是多余的,只是为了形式上更整齐而保留,\ConTeXt\ 会忽略它,你可以将它理解为表格一行的结束。
现在,将 \type{\NC} 替换为 \type{\VL},便可画出单元格的左右边界线,即
-\starttyping[option=TEX]
-\starttabulate[|l|c|r|]
-\VL 1 \VL 2 \VL 3\VL\NR
-\VL 4 \VL 5 \VL 6\VL\NR
-\stoptabulate
-\stoptyping
-
+\startsample
\starttabulate[|l|c|r|]
\VL 1 \VL 2 \VL 3\VL\NR
\VL 4 \VL 5 \VL 6\VL\NR
\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\getsample}
-如果在表格每一行的开始放上 \type{\HL},可画出表格各行横线,即
+\noindent 在表格每一行的开始放上 \type{\HL},可画出表格各行横线,即
-\starttyping[option=TEX]
-\starttabulate[|l|c|r|]
-\HL
-\VL 1 \VL 2 \VL 3\VL\NR
-\HL
-\VL 4 \VL 5 \VL 6\VL\NR
-\HL
-\stoptabulate
-\stoptyping
+\startsample
\starttabulate[|l|c|r|]
\HL
\VL 1 \VL 2 \VL 3\VL\NR
@@ -66,22 +48,16 @@
\VL 4 \VL 5 \VL 6\VL\NR
\HL
\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\getsample}
-可能你已经发现了,表格的竖线将被横线截断了。不必担心是你的问题,而是 Tabulate 主要用于排版横线表,例如图 \in[three-line table] 所示的在科技论文中常用的三线表。
+\noindent 可能你已经发现了,表格的竖线将被横线截断了。不必担心是你的问题,而是 Tabulate 主要用于排版横线表,例如图 \in[three-line table] 所示的在科技论文中常用的三线表。
-\placefigure[here][three-line table]{三线表}{\externalfigure[06-three-line-table.pdf]}
+\placefigure[force][three-line table]{三线表}{\externalfigure[09/three-line-table.pdf]}
-不过,要让表格的横线和竖线完全相交并不困难,只需将单元格之间的纵向间距参数 \type{distance} 设为 \type{0pt} 或 \type{none}:
+让表格的横线和竖线完全相交并不困难,只需将单元格之间的纵向间距参数 \type{distance} 设为 \type{0pt} 或 \type{none}:
-\starttyping[option=TEX]
-\starttabulate[|l|c|r|][distance=none]
-\HL
-\VL 1 \VL 2 \VL 3\VL\NR
-\HL
-\VL 4 \VL 5 \VL 6\VL\NR
-\HL
-\stoptabulate
-\stoptyping
+\startsample
\starttabulate[|l|c|r|][distance=none]
\HL
\VL 1 \VL 2 \VL 3\VL\NR
@@ -89,20 +65,14 @@
\VL 4 \VL 5 \VL 6\VL\NR
\HL
\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\getsample}
\section{间距调整}
若希望单元格的宽度更宽一些,需要在列格式中设定 \type{w} 参数,例如令单元格宽度为 1 cm,只需 \type{w(1cm)} 即可。例如
-\starttyping[option=TEX]
-\starttabulate[|lw(1cm)|cw(1cm)|rw(1cm)|][distance=none]
-\HL
-\VL 1 \VL 2 \VL 3\VL\NR
-\HL
-\VL 4 \VL 5 \VL 6\VL\NR
-\HL
-\stoptabulate
-\stoptyping
+\startsample
\starttabulate[|lw(1cm)|cw(1cm)|rw(1cm)|][distance=none]
\HL
\VL 1 \VL 2 \VL 3\VL\NR
@@ -110,16 +80,18 @@
\VL 4 \VL 5 \VL 6\VL\NR
\HL
\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\getsample}
-如果希望所有的 Tablutate 实例的 \type{distance} 参数皆为 \type{none},可使用 \type{\setuptabulate} 进行设定:
+若希望文档中所有表格实例的 \type{distance} 参数皆为 \type{none},可用 \type{\setuptabulate} 进行设定:
\starttyping[option=TEX]
\setuptabulate[distance=none]
\stoptyping
-若希望单元格的竖向间距大一些,可使用 \type{\TB} 命令插入空行进行调整。例如插入 2mm 高的空格:
+若想加大单元格的竖向间距,可用 \type{\TB} 命令插入空行予以调整。例如插入 2mm 高的空格,
-\starttyping[option=TEX]
+\startsample
\starttabulate[|lw(1cm)|cw(1cm)|rw(1cm)|][distance=none]
\HL
\VL 1 \VL 2 \VL 3\VL\NR
@@ -129,16 +101,8 @@
\VL 4 \VL 5 \VL 6\VL\NR
\HL
\stoptabulate
-\stoptyping
-\starttabulate[|lw(1cm)|cw(1cm)|rw(1cm)|][distance=none]
-\HL
-\VL 1 \VL 2 \VL 3\VL\NR
-\HL
-\TB[line]
-\HL
-\VL 4 \VL 5 \VL 6\VL\NR
-\HL
-\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\getsample}
\noindent \type{\TB} 也可以使用相对尺寸,例如 \type{2*line},\type{line},\type{halfline} 和 \type{quarterline} 分别为一行文字的高度的 2 倍,1 倍,1/2 倍和 1/4 倍。
@@ -154,7 +118,7 @@
\stoptabulate
}
\stoptyping
-\midaligned{\externalfigure[06-01.pdf]}
+\midaligned{\externalfigure[09/01.pdf]}
\section{\type{\placetable}}
@@ -171,15 +135,15 @@
\stoptabulate
}
\stoptyping
-\midaligned{\externalfigure[06-02.pdf]}
+\midaligned{\externalfigure[09/02.pdf]}
-对于中文排版,表格的标题,也需要自己定制,默认的设置并不符合我们的习惯。首先,将表格编号前缀设定为
+对于中文排版,表格的标题,默认的设置并不符合我们的习惯,需要作一些定制。首先,将表格编号前缀设定为
-\starttyping[option=TEX][space=on]
+\starttyping[option=TEX,space=on]
\setuplabeltext[en][table={表 }]
\stoptyping
-\noindent 然后将表格标题编号设为正体,字号比正文字号小一级,放置于表格上方,并居中对齐:
+\noindent 然后,将表格标题编号设为正体,字号比正文字号小一级,放置于表格上方,并居中对齐:
\starttyping[option=TEX]
\setupcaption
@@ -187,13 +151,13 @@
[headstyle=\tf,style=\tfx,location=top,align=center]
\stoptyping
\blank[line]
-\midaligned{\externalfigure[06-03.pdf]}
+\midaligned{\externalfigure[09/03.pdf]}
\section{不传之秘}
在绘制表格的横线和竖线时,线条粗度可通过参数 \type{rulethickness} 进行设定。例如,将线条粗度设为 2 pt:
-\starttyping[option=TEX]
+\startsample
\starttabulate[|c|c|c|c|c|][rulethickness=2pt]
\HL
\NC 一 \NC 二 \NC 三 \NC 四 \NC 五 \NC\NR
@@ -202,8 +166,8 @@
\NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC\NR
\HL
\stoptabulate
-\stoptyping
-\midaligned{\externalfigure[06-04.pdf]}
+\stopsample
+\simplesample[option=TEX]{\externalfigure[09/04.pdf]}
\noindent 但是,如果我们只想让表格的顶线和底线是粗度 2 pt,中间那条横线让它是 Tabulate 的默认粗度,该如何实现呢?
@@ -222,7 +186,7 @@ $ mtxrun --script base --search tabl-tbl.mkxl
\item \type{\HL}\footnote{包括 \type{\TL},\type{\FL},……,\type{\BL}。}和 \type{\VL} 可以接受两个参数,一个是表格线既定粗度的倍数,另一个是表格线颜色。
\stopitemize
-解决方法是,首先将上述示例修改为
+\noindent 然后,将上述示例修改为
\starttyping[option=TEX]
\starttabulate[|c|c|c|c|c|][rulethickness=2pt]
@@ -251,13 +215,13 @@ $ mtxrun --script base --search tabl-tbl.mkxl
\stoptabulate
\stoptyping
-现在要保持 \type{\TL} 和 \type{\BL} 为既定粗度 2 pt,将 \type{\FL},\type{\ML} 和 \type{\LL} 的粗度设置为 0.2 倍的既定粗度,及 0.4 pt,顺便试验一下颜色是否真的可用,见表 \in[HL example] 对应的代码,结果只有 \type{\ML} 变成了双线,其他皆符合预期。
+现在要保持 \type{\TL} 和 \type{\BL} 为既定粗度 2 pt,将 \type{\FL},\type{\ML} 和 \type{\LL} 的粗度设置为 0.2 倍的既定粗度,及 0.4 pt,顺便试验一下颜色是否真的可用,见示例 \in[HL example] 对应的代码,结果只有 \type{\ML} 变成了双线,其他皆符合预期。
-为何 \type{\ML} 如此不配合呢?我猜也许它本来就是在绘制双线,因为 Tabulate 支持表格分页断开,即一个表格若处于页面底部且不能完全被当前页面容纳时,\ConTeXt\ 可将其断开,一部分在当前页面,另一部分在下一页面。为了让断开后的表格完整,\type{\ML} 必须是双线。若将表 \in[HL example] 对应代码中的 \type{\ML} 换成 \type{\HL},结果同样是双线。若不需要双线,可将 \type{\ML} 皆换为 \type{\FL} 或 \type{\LL}。
+为何 \type{\ML} 如此不配合呢?我猜也许它本来就是在绘制双线,因为 Tabulate 支持表格分页断开,即一个表格若处于页面底部且不能完全被当前页面容纳时,\ConTeXt\ 可将其断开,一部分在当前页面,另一部分在下一页面。为了让断开后的表格完整,\type{\ML} 必须是双线。若将示例 \in[HL example] 中的 \type{\ML} 换成 \type{\HL},结果同样是双线。若不需要双线,可将 \type{\ML} 皆换为 \type{\FL} 或 \type{\LL}。
为了避免上述莫名其妙的问题,若只是令表格顶线和底线变粗,不必设定 \type{rulethickness} 参数,而是修改顶线和底线的粗度,令其他表格线的粗度皆为默认值。
-\starttyping[option=TEX]
+\startsample
\starttabulate[|c|c|c|c|c|][rulethickness=2pt]
\TL
\NC 一 \NC 二 \NC 三 \NC 四 \NC 五 \NC\NR
@@ -269,20 +233,8 @@ $ mtxrun --script base --search tabl-tbl.mkxl
\NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC\NR
\BL
\stoptabulate
-\stoptyping
-\placetable[here][HL example]{修改表格线粗度和颜色}{
- \starttabulate[|c|c|c|c|c|][rulethickness=2pt]
- \TL
- \NC 一 \NC 二 \NC 三 \NC 四 \NC 五 \NC\NR
- \FL[0.2,red]
- \NC 甲 \NC 乙 \NC 丙 \NC 丁 \NC 戊 \NC\NR
- \ML[0.2,blue]
- \NC one \NC two \NC three \NC four \NC five \NC\NR
- \LL[0.2,magenta]
- \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC\NR
- \BL
- \stoptabulate
-}
+\stopsample
+\sample[option=TEX][HL example]{修改表格线粗度和颜色}{\getsample}
\section{小结}
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/10.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/10.tex
index 7616361d011..15d402e1b83 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/10.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/10.tex
@@ -1,276 +1,207 @@
-\chapter{盒子}
+\chapter{一字不差}
-在 \in[item-sym-diy] 节中,你已经见过盒子了,只是那时可能你还不知其究竟,本章将揭开它们的一些端倪。也有可能你早已钻研过 Knuth 的《The \TeX\ book》,对盒子的研究之深已经让我望风而拜,但是未必熟悉 \ConTeXt\ 的盒子,故而本章仍有部分内容值得一睹。
+在这个信息时代,文档出现一些计算机程序源码片段,是很常见的事。这些代码需要以等宽字体原样显示,像是过去的打字机的输出,故而名曰文本抄录(Verbatim text)。为了让代码更为易读,通常需要根据相应语法对其进行着色渲染。有时,还需要在代码中插入一些其他排版元素。
-\section{\TeX\ 盒子}
+\section{抄录}
-前面已经多次暗示和明示,\TeX\ 系统是 \ConTeXt\ 的底层,二者的关系犹如引擎(发动机)和汽车的关系。对 \TeX\ 引擎丝毫不懂,并不影响你学习和使用 \ConTeXt\ 排版一份精致的文档,但是懂一些引擎层面工作原理,未必会有用处,但是你现在也并不能确定将来会不会成为一名 \TeX\ 黑客,如同你从前也从未想过有一天会学习 \ConTeXt。
+抄录有两种形式,一种是位于一行文字之内,用 \type{\type{...}} 排版,另一种是位于段落之间,用 \type{\starttyping ... \stoptyping} 排版。例如
-在 \TeX\ 系统中,盒子是很重要的部件。例如,在 \ConTeXt\ 的排版的每一个段落,是一个竖向盒子,即 \type{\vbox},该盒子之内又有一些横向盒子,即 \type{\hbox},它们是段落的每一行。我们可以直接用这两种盒子构造一个不甚规整的段落:
-
-\startsamplecode\startnarrowtyping
-\vbox{
- \hbox{离离原上草}\hbox{一岁一枯荣}\hbox{野火烧不尽}\hbox{春风吹又生}
-}
-\stopnarrowtyping\stopsamplecode
-\mysample[todo-list]{竖向盒子和横向盒子}{08-vbox-and-hbox.pdf}
-
-横向盒子可以指定它的长度,竖向盒子可以指定它的高度。例如,
-
-\starttyping[option=TEX]
-\hbox to 5cm {赋得古原草送别}
-\vbox to 3cm {
- \hbox{离离原上草}\hbox{一岁一枯荣}\hbox{野火烧不尽}\hbox{春风吹又生}
+\startsample
+\startframedtext[width=\textwidth]
+用 C 语言写一个程序,让它在屏幕上显示「\type{Hello world!}」,代码如下
+\starttyping
+#include <stdio.h>
+int main(void)
+{
+ printf("Hello world!\n");
+ return 0;
}
\stoptyping
+\stopframedtext
+\stopsample
+\typesample
-在示例 \in[rsquare] 中,\type{\hbox} 用于包含一副使用 \METAPOST\ 语言绘制的矢量插图,关键代码如下:
+\noindent 结果为
-\starttyping[option=TEX]
-\startuseMPgraphic{foo}
-... ... ...
-\stopuseMPgraphic
-\lower.2ex\hbox{\useMPgraphic{foo}}
-\stoptyping
+\start
+\setuptyping[before={\blank[line]},after={\blank[line]}]
+\getsample
+\stop
-\noindent 其中 \type{useMPgraphic} 环境中的 \METAPOST\ 代码会被 \type{\useMPgraphic{foo}} 提交给 \TeX\ 引擎。\TeX\ 引擎会调用 metapost 程序将 \METAPOST\ 代码编译成 PDF 格式的图片,然后交给 \ConTeXt。最后由 \ConTeXt\ 将图片插入到 \type{\useMPgraphic{foo}} 所在的横向盒子里。\type{\lower .2ex} 可令位于其后的横向盒子下沉 0.2 ex。长度单位 ex 类似于 em,也是一个相对尺寸,它是当前所用字体中的字母 x 对应的字形的高度。从现在开始要记住,横向距离用 em,竖向距离用 ex,不过这只是建议,并非 \TeX\ 世界的法律。
+上述示例,不仅演示了抄录命令的基本用法,你应该也学会了如何使用 \type{framedtext} 环境给一些内容添加朴素的边框。
-还有一种横向盒子 \type{\line},它的宽度是当前段落的宽度,可让其中的文字向两边伸展并与边界对齐,例如
+\section{外框}
-\starttyping[option=TEX]
-\line{\darkred\bf 我能吞下玻璃而不伤身体。}
-\stoptyping
-\line{\darkred\bf 我能吞下玻璃而不伤身体。}
-
-看到上述示例,想必你想起了之前我们曾在文章标题的样式设定时,用 \type{{middle,broad}} 抑制的 \ConTeXt\ 触发汉字间隙的伸长特性,该特性与\type{\line} 的效果非常相似。
+也许你也想要一个像本文档中有着巨大的淡蓝色方括号的 \type{typing} 环境,但是需要事先对第 \in[metapost] 章中介绍的 \METAPOST\ 语言的基本用法有所了解方可。给 \type{typing} 环境添加朴素的外框很容易做到,而且它也是实现巨大淡蓝色方括号的基础,方法是
-使用 \type{\hfill} 或 \type{\hss} 可对横向盒子里的内容进行挤压。例如
+\startsample
+\setuptyping
+ [before={\startframedtext[width=\textwidth]},
+ after={\stopframedtext}]
-\starttyping[option=TEX]
-\line{\hfill 我能吞下玻璃而不伤身体。}
-\line{我能吞下玻璃而不伤身体。\hfill}
-\line{\hfill 我能吞下玻璃而不伤身体。\hfill}
-\line{\hss 我能吞下玻璃而不伤身体。}
-\line{我能吞下玻璃而不伤身体。\hss}
-\line{\hss 我能吞下玻璃而不伤身体。\hss}
+\starttyping
+带外框的 \starttyping ... \stoptyping
\stoptyping
+\stopsample
+\typesample
+\start
+\getsample
+\stop
-\blueframed{
- \vbox{
- \line{\hfill 我能吞下玻璃而不伤身体。}
- \line{我能吞下玻璃而不伤身体。\hfill}
- \line{\hfill 我能吞下玻璃而不伤身体。\hfill}
- \line{\hss 我能吞下玻璃而不伤身体。}
- \line{我能吞下玻璃而不伤身体。\hss}
- \line{\hss 我能吞下玻璃而不伤身体。\hss}
- }
-}
-
-\type{\hfill} 和 \type{\hss},都是可无限伸缩的粘连,还有一个伸缩能力弱于 \type{\hfill} 的 \type{\hfil}。竖向的可无限伸缩的粘连有 \type{\vfil},\type{\vfill} 和 \type{\vss}。
+在 \type{\setuptyping} 的 \type{before} 和 \type{after} 参数中,也可以根据自己的需求,添加其他排版命令或你自己定义的宏。\CONTEXT\ 很多命令带有 \type{before} 和 \type{after} 参数。
-\section{\ConTeXt\ 盒子}
+\section{行号}
-在 \ConTeXt\ 层面,通常很少使用 \TeX\ 盒子,而是使用 \type{\inframed} 和 \type{\framed}——前者是后者的特例。与 \TeX\ 盒子相比,\ConTeXt\ 层面的盒子可以显示边框,且有非常多的参数可以定制它们的外观。
+\type{\setuptyping} 的 \type{line} 参数可用于设定代码行号。通过 \type{\setuplinenumbering} 可调整行号样式。以下示例开启代码行号,并将行号到 \type{typing} 环境的距离设为 0.5 em:
-\type{\inframed} 用于正文,可用于给一行文字增加边框,例如
+\startsample
+\setuplinenumbering[typing][distance=.5em]
+\setuptyping
+ [numbering=line,
+ before={\startframedtext[width=\textwidth]},
+ after={\stopframedtext}]
-\starttyping[option=TEX]
-\type{\inframed{\type{\inframed{...}}}}
+\starttyping
+#include <stdio.h>
+int main(void)
+{
+ printf("Hello world!\n");
+ return 0;
+}
\stoptyping
+\stopsample
+\typesample
+\start
+\getsample
+\stop
-\noindent 结果为 \inframed{\type{\inframed{...}}}。倘若使用 \type{\framed},例如
-
-\starttyping[option=TEX]
-\type{\framed{\type{\framed{...}}}}
-\stoptyping
+\section{着色}
-\noindent 结果为 \framed{\type{\framed{...}}}。可以发现,\type{\inframed} 更适合在正文中使用,因为它能与文字基线对齐。事实上,\type{\inframed} 与 \type{\framed[location=low]} 等效,故而前者是后者的特例。例如
+\CONTEXT\ 提供了代码语法着色功能,例如对 \TEX\ 代码进行着色,
+\startsample
\starttyping[option=TEX]
-\framed[location=low]{\type{\framed[location=low]{...}}}
+\starttext
+Hello \CONTEXT!
+\stoptext
\stoptyping
+\stopsample
+\typesample
+\start
+\setuplinenumbering[typing][distance=.5em]
+\setuptyping
+ [numbering=line,
+ before={\startframedtext[width=\textwidth]},
+ after={\stopframedtext}]
+\getsample
+\stop
-\noindent 结果为 \framed[location=low]{\type{\framed[location=low]{...}}}。上述示例中的 \type{\type} 用于排版代码,它会自动将字体切换为等宽字体(\type{\tt})原样显示它所接受的文字。顺便多言,若是排版一段代码,可使用 \type{\starttyping[option=TEX] ... \stoptyping}。
+不幸的是,目前 \CONTEXT\ 仅实现了 \TEX,\METAPOST,Lua,XML 等代码的着色。不过,对于 \CONTEXT\ 尚不支持的语言,\CONTEXT\ 提供了扩展机制,若你对 Lua 语言及其 Lpeg 库有所了解,可自己动手,丰衣足食\cite[code-render]。
-如果不希望 \type{\framed} 显示边框,只需 \type{\framed[frame=off]{...}},也可以单独显示某条边线,并设定边线粗度和颜色:
+\section{逃逸}
-\starttyping[option=TEX]
-\line{
- \framed[frame=off,leftframe=on,rulethickness=4pt,framecolor=red]{foo}
- \framed[frame=off,topframe=on,rulethickness=4pt,framecolor=green]{foo}
- \framed[frame=off,rightframe=on,rulethickness=4pt,framecolor=blue]{foo}
- \framed[frame=off,bottomframe=on,rulethickness=4pt,framecolor=magenta]{foo}
+即使不懂 Lua 和 Lpeg,倘若你不嫌麻烦,利用 \type{\type} 和 \type{typing} 环境的逃逸(Escape)机制,也能实现代码着色。例如
+
+\starttyping[escape=no,option=TEX]
+\starttyping[escape=yes]
+/BTEX\darkgreen \#include/ETEX <stdio.h>
+/BTEX\darkblue int/ETEX main(/BTEX\darkblue void/ETEX)
+{
+ printf("/BTEX\darkred Hello world!\n/ETEX");
+ /BTEX\darkblue return/ETEX 0;
}
\stoptyping
-\line{
- \framed[frame=off,leftframe=on,rulethickness=4pt,framecolor=red]{foo}
- \framed[frame=off,topframe=on,rulethickness=4pt,framecolor=green]{foo}
- \framed[frame=off,rightframe=on,rulethickness=4pt,framecolor=blue]{foo}
- \framed[frame=off,bottomframe=on,rulethickness=4pt,framecolor=magenta]{foo}
-}
-
-\blank
-
-可以设定盒子的宽度和高度,例如宽 10cm,高 2 cm 的盒子:
-
-\starttyping[option=TEX]
-\hbox to \textwidth{\hfill\framed[width=10cm,height=2cm]{foo}\hfill}
\stoptyping
-\hbox to \textwidth{\hfill\framed[width=10cm,height=2cm]{foo}\hfill}
-\section{对齐}
+\noindent 结果为
-\ConTeXt\ 盒子的内容默认居中,即 \type{align=center},此外还有 8 种对齐方式:
-
-\starttyping[option=TEX]
-\line{
- \setupframed[width=1.95cm,height=1.95cm]
- \framed[align={flushleft,high}]{A}
- \framed[align={middle,high}]{A}
- \framed[align={flushright,high}]{A}
- \framed[align={flushright,lohi}]{A}
- \framed[align={flushright,low}]{A}
- \framed[align={middle,low}]{A}
- \framed[align={flushleft,low}]{A}
- \framed[align={flushleft,lohi}]{A}
+\start
+\setuptyping
+ [before={\startframedtext[width=\textwidth]},
+ after={\stopframedtext}]
+\starttyping[escape=yes]
+/BTEX\darkgreen \#include/ETEX <stdio.h>
+/BTEX\darkblue int/ETEX main(/BTEX\darkblue void/ETEX)
+{
+ printf("/BTEX\darkred Hello world!\n/ETEX");
+ /BTEX\darkblue return/ETEX 0;
}
\stoptyping
-\line{
- \setupframed[width=1.95cm,height=1.95cm]
- \framed[align={flushleft,high}]{A}
- \framed[align={middle,high}]{A}
- \framed[align={flushright,high}]{A}
- \framed[align={flushright,lohi}]{A}
- \framed[align={flushright,low}]{A}
- \framed[align={middle,low}]{A}
- \framed[align={flushleft,low}]{A}
- \framed[align={flushleft,lohi}]{A}
-}
+\stop
-\type{\setupframed} 所作的设定会影响到其后的所有 \type{\framed},但是不会影响到其所处编组\footnote{还记得 \TeX\ 编组吗?即 \type[escape=no]{{...}}。}之外的 \type{\framed}。
-
-\section{背景}
-
-可将颜色作为 \type{\framed} 的背景。例如
+我应该一直都没有告诉你,\CONTEXT\ 该如何给文字着色。\CONTEXT\ 预定义了一些标准颜色,可直接使用这些颜色的名字对文字进行着色,例如「\type{{\magenta 紫色}}」,结果为「{\magenta 紫色}」,也可以使用 \type{\color} 命令,例如「\type{\color[lightmagenta]{浅紫色}}」,结果为「\color[lightmagenta]{浅紫色}」。以下代码可用于查看 \CONTEXT\ 预定义颜色,
\starttyping[option=TEX]
-\inframed
- [background=color,
- backgroundcolor=lightgray,
- width=2cm,
- frame=off]{\bf foo}
+\startTEXpage[offset=4pt]
+\showcolor[rgb]
+\stopTEXpage
\stoptyping
-\noindent 结果为 \inframed[background=color,backgroundcolor=lightgray,width=2cm,frame=off]{\bf foo}。
+使用 \type{\definecolor} 可以通过设定红(r)、绿(g)、蓝(b)分量定义颜色。例如
-通过 overlay,可将一些代码片段的排版结果作为 \type{\framed} 的背景。例如
+\startsample
+\definecolor[myred][r=.8,g=.2,b=.2]
+\framed{\myred 给你点 color see see!}
+\stopsample
+\simplesample[option=TEX]{\getsample}
-\starttyping[option=TEX]
-\defineoverlay
- [foo]
- [{\framed[width=3cm,frame=off,bottomframe=on]{}}]
-\midaligned{\inframed[background=foo,frame=off]{你好啊!}}
-\stoptyping
+\noindent 上述代码中可以让你你顺便又学会了另一种给文字增加外框的方法。
-\defineoverlay
- [foo]
- [{\framed[width=3cm,frame=off,bottomframe=on]{}}]
-\midaligned{\inframed[background=foo,frame=off]{你好啊!}}
-\blank
+亦可使用 \type{\colored} 直接设定 rgb 颜色对文字着色,以下代码与上例等效:
-通过上述示例,现在你应该能有有七八分明白 \in[item-sym-diy] 节中带圈数字是如何实现的了,其关键代码如下:
+\startsample
+\framed{\colored[r=.8,g=.2,b=.2]{给你点 color see see!}}
+\stopsample
+\typesample[option=TEX]
-\starttyping[option=TEX]
-\startuseMPgraphic{foo}
- path p;
- p := fullcircle scaled 12pt;
- draw p withpen pencircle scaled .4pt
- withcolor darkred;
-\stopuseMPgraphic
-\defineoverlay[rsquare][\useMPgraphic{foo}]
-\def\fooframe#1{%
- \inframed[frame=off,background=rsquare]{#1}%
-}
-\stoptyping
-\startuseMPgraphic{foo}
- path p;
- p := fullcircle scaled 12pt;
- draw p withpen pencircle scaled .4pt
- withcolor darkred;
-\stopuseMPgraphic
-\defineoverlay[rsquare][\useMPgraphic{foo}]
-\def\fooframe#1{%
- \inframed[frame=off,background=rsquare]{#1}%
-}
-\noindent 无非是将一个圆圈图形作为 \type{\inframed} 的背景罢了,而且对圈内的文字的长度有限制,字数略多一些,便出圈了,例如 \type{\fooframe{123}},结果为 \fooframe{123}。不过,只需对上述代码略加修改,
+\section{显示空格}
-\starttyping[option=TEX]
- p := fullcircle scaled \overlaywidth;
+\starttyping[escape=no,option=TEX]
+\starttyping[space=on]
+H E L L L O
\stoptyping
-\startuseMPgraphic{foo}
- path p;
- p := fullcircle scaled \overlaywidth;
- draw p withpen pencircle scaled .4pt
- withcolor darkred;
-\stopuseMPgraphic
-\defineoverlay[rsquare][\useMPgraphic{foo}]
-\def\fooframe#1{%
- \inframed[frame=off,background=rsquare]{#1}%
-}
-
-\noindent 便可解除该限制。技巧是,用 overlay 的实际宽度作为单位圆的放大倍数,故而可保证圆圈的直径即圈内文字的长度,例如 \type{\fooframe{我有一个大房子}},结果为 \fooframe{我有一个大房子}。
+\stoptyping
+\start
+\setuptyping
+ [before={\startframedtext[width=\textwidth]},
+ after={\stopframedtext}]
+\starttyping[space=on]
+H E L L L O
+\stoptyping
+\stop
-\section{盒子的深度}
+注意,\CONTEXT\ 中文断行需要 \type{\setscript[hanzi]},但该命令会吞噬汉字之间的空白字符,从而导致一个问题,在 \type{\type} 和 \type{typing} 环境中,汉字之间若存在空白字符,它们不会被输出到排版结果,此时,只有 \type{space=on} 可以救急。
-如果你仔细观察,\ConTeXt\ 盒子里的内容在水平方向是精确居中的,但是在并非如此。例如
+例如,以下 \type{typing} 环境未开启空格显示:
-\starttyping[option=TEX]
-\inframed{ajk\framed{我看到一棵樱桃树}}。
+\starttyping
+本 行 每 个 汉 字 之 后 都 有 空 格, 但 是 你 看 不 见 它, 除 非 space=on !
+\stoptyping
+\noindent 以下 \type{typing} 环境开启了空格显示:
+\starttyping[space=on]
+本 行 每 个 汉 字 之 后 都 有 空 格, 但 是 你 看 不 见 它, 除 非 space=on !
\stoptyping
-\noindent 结果为 \inframed{\framed{我看到一棵樱桃树}}。可见 \type{\inframed} 内部的 \type{\framed} 的底部有着看似多余的空白。使用盒子的参数 \type{depth} 可以消除这些空白,但问题在于这处空白从何而来及其高度是多少。该问题与底层 \TeX\ 的西文排版机制有关。
-
-首先,我们需要明白,西文排版,一行文字是有基线的,但基线并非位于该行文字的最底端,而是距最底端有一段较小的距离,否则所有西文字母都在同一条线上了。在上述示例中,\type{\framed} 的底线便是其外围的 \type{\inframed} 所在行的基线。西文字体在设计时,每个字形(Glyph)是有基线位置,因此在排版时可根据实际的基线位置对字形进行对齐。一行文字的基线到该行的最底端的这段距离称为深度。一行文字的基线到该行最顶端的这段距离称为高度。因此,一行文字的真正高度等于深度 + 高度;在 \ConTeXt\ 中,它等于我们使用 \type{\setupinterlinespace} 设定的尺寸。
+\section{定义}
-无论是 \TeX\ 还是 \ConTeXt\ 盒子,它们本身是没有深度的,但是当它们里面的文字或盒子有深度时,它们便有了深度。至于深度值具体是多大,可以借助 \TeX\ 的盒子寄存器进行测量。例如,定义一个盒子寄存器 box0:
+使用 \type{\definetype} 和 \type{\definetyping} 可定义专用的抄录环境。例如
\starttyping[option=TEX]
-\setbox0\hbox{\inframed{\framed{我看到一棵樱桃树}}}
+\starttyping[escape=yes,space=on,option=TEX]
+Hello /BTEX\darkred\CONTEXT/ETEX!
\stoptyping
-
-\noindent 现在我们有了一个 0 号盒子,使用 \type{\wd},\type{\ht} 和 \type{\dp} 可分别测量该盒子的宽度、高度和深度……顺便复习一下表格的用法:
-
-\starttyping[option=TEX]
-\placetable[force]{box0 的几何信息}{\tfx
- \starttabulate[|c|c|c|]
- \HL
- \NC 宽度 \NC 高度 \NC 深度 \NC\NR
- \HL
- \NC \the\wd0 \NC \the\ht0 \NC \the\dp0 \NC\NR
- \HL
- \stoptabulate
-}
\stoptyping
-\setbox0\hbox{\inframed{\framed{我看到一棵樱桃树}}}
-\setupcaption[table][location=top]
-\placetable[force]{box0 的几何信息}{\tfx
- \starttabulate[|c|c|c|]
- \HL
- \NC 宽度 \NC 高度 \NC 深度 \NC\NR
- \HL
- \NC \the\wd0 \NC \the\ht0 \NC \the\dp0 \NC\NR
- \HL
- \stoptabulate
-}
-将上述所得深度信息取负作为 \type{\inframed} 的参数 \type{depth} 的值,即
+\noindent 倘若每次使用该 \type{typing} 环境,可能会让你觉得繁琐,且增加了输入出错的风险,采用以下方法可予以简化:
\starttyping[option=TEX]
-\inframed[depth=-\dp0]{\framed{我看到一棵樱桃树}}
+\definetyping[foo][escape=yes,space=on,option=TEX]
+\startfoo
+Hello /BTEX\darkred\CONTEXT/ETEX!
+\stopfoo
\stoptyping
-\noindent 便可消除深度,结果为 \inframed[depth=-\dp0]{\framed{我看到一棵樱桃树}}。
\section{小结}
-\TeX\ 盒子是无形的。\ConTeXt\ 盒子是有形的。老子曾说过,恒无欲,以观其妙;恒有欲,以观其所徼。故而,\TeX\ 要懂一些,\ConTeXt\ 也要懂一些。
+五色使人目盲。即使 \CONTEXT\ 的代码着色功能未能支持你的程序代码,也许并不值得遗憾。也许真正值得遗憾的是,它未能激发你对 Lua 语言和 Lpeg 库的兴趣,而这正是 \CONTEXT\ 的代码着色功能支持的编程语言过少最重要的原因。 \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/11.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/11.tex
index 7b5d538b3e7..a98affcde7b 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/11.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/11.tex
@@ -1,810 +1,265 @@
-\chapter{学一点 \METAPOST}
+\chapter{盒子}
-想必你已迫不及待想学习 \METAPOST\ 了。这大概是来自人类上古基因的冲动。人类先学会的是绘画,而后才是文字。只是不要妄图通过这区区一章内容掌握 \METAPOST,因为关于它的全部内容,足够写一本至少三百多页的书籍了。不过,本章内容足以给你打开一扇窗户,让 \METAPOST\ 的优雅气息拂过时常过于严肃的 \ConTeXt\ 世界。
+在 \in[item-sym-diy] 节中,你已经见过盒子了,只是那时可能你还不知其究竟,本章将揭开它们的一些端倪。也有可能你早已钻研过 Knuth 的《The \TeX\ Book》,对盒子的研究之深已经让我望风而拜,但是未必熟悉 \ConTeXt\ 的盒子,故而本章仍有部分内容值得一睹。
-\section{作图环境}
+\section{\TeX\ 盒子}
-\METAPOST\ 是一种计算机作图语言,与 \TeX\ 一样,皆为宏编程语言。使用 \METAPOST\ 语言编写的代码可被 mpost 程序编译成 PS 格式的图形文件。自 \LuaTeX\ 开始,mpost 的核心功能集成到了 \LuaTeX\ 中,从此以后,在 \TeX\ 环境中使用 \METAPOST\ 语言作图便不需依赖外部程序了。
+前面已经多次暗示和明示,\TeX\ 系统是 \ConTeXt\ 的底层,二者的关系犹如引擎(发动机)和汽车的关系。对 \TeX\ 引擎丝毫不懂,并不影响你学习和使用 \ConTeXt\ 排版一份精致的文档,但是懂一些引擎层面工作原理,未必会有用处,但是你现在也并不能确定将来会不会成为一名 \TeX\ 黑客,如同你从前也从未想过有一天会学习 \ConTeXt。
-\ConTeXt\ 为 \METAPOST\ 代码提供了五种环境:
+在 \TeX\ 系统中,盒子是很重要的部件。例如,在 \ConTeXt\ 的排版的每一个段落,是一个竖向盒子,即 \type{\vbox},该盒子之内又有一些横向盒子,即 \type{\hbox},它们是段落的每一行。我们可以直接用这两种盒子构造一个不甚规整的段落:
-\starttyping
-\startMPcode ... \stopMPcode
-\startMPpage ... \stopMPpage
-\startuseMPgraphic{name} ... \stopuseMPgraphic
-\startuniqueMPgraphic{name} ... \stopuniqueMPgraphic
-\startreusableMPgraphic{name} ... \stopreusableMPgraphic
-\stoptyping
-
-\noindent 第一种环境用于临时作图,生成的图形会被插入到代码所在位置。第二种环境是生成单独的图形文件,以作其他用途。后面三种环境,生成的图形可根据环境的名称作为文章插图随处使用,但它们又有三种不同用途:
-
-\startitemize[nowhite]
-\item useMPgraphic:每被使用一次,对应的 \METAPOST\ 代码便会被重新编译一次。
-\item uniqueMPgraphic:只要图形所处环境不变,\METAPOST\ 代码只会被编译一次。
-\item reusableMPgraphic:无论如何使用,其 \METAPOST\ 只会被编译一次。
-\stopitemize
-
-\noindent 大多数情况下,建议选用 uniqueMPgraphic,但若图形中存在一些需要每次使用时都要有所变化的内容,可选用 useMPgraphic。
-
-另外需要注意,在 \ConTeXt\ 中使用 \METAPOST\ 时,通常会使用 \ConTeXt\ 定义的一些 \METAPOST\ 宏,这些宏构成的集合,名曰 \MetaFun。
-
-\section{画一个盒子}
-
-\METAPOST\ 作图语句遵守基本的英文语法,理解起来颇为简单。例如,用粗度为 2 pt 的圆头笔用暗红色绘制一条经过 $(0, 0)$,$(3\,{\rm cm}, 0)$,$(3\,{\rm cm}, 1\,{\rm cm})$,$(0, 1\,{\rm cm})$ 的封闭路径,
-
-\starttyping[option=MP]
-\startMPcode
-pickup pencircle scaled 2pt;
-draw (0, 0) -- (3cm, 0) -- (3cm, 1cm) -- (0, 1cm) -- cycle withcolor darkred;
-\stopMPcode
-\stoptyping
-\startMPcode
-pickup pencircle scaled 2pt;
-draw (0, 0) -- (3cm, 0) -- (3cm, 1cm) -- (0, 1cm) -- cycle withcolor darkred;
-\stopMPcode
-
-上述代码中,\type{(0, 0) -- ... -- cycle} 构造的是一条封闭路径,可将其保存于路径变量:
-
-\starttyping[option=MP]
-path p;
-p := (0, 0) -- (3cm, 0) -- (3cm, 1cm) -- (0, 1cm) -- cycle;
-pickup pencircle scaled 2pt;
-draw p withcolor darkred;
-\stoptyping
-
-将路径保存在变量中,是为了更便于对路径进行一些运算,例如
-
-\starttyping[option=MP]
-path p;
-p := (0, 0) -- (3cm, 0) -- (3cm, 1cm) -- (0, 1cm) -- cycle;
-pickup pencircle scaled 2pt;
-draw p withcolor darkred;
-draw p shifted (2cm, .5cm) withcolor darkblue;
-\stoptyping
-\startMPcode
-path p;
-p := (0, 0) -- (3cm, 0) -- (3cm, 1cm) -- (0, 1cm) -- cycle;
-pickup pencircle scaled 2pt;
-draw p withcolor darkred;
-draw p shifted (2cm, .5cm) withcolor darkblue;
-\stopMPcode
-\noindent 路径 \type{p} 被向右平移了 2 cm,继而被向上平移动了 0.5 cm。
-
-还有一种构造矩形路径的方法:先构造一个单位正方形,然后对其缩放。例如
-
-\starttyping[option=MP]
-pickup pencircle scaled 2pt;
-draw fullsquare xscaled 3cm yscaled 1cm withcolor darkred;
-\stoptyping
-\startMPcode
-pickup pencircle scaled 2pt;
-draw fullsquare xscaled 3cm yscaled 1cm withcolor darkred;
-\stopMPcode
-
-可以使用 \MetaFun\ 宏 \type{randomized} 对路径进行随机扰动。例如,对一个宽为 3 cm,高为 1cm 的矩形路径以幅度 2mm 的程度予以扰动:
-
-\starttyping[option=MP]
-\startuseMPgraphic{随机晃动的矩形}
-pickup pencircle scaled 2pt;
-draw (fullsquare xscaled 3cm yscaled 1cm) randomized 2mm withcolor darkred;
-\stopuseMPgraphic
-\useMPgraphic{随机晃动的矩形}
-\stoptyping
-\startuseMPgraphic{随机晃动的矩形}
-pickup pencircle scaled 2pt;
-draw (fullsquare xscaled 3cm yscaled 1cm) randomized 2mm withcolor darkred;
-\stopuseMPgraphic
-\useMPgraphic{随机晃动的矩形}
+\startsample
+\vbox{
+ \hbox{离离原上草}\hbox{一岁一枯荣}\hbox{野火烧不尽}\hbox{春风吹又生}
+}
+\stopsample
+\sample[option=TEX][todo-list]{竖向盒子和横向盒子}{\externalfigure[11/vbox-and-hbox.pdf]}
-还记得 overlay 吗?只要将上述 useMPgraphic 环境构造的图形制作为 overlay,便可将其作为 \type{\framed} 的背景,从而可以得到一种外观颇为别致的盒子。
+横向盒子可以指定它的长度,竖向盒子可以指定它的高度。例如,
-\starttyping
-\defineoverlay[晃晃][\useMPgraphic{随机晃动的矩形}]
-\framed[frame=off,background=晃晃]{光辉岁月}
+\starttyping[option=TEX]
+\hbox to 5cm {赋得古原草送别}
+\vbox to 3cm {
+ \hbox{离离原上草}\hbox{一岁一枯荣}\hbox{野火烧不尽}\hbox{春风吹又生}
+}
\stoptyping
-\defineoverlay[晃晃][\useMPgraphic{随机晃动的矩形}]
-\dontleavehmode\kern .25em\framed[frame=off,background=晃晃]{光辉岁月}
-在 \ConTeXt\ 为 \METAPOST\ 提供的作图环境里,可分别通过 \type{\overlaywidth} 和 \type{\overlayheight} 获得 overlay 的宽度和高度。在将 overlay 作为 \type{\framed} 的背景时,\type{\framed} 的宽度和高度便是 overlay 的宽度和高度。基于这一特性,便可实现 \METAPOST\ 绘制的图形能够自动适应 \type{\framed} 的宽度和高度的变化。例如
+在示例 \in[rsquare] 中,\type{\hbox} 用于包含一副使用 \METAPOST\ 语言绘制的矢量插图,关键代码如下:
-\starttyping[option=MP]
-\startuseMPgraphic{新的随机晃动的矩形}
-path p;
-p := fullsquare xscaled \overlaywidth yscaled \overlayheight;
-pickup pencircle scaled 2pt;
-draw p randomized 2mm withcolor darkred;
+\starttyping[option=TEX]
+\startuseMPgraphic{foo}
+... ... ...
\stopuseMPgraphic
-
-\defineoverlay[新的晃晃][\useMPgraphic{新的随机晃动的矩形}]
-\framed
- [frame=off,background=新的晃晃]
- {今天只有残留的躯壳,迎接光辉岁月,风雨中抱紧自由。}
+\lower.2ex\hbox{\useMPgraphic{foo}}
\stoptyping
-\startuseMPgraphic{新的随机晃动的矩形}
-path p;
-p := fullsquare xscaled \overlaywidth yscaled \overlayheight;
-pickup pencircle scaled 2pt;
-draw p randomized 2mm withcolor darkred;
-\stopuseMPgraphic
-
-\defineoverlay[新的晃晃][\useMPgraphic{新的随机晃动的矩形}]
-\framed[frame=off,background=新的晃晃]{今天只有残留的躯壳,迎接光辉岁月,风雨中抱紧自由。}
+\noindent 其中 \type{useMPgraphic} 环境中的 \METAPOST\ 代码会被 \type{\useMPgraphic{foo}} 提交给 \TeX\ 引擎。\TeX\ 引擎会调用 metapost 程序将 \METAPOST\ 代码编译成 PDF 格式的图片,然后交给 \ConTeXt。最后由 \ConTeXt\ 将图片插入到 \type{\useMPgraphic{foo}} 所在的横向盒子里。\type{\lower .2ex} 可令位于其后的横向盒子下沉 0.2 ex。长度单位 ex 类似于 em,也是一个相对尺寸,它是当前所用字体中的字母 x 对应的字形的高度。从现在开始要记住,横向距离用 em,竖向距离用 ex,不过这只是建议,并非 \TeX\ 世界的法律。
-对于需要重复使用的盒子,为了避免每次重复设置其样式,可以将它定义为专用盒子。例如
+还有一种横向盒子 \type{\line},它的宽度是当前段落的宽度,可让其中的文字向两边伸展并与边界对齐,例如
\starttyping[option=TEX]
-\defineframed[funnybox][frame=off,background=新的晃晃]
-\funnybox{今天只有残留的躯壳,迎接光辉岁月,风雨中抱紧自由。}
-\stoptyping
-
-\METAPOST\ 可以为一条封闭路径填充颜色。在此需要明确,何为封闭路径。例如
-
-\starttyping[option=MP]
-path p, q, r;
-p := (0, 0) -- (1, 0) -- (1, 1) -- (0, 0) -- (0, 0);
-q := (0, 0) -- (1, 0) -- (1, 1) -- (0, 0) -- cycle;
-r := fullsquare;
-\stoptyping
-
-\noindent 其中路径 \type{p} 的终点的坐标恰好是其起点,但它并非封闭路径,而路径 \type{q} 和 \type{r} 皆为封闭路径。下面示例,为封闭路径填充颜色:
-
-\starttyping[option=MP]
-path p;
-p := (fullsquare xscaled 3cm yscaled 1cm) randomized 2mm;
-pickup pencircle scaled 2pt;
-fill p withcolor gray;
-draw p withcolor darkred;
+\line{\darkred\bf 我能吞下玻璃而不伤身体。}
\stoptyping
-\startMPcode
-path p;
-p := (fullsquare xscaled 3cm yscaled 1cm) randomized 2mm;
-pickup pencircle scaled 2pt;
-fill p withcolor darkgray;
-draw p withcolor darkred;
-\stopMPcode
-\noindent 注意,对于封闭路径,应当先填充颜色,再绘制路径,否则所填充的颜色会覆盖一部分路径线条。
-
-\section{颜色}
-
-\METAPOST\ 以含有三个分量的向量表示颜色。向量的三个分量分别表示红色、绿色和蓝色,取值范围为 [0, 1],例如 \type{(0.4, 0.5, 0.6)}。可将颜色保存到 color 类型的变量中,以备绘图中重复使用。例如定义一个值为暗红色的颜色变量:
-
-\starttyping[option=MP]
-color foo;
-foo := (0.3, 0, 0);
-\stoptyping
-
-由于 METAPOST 内部已经定义了用于表示红色的变量 \type{red},因此 \type{foo} 的定义也可写为
+\line{\darkred\bf 我能吞下玻璃而不伤身体。}
-\starttyping[option=MP]
-color foo;
-foo := 0.3 * red;
-\stoptyping
+看到上述示例,想必你想起了之前我们曾在文章标题的样式设定时,用 \type{{middle,broad}} 抑制的 \ConTeXt\ 触发汉字间隙的伸长特性,该特性与\type{\line} 的效果非常相似。
-\noindent 小于 1 的倍数,可以忽略前缀 0,且可以直接作用于颜色:
+使用 \type{\hfill} 或 \type{\hss} 可对横向盒子里的内容进行挤压。例如
-\starttyping[option=MP]
-foo := .3red;
-\stoptyping
+\starttyping[option=TEX]
+\line{\hfill 我能吞下玻璃而不伤身体。}
+\line{我能吞下玻璃而不伤身体。\hfill}
+\line{\hfill 我能吞下玻璃而不伤身体。\hfill}
+\line{\hss 我能吞下玻璃而不伤身体。}
+\line{我能吞下玻璃而不伤身体。\hss}
+\line{\hss 我能吞下玻璃而不伤身体。\hss}
+\stoptyping
+
+\blueframed{
+ \vbox{
+ \line{\hfill 我能吞下玻璃而不伤身体。}
+ \line{我能吞下玻璃而不伤身体。\hfill}
+ \line{\hfill 我能吞下玻璃而不伤身体。\hfill}
+ \line{\hss 我能吞下玻璃而不伤身体。}
+ \line{我能吞下玻璃而不伤身体。\hss}
+ \line{\hss 我能吞下玻璃而不伤身体。\hss}
+ }
+}
-使用 \type{transparent} 宏可用于构造带有透明度的颜色值。例如
+\type{\hfill} 和 \type{\hss},都是可无限伸缩的粘连,还有一个伸缩能力弱于 \type{\hfill} 的 \type{\hfil}。竖向的可无限伸缩的粘连有 \type{\vfil},\type{\vfill} 和 \type{\vss}。
-\starttyping[option=MP]
-path p; p := fullsquare scaled 1cm;
-color foo; foo := .3red;
-pickup pencircle scaled 4pt;
-draw p withcolor transparent (1, 0.3, foo);
-draw p shifted (.5cm, .5cm) withcolor transparent (1, 0.25, blue);
-\stoptyping
-\startMPcode
-path p; p := fullsquare scaled 1cm;
-color foo; foo := .3red;
-pickup pencircle scaled 4pt;
-draw p withcolor transparent (1, 0.3, foo);
-draw p shifted (.5cm, .5cm) withcolor transparent (1, 0.25, blue);
-\stopMPcode
-\noindent \type{transparent} 的第一个参数表示选用的颜色透明方法,共有 12 种方法可选:
-
-\startitemize[n,packed,columns,four]
-\item normal
-\item multiply
-\item screen
-\item overlay
-\item softlight
-\item hardlight
-\item colordodge
-\item colorburn
-\item darken
-\item lighten
-\item difference
-\item exclusion
-\stopitemize
-\noindent 第二个参数表示透明度,取值范围 [0, 1],其值越大,透明程度越低。第三个参数为颜色值。需要注意的是,\METAPOST\ 并不支持以 \type{color} 类型的变量保存带透明度的颜色值,而且 \METAPOST\ 里也没有与之对应的变量类型。
-
-\section{文字}
-
-使用 \MetaFun\ 宏 \type{textext} 可在 \METAPOST\ 图形中插入文字,且基于 \METAPOST\ 图形变换命令可对文字进行定位、缩放、旋转。例如
-
-\starttyping[option=MP]
-string s; % 字符串类型变量
-s = "\color[darkred]{\bf 江山如此多娇}";
-draw textext(s);
-draw textext(s) shifted (4cm, 0);
-draw textext(s) scaled 1.5 shifted (8cm, 0) ;
-draw textext(s) scaled 1.5 rotated 45 shifted (12cm, 0);
-\stoptyping
-\startMPcode
-string s; s = "\color[darkred]{\bf 江山如此多娇}";
-draw textext(s);
-draw thetextext(s, (4cm, 0));
-draw textext(s) scaled 1.5 shifted (8cm, 0) ;
-draw textext(s) scaled 1.5 rotated 45 shifted (12cm, 0);
-\stopMPcode
-
-也可使用 \type{\thetextext} 宏直接对文字进行定位,从而可省去 \type{shifted} 变换。例如
-
-\starttyping
-string s; s = "{\bf 江山如此多娇}";
-draw (0, 0) withpen pensquare scaled 11pt withcolor darkred;
-draw textext(s, (4cm, 0)) withcolor darkred;
-\stoptyping
-\startMPcode
-string s; s = "{\bf 江山如此多娇}";
-draw (0, 0) withpen pensquare scaled 12pt withcolor darkred;
-draw thetextext(s, (4cm, 0)) withcolor darkred;
-\stopMPcode
+\section{\ConTeXt\ 盒子}
-\section{方向路径}
+在 \ConTeXt\ 层面,通常很少使用 \TeX\ 盒子,而是使用 \type{\inframed} 和 \type{\framed}——前者是后者的特例。与 \TeX\ 盒子相比,\ConTeXt\ 层面的盒子可以显示边框,且有非常多的参数可以定制它们的外观。
-\METAPOST\ 宏 \type{drawarrow} 可绘制带箭头的路径。例如
+\type{\inframed} 用于正文,可用于给一行文字增加边框,例如
-\starttyping[option=MP]
-path p; p := (0, 0) -- (4cm, 0) -- (4cm, 2cm) -- (0, 2cm) -- (0, 1cm);
-pickup pencircle scaled 2pt;
-drawarrow p withcolor darkred;
-drawarrow p shifted (6cm, 0) dashed (evenly scaled .5mm) withcolor darkred;
-\stoptyping
-\startMPcode
-path p; p := (0, 0) -- (4cm, 0) -- (4cm, 2cm) -- (0, 2cm) -- (0, 1cm);
-pickup pencircle scaled 2pt;
-drawarrow p withcolor darkred;
-drawarrow p shifted (6cm, 0) dashed (evenly scaled .5mm) withcolor darkred;
-\stopMPcode
-
-\noindent 上述代码也给出了虚线路径的画法。
-
-\METAPOST\ 的任何一条路径,从起点到终点可基于取值范围为 [0, 1] 的参数选择该路径上的某一点。基于该功能可实现路径标注。例如选择路径参数 0.5 对应的点,在该点右侧放置 \ConTeXt\ 旋转 90 度的文字:
-
-\starttyping[option=MP]
-path p; p := (0, 0) -- (4cm, 0) -- (4cm, 2cm) -- (0, 2cm) -- (0, 1cm);
-pair pos; pos := point .5 along p;
-pickup pencircle scaled 2pt;
-drawarrow p withcolor darkred;
-draw pos withpen pensquare scaled 4pt withcolor darkgreen;
-draw thetextext.rt("\rotate[rotation=-90]{路过}", pos shifted (1mm, 0));
-\stoptyping
-\startMPcode
-path p; p := (0, 0) -- (4cm, 0) -- (4cm, 2cm) -- (0, 2cm) -- (0, 1cm);
-pair pos; pos := point .5 along p;
-pickup pencircle scaled 2pt;
-drawarrow p withcolor darkred;
-draw pos withpen pensquare scaled 4pt withcolor darkgreen;
-draw thetextext.rt("\rotate[rotation=-90]{路过}", pos shifted (1mm, 0));
-\stopMPcode
-
-\noindent 上述代码中出现了 \type{thetextext} 的后缀形式。除了默认形式,\type{thetextext} 还有 4 种后缀形式,后缀名为 \inframed{\type{.lft}},\inframed{\type{.top}},\inframed{\type{.rt}} 和 \inframed{\type{.bot}},分别表示将文字放在指定位置的左侧、上方、右侧和下方。
-
-\section{画面}
-
-\METAPOST\ 有一种变量类型 \type{picture},可将其用于将一组绘图语句合并为一个图形,然后予以绘制。使用 \METAPOST\ 宏 \type{image} 可构造 \type{picture} 实例。例如
-
-\starttyping[option=MP]
-path a; a := fullsquare xscaled 4cm yscaled 1cm;
-picture p; p := image(fill a withcolor darkgray;
- draw a withpen pencircle scaled 2pt withcolor darkblue;);
-draw p;
-\stoptyping
-\startMPcode
-path a; a := fullsquare xscaled 4cm yscaled 1cm;
-picture p; p := image(fill a withcolor darkgray;
- draw a withpen pencircle scaled 2pt withcolor darkblue;);
-draw p;
-\stopMPcode
-
-使用 \METAPOST\ 宏 \type{center} 可以获得 \type{picture} 实例的中心坐标,结果可保存于一个 \type{pair} 类型的变量。例如
-
-\starttyping[option=MP]
-picture p; p := image(draw textext("密云不雨,自我西郊"););
-pair c; c := center p;
-draw c withpen pensquare scaled 4pt withcolor darkred;
-draw p withcolor darkblue;
-\stoptyping
-\startMPcode
-picture p; p := image(draw textext("密云不雨,自我西郊"););
-pair c; c := center p;
-draw c withpen pensquare scaled 4pt withcolor darkred;
-draw p withcolor darkblue;
-\stopMPcode
-
-使用 \MetaFun\ 宏 \type{bbwidth} 和 \type{bbheight} 可以获得 \type{picture} 实例的宽度和高度。使用这两个宏,可为任何图形和文字构造边框。例如
-
-\starttyping[option=MP]
-picture p; p := image(draw textext("归妹愆期,迟归有时"));
-numeric w, h; w := bbwidth(p); h := bbheight(p);
-path q; q := fullsquare xscaled w yscaled h;
-\stoptyping
-\starttyping[option=MP]
-fill q withcolor darkgray;
-draw q withpen pencircle scaled 2pt withcolor darkred;
-draw p;
-\stoptyping
-\startMPcode
-picture p; p := image(draw textext("归妹愆期,迟归有时"));
-numeric w, h; w := bbwidth(p); h := bbheight(p);
-path q; q := fullsquare xscaled w yscaled h;
-fill q withcolor darkgray;
-draw q withpen pencircle scaled 2pt withcolor darkred;
-draw p;
-\stopMPcode
-
-上述实例为文字构造的边框太紧了,综合利用现有所学,让它宽松一些并不困难:
-
-\starttyping[option=MP]
-picture p; p := image(draw textext("归妹愆期,迟归有时"));
-numeric w, h; w := bbwidth(p); h := bbheight(p);
-numeric offset; offset := 5mm;
-path q;
-q := fullsquare xscaled (w + offset) yscaled (h + offset) shifted center p;
-
-fill q withcolor darkgray;
-draw q withpen pencircle scaled 2pt withcolor darkred;
-draw p;
-\stoptyping
-\startMPcode
-picture p; p := image(draw textext("归妹愆期,迟归有时"));
-numeric w, h; w := bbwidth(p); h := bbheight(p);
-numeric offset; offset := 5mm;
-path q; q := fullsquare xscaled (w + offset) yscaled (h + offset) shifted center p;
-fill q withcolor darkgray;
-draw q withpen pencircle scaled 2pt withcolor darkred;
-draw p;
-\stopMPcode
-
-\section[macro]{宏}
-
-定义一个宏,令其接受一个字符串类型的参数,返回一个矩形框,并令文字居于矩形框中心:
-
-\starttyping[option=MP]
-vardef framed (expr text, offset) =
- picture p; p := image(draw textext(text));
- numeric w, h; w := bbwidth(p); h := bbheight(p);
- path q;
- q := fullsquare xscaled (w + offset) yscaled (h + offset) shifted center p;
- image(fill q withcolor lightgray;
- draw q withpen pencircle scaled 2pt withcolor darkred;
- draw p;)
-enddef;
+\starttyping[option=TEX]
+\type{\inframed{\type{\inframed{...}}}}
\stoptyping
-\noindent 使用上述定义的宏:
+\noindent 结果为 \inframed{\type{\inframed{...}}}。倘若使用 \type{\framed},例如
-\starttyping[option=MP]
-draw framed("{\bf 亢龙有悔}", 5mm);
-\stoptyping
-\startMPcode
-vardef framed (expr text, offset) =
- picture p; p := image(draw textext(text));
- numeric w, h; w := bbwidth(p); h := bbheight(p);
- path q;
- q := fullsquare xscaled (w + offset) yscaled (h + offset) shifted center p;
- image(fill q withcolor lightgray;
- draw q withpen pencircle scaled 2pt withcolor darkred;
- draw p;)
-enddef;
-draw framed("{\bf 亢龙有悔}", 5mm);
-\stopMPcode
-
-\METAPOST\ 的 \type{vardef} 用于定义一个有返回值的宏,宏定义的最后一条语句即返回值,该条语句不可以分号作为结尾。\METAPOST\ 还有其他几种宏定义形式,但是对于大多数作图任务而言,\type{vardef} 已足够应付。
-
-\section[sec:flow-chart]{画一幅简单的流程图}
-
-现在,请跟随我敲击键盘的手指,逐步画一幅描述数字求和过程的流程图,希望这次旅程能让你对 \METAPOST\ 的基本语法有一些全面的认识。
-
-首先,构造一个结点,表示数据输入“”
-
-\starttyping[option=MP]
-string f; f := "\framed[frame=off,align=center]";
-picture a;
-a := image(
- % 符号 & 用于拼接两个字符串
- draw textext(f & "{$i\leftarrow 1$\\$s\leftarrow 0$}");
-);
+\starttyping[option=TEX]
+\type{\framed{\type{\framed{...}}}}
\stoptyping
-然后,用 \in[macro] 节定义的 \type{framed} 宏构造两个运算过程结点:
-
-\starttyping[option=MP]
-numeric offset; offset := 5mm;
-picture b; b := framed(f & "{$s\leftarrow s + i$}", offset);
-picture c; c := framed(f & "{$i\leftarrow i + 1$}", offset);
-\stoptyping
+\noindent 结果为 \framed{\type{\framed{...}}}。可以发现,\type{\inframed} 更适合在正文中使用,因为它能与文字基线对齐。事实上,\type{\inframed} 与 \type{\framed[location=low]} 等效,故而前者是后者的特例。例如
-还需要定义一个宏,用它构造菱形的条件判断结点:
-
-\starttyping[option=MP]
-vardef diamond (expr text, offset) =
- picture p; p := image(draw textext(text));
- numeric w, h; w := bbwidth(p); h := bbheight(p);
- path q;
- q := fulldiamond xscaled (w + offset) yscaled (h + offset) shifted center p;
- image(fill q withcolor darkgray;
- draw q withpen pencircle scaled 2pt withcolor darkred;
- draw p withcolor white;)
-enddef;
-picture d; d := diamond(f & "{$i > 100$}", 3 * offset);
+\starttyping[option=TEX]
+\framed[location=low]{\type{\framed[location=low]{...}}}
\stoptyping
-最后,再构造一个结点表示程序输出:
-
-\starttyping[option=MP]
-picture e;
-e := image(draw textext(f & "{$s$}"););
-\stoptyping
+\noindent 结果为 \framed[location=low]{\type{\framed[location=low]{...}}}。
-保持结点 \type{a} 不动,对 \type{b},\type{c},\type{d} 和 \type{e} 进行定位:
+如果不希望 \type{\framed} 显示边框,只需 \type{\framed[frame=off]{...}},也可以单独显示某条边线,并设定边线粗度和颜色:
-\starttyping[option=MP]
-b := b shifted (0, -2cm);
-c := c shifted (4cm, -4.5cm);
-d := d shifted (0, -4.5cm);
-e := e shifted (0, -7cm);
+\starttyping[option=TEX]
+\line{
+ \framed[frame=off,leftframe=on,rulethickness=4pt,framecolor=red]{foo}
+ \framed[frame=off,topframe=on,rulethickness=4pt,framecolor=green]{foo}
+ \framed[frame=off,rightframe=on,rulethickness=4pt,framecolor=blue]{foo}
+ \framed[frame=off,bottomframe=on,rulethickness=4pt,framecolor=magenta]{foo}
+}
\stoptyping
+\line{
+ \framed[frame=off,leftframe=on,rulethickness=4pt,framecolor=red]{foo}
+ \framed[frame=off,topframe=on,rulethickness=4pt,framecolor=green]{foo}
+ \framed[frame=off,rightframe=on,rulethickness=4pt,framecolor=blue]{foo}
+ \framed[frame=off,bottomframe=on,rulethickness=4pt,framecolor=magenta]{foo}
+}
-现在可以画出所有结点了,即
-
-\starttyping[option=MP]
-draw a; draw b; draw c; draw d; draw e;
-\stoptyping
-\midaligned{\externalfigure[11-flowchart-1.pdf]}
\blank
-现在开始构造连接各结点的路径。首先构造结点 \type{a} 的底部中点到 \type{b} 的顶部中点的路径:
-
-\starttyping[option=MP]
-path ab;
-ab := .5[llcorner a, lrcorner a] -- .5[ulcorner b, urcorner b];
-\stoptyping
-
-\noindent 其中 \type{llcorner} 用于获取路径或画面实例的最小包围盒的左下角顶点坐标。同理,\type{ulcorner},\type{urcorner} 和 \type{lrcorner} 分别获取包围盒的左上角、右上角和右下角顶点坐标。\type{.5[..., ...]} 用于计算两个点连线的中点。
+可以设定盒子的宽度和高度,例如宽 10cm,高 2 cm 的盒子:
-用类似的方法可以构造其他连接各结点的路径:
-
-\starttyping[option=MP]
-path bd;
-bd := .5[llcorner b, lrcorner b] -- .5[ulcorner d, urcorner d];
-path dc;
-dc := .5[lrcorner d, urcorner d] -- .5[ulcorner c, llcorner c];
-path cb;
-cb := .5[ulcorner c, urcorner c] -- (4cm, -2cm) -- .5[urcorner b, lrcorner b];
-path de;
-de := .5[llcorner d, lrcorner d] -- .5[ulcorner e, urcorner e];
+\starttyping[option=TEX]
+\hbox to \textwidth{\hfill\framed[width=10cm,height=2cm]{foo}\hfill}
\stoptyping
+\hbox to \textwidth{\hfill\framed[width=10cm,height=2cm]{foo}\hfill}
-画出所有路径:
-
-\starttyping[option=MP]
-drawarrow ab withcolor darkred; drawarrow bd withcolor darkred;
-drawarrow cb withcolor darkred; drawarrow dc withcolor darkred;
-drawarrow de withcolor darkred;
-\stoptyping
-\midaligned{\externalfigure[11-flowchart-2.pdf]}
-\blank
+\section{对齐}
-最后一步,路径标注:
+\ConTeXt\ 盒子的内容默认居中,即 \type{align=center},此外还有 8 种对齐方式:
-\starttyping[option=MP]
-pair no; no := point .4 along dc;
-pair yes; yes := point .5 along de;
-draw thetextext.top("否", no);
-draw thetextext.rt("是", yes);
-\stoptyping
-\midaligned{\externalfigure[11-flowchart-3.pdf]}
-
-\section{代码简化}
-
-\in[sec:flow-chart] 节中用于绘制程序流程图的代码存在许多重复。我们可以尝试使用条件、循环,宏等形式对代码进行简化,但我对它们给出的讲解并不会细致,为的正是走马观花,观其大略。
-
-首先,观察宏 \type{framed} 和 \type{diamond} 的定义,发现二者仅有的不同是前者用 \type{fullsquare} 绘制盒子,后者用 \type{fulldiamond}。因此,可以重新定义一个更为灵活的宏,用于制作结点:
-
-\starttyping[option=MP]
-vardef make_node(expr text, shape, offset) =
- picture p; p := image(draw textext(text));
- numeric w, h; w := bbwidth(p); h := bbheight(p);
- if path shape:
- path q;
- q := shape xysized (w + offset, h + offset) shifted center p;
- image(fill q withcolor lightgray;
- draw q withpen pencircle scaled 2pt withcolor darkred;
- draw p;)
- else:
- image(draw p;)
- fi
-enddef;
+\starttyping[option=TEX]
+\line{
+ \setupframed[width=1.95cm,height=1.95cm]
+ \framed[align={flushleft,high}]{A}
+ \framed[align={middle,high}]{A}
+ \framed[align={flushright,high}]{A}
+ \framed[align={flushright,lohi}]{A}
+ \framed[align={flushright,low}]{A}
+ \framed[align={middle,low}]{A}
+ \framed[align={flushleft,low}]{A}
+ \framed[align={flushleft,lohi}]{A}
+}
\stoptyping
+\line{
+ \setupframed[width=1.95cm,height=1.95cm]
+ \framed[align={flushleft,high}]{A}
+ \framed[align={middle,high}]{A}
+ \framed[align={flushright,high}]{A}
+ \framed[align={flushright,lohi}]{A}
+ \framed[align={flushright,low}]{A}
+ \framed[align={middle,low}]{A}
+ \framed[align={flushleft,low}]{A}
+ \framed[align={flushleft,lohi}]{A}
+}
-\noindent 由于上述代码使用了 \METAPOST\ 的条件判断语法,以 \type{path shape} 判断 \type{shape} 是否为路径变量,从而使得 \type{make_node} 能构用于构造有无边框和有边框的结点:
-
-\starttyping[option=MP]
-numeric offset; offset := 5mm;
-string f; f := "\framed[frame=off,align=center]";
-picture a, b, c, d, e;
-a := make_node(f & "{$i\leftarrow 1$\\$s\leftarrow 0$}", none, 0);
-b := make_node(f & "{$s\leftarrow s + i$}", fullsquare, offset);
-c := make_node(f & "{$i\leftarrow i + 1$}", fullsquare, offset);
-d := make_node(f & "{$i > 100$}", fulldiamond, offset);
-e := make_node(f & "{$s$}", none, 0);
-\stoptyping
+\type{\setupframed} 所作的设定会影响到其后的所有 \type{\framed},但是不会影响到其所处编组\footnote{还记得 \TeX\ 编组吗?即 \type[escape=no]{{...}}。}之外的 \type{\framed}。
-在 \type{vardef} 宏中使用条件语句时需要注意,通常情况下不要条件结束语句 \type{fi} 后面添加分号,否则 \type{vardef} 宏的返回值会带上这个分号。在其他情境下,通常需要在 \type{fi} 加分号。还要注意,我在 \type{make_node} 宏中使用 \type{xysized} 取代了之前的 \type{xscale} 和 \type{yscale},可直接指定路径或画面的尺寸。之所以如此,是因为我们无法确定 \type{make_node} 宏的第 2 个参数对应的路径是否为标准图形。
+\section{背景}
-在绘制结点和路径时,存在重复使用 \type{draw} 语句的情况,例如
+可将颜色作为 \type{\framed} 的背景。例如
-\starttyping[option=MP]
-drawarrow ab withcolor darkred;
-drawarrow bd withcolor darkred;
-drawarrow cb withcolor darkred;
-drawarrow dc withcolor darkred;
-drawarrow de withcolor darkred;
+\starttyping[option=TEX]
+\inframed
+ [background=color,
+ backgroundcolor=lightgray,
+ width=2cm,
+ frame=off]{\bf foo}
\stoptyping
-\noindent 可使用循环语句予以简化:
-
-\starttyping[option=MP]
-for i = ab, bd, cb, dc, de:
- draw i withcolor darkred;
-endfor;
-\stoptyping
+\noindent 结果为 \inframed[background=color,backgroundcolor=lightgray,width=2cm,frame=off]{\bf foo}。
-为了便于获得路径或画面的包围盒的四边中点,定义以下宏:
+通过 overlay,可将一些代码片段的排版结果作为 \type{\framed} 的背景。例如
-\starttyping[option=MP]
-vardef left(expr p) = .5[llcorner p, ulcorner p] enddef;
-vardef top(expr p) = .5[ulcorner p, urcorner p] enddef;
-vardef right(expr p) = .5[lrcorner p, urcorner p] enddef;
-vardef bottom(expr p) = .5[llcorner p, lrcorner p] enddef;
+\starttyping[option=TEX]
+\defineoverlay
+ [foo]
+ [{\framed[width=3cm,frame=off,bottomframe=on]{}}]
+\midaligned{\inframed[background=foo,frame=off]{你好啊!}}
\stoptyping
-\noindent 以绘制结点 \type{b} 的四边中点为测试用例
-
-\starttyping[option=MP]
-for i = left(b), top(b), right(b), bottom(b):
- draw i withpen pensquare scaled 4pt withcolor darkblue;
-endfor;
-\stoptyping
-\leftaligned{\externalfigure[11-flowchart-4.pdf]}
+\defineoverlay
+ [foo]
+ [{\framed[width=3cm,frame=off,bottomframe=on]{}}]
+\midaligned{\inframed[background=foo,frame=off]{你好啊!}}
\blank
-基于上述宏,可以更为简洁地构造连接各结点的路径:
-
-\starttyping[option=MP]
-path ab; ab := bottom(a) -- top(b);
-path bd; bd := bottom(b) -- top(d);
-path dc; dc := right(d) -- left(c);
-path cb; cb := top(c) -- (xpart center c, ypart center b) -- right(b);
-path de; de := bottom(d) -- top(e);
-\stoptyping
-
-\noindent \type{center} 是 \METAPOST\ 宏,可用于获取路径或画面的包围盒中心点坐标。\type{xpart} 和 \type{ypart} 也皆为 \METAPOST\ 宏,用于获取点的坐标分量。
-
-路径标注也可以通过定义一个宏予以简化:
-
-\starttyping[option=MP]
-vardef tag(expr p, text, pos, loc) =
- if loc = "left":
- thetextext.lft(text, point pos along p)
- elseif loc = "right":
- thetextext.rt(text, point pos along p)
- elseif loc = "top":
- thetextext.top(text, point pos along p)
- elseif loc = "bottom":
- thetextext.bot(text, point pos along p)
- else
- thetextext(text, point pos along p)
- fi
-enddef;
-\stoptyping
-
-\noindent 其用法为
-
-\starttyping[option=MP]
-draw tag(dc, "否", .5, "top");
-draw tag(de, "是", .5, "right");
-\stoptyping
-
-
-\section{层层叠叠}
-
-\ConTeXt\ 有一个以 overlay 为基础的层(Layer)机制。利用层机制,我们可将 \METAPOST\ 图形绘制在页面上的任何一个位置。在学习层之前,我们需要对 overlay 的认识再加深一些。
-
-\subsection{overlay}
-
-实际上 overlay 环境是一个图形「栈」。通过它,可实现图形(包括文字)的叠加。例如,对于以下 \METAPOST\ 图形:
-
-\starttyping[option=MP]
-\startuseMPgraphic{一个矩形}
-path p; p := fullsquare xscaled 4cm yscaled 1cm;
-draw p randomized 3mm
- withcolor transparent (1, .5 randomized .3, red)
- withpen pencircle scaled 2pt;
-\stopuseMPgraphic
-\stoptyping
-
-\noindent 上述代码中,\type{transparent (1, .5 randomized .3, red)} 用于构造在一定程度上不确定透明度的红色,透明度在 [0.2, 0.8] 之间,亦即 \type{randomized} 不仅可作用于路径,也可作用于数字或颜色值。由于上述 \METAPOST\ 图形环境包含着随机内容,将其作为插图,在一个 overlay 中多次使用,每次使用都会产生不同的结果,在 overlay 中它们会被叠加到一起:
+通过上述示例,现在你应该能有有七八分明白 \in[item-sym-diy] 节中带圈数字是如何实现的了,其关键代码如下:
\starttyping[option=TEX]
-\startoverlay
- {\useMPgraphic{一个矩形}}
- {\useMPgraphic{一个矩形}}
- {\useMPgraphic{一个矩形}}
-\stopoverlay
+\startuseMPgraphic{foo}
+ path p;
+ p := fullcircle scaled 12pt;
+ draw p withpen pencircle scaled .4pt
+ withcolor darkred;
+\stopuseMPgraphic
+\defineoverlay[rsquare][\useMPgraphic{foo}]
+\def\fooframe#1{%
+ \inframed[frame=off,background=rsquare]{#1}%
+}
\stoptyping
-\startuseMPgraphic{一个矩形}
-path p; p := fullsquare xscaled 4cm yscaled 1cm;
-draw p randomized 3mm
- withcolor transparent (0, .5 randomized .25, red)
- withpen pencircle scaled 2pt;
+\startuseMPgraphic{foo}
+ path p;
+ p := fullcircle scaled 12pt;
+ draw p withpen pencircle scaled .4pt
+ withcolor darkred;
\stopuseMPgraphic
-\startoverlay
- {\useMPgraphic{一个矩形}}
- {\useMPgraphic{一个矩形}}
- {\useMPgraphic{一个矩形}}
-\stopoverlay
-
-之前在为 \type{\framed} 定义 overlay 时,overlay 中只有单个图形,亦即我们并未充分利用 overlay 的特性。以下代码定义的 \type{\framed} 的背景便包含了三个叠加的 overlay:
+\defineoverlay[rsquare][\useMPgraphic{foo}]
+\def\fooframe#1{%
+ \inframed[frame=off,background=rsquare]{#1}%
+}
+\noindent 无非是将一个圆圈图形作为 \type{\inframed} 的背景罢了,而且对圈内的文字的长度有限制,字数略多一些,便出圈了,例如 \type{\fooframe{123}},结果为 \fooframe{123}。不过,只需对上述代码略加修改,
\starttyping[option=TEX]
-\defineoverlay
- [叠叠]
- [\startoverlay
- {\useMPgraphic{一个矩形}} {\useMPgraphic{一个矩形}} {\useMPgraphic{一个矩形}}
- \stopoverlay]
-\stoptyping
-\starttyping[option=TEX]
-\defineframed[foo][frame=off,background={叠叠}]
-\foo{迎接光辉岁月}
+ p := fullcircle scaled \overlaywidth;
\stoptyping
-\defineoverlay
- [叠叠]
- [\startoverlay
- {\useMPgraphic{一个矩形}}
- {\useMPgraphic{一个矩形}}
- {\useMPgraphic{一个矩形}}
- \stopoverlay]
-\defineframed[foo][frame=off,background={叠叠}]
-\dontleavehmode\kern .25em\foo{迎接光辉岁月}
-
-\type{\framed} 的也可以将多个 overlay 作为背景,以下代码与上例等效:
+\startuseMPgraphic{foo}
+ path p;
+ p := fullcircle scaled \overlaywidth;
+ draw p withpen pencircle scaled .4pt
+ withcolor darkred;
+\stopuseMPgraphic
+\defineoverlay[rsquare][\useMPgraphic{foo}]
+\def\fooframe#1{%
+ \inframed[frame=off,background=rsquare]{#1}%
+}
-\starttyping[option=TEX]
-\defineoverlay[叠叠-1]{\useMPgraphic{一个矩形}}
-\defineoverlay[叠叠-2]{\useMPgraphic{一个矩形}}
-\defineoverlay[叠叠-3]{\useMPgraphic{一个矩形}}
-\defineframed[foo][frame=off,background={叠叠-1,重叠-2,重叠-3}]
-\foo{迎接光辉岁月}
-\stoptyping
+\noindent 便可解除该限制。技巧是,用 overlay 的实际宽度作为单位圆的放大倍数,故而可保证圆圈的直径即圈内文字的长度,例如 \type{\fooframe{我有一个大房子}},结果为 \fooframe{我有一个大房子}。
-\noindent 这意味着,\type{\framed} 的背景,本质上也是一个 overlay。
+\section{盒子的深度}
-基于 overlay,也可为文档设置水印。例如,若在 \type{\starttext} 之前添加以下代码:
+如果你仔细观察,\ConTeXt\ 盒子里的内容在水平方向是精确居中的,但是在并非如此。例如
\starttyping[option=TEX]
-\startuseMPgraphic{square}
-path p; p := fullsquare xscaled 4cm yscaled 1cm;
-draw p randomized 3mm
- withcolor transparent (1, .5 randomized .3, red)
- withpen pencircle scaled 2pt;
-\stopuseMPgraphic
-\defineoverlay[watermark][\useMPgraphic{square}]
-\setupbackgrounds[page][background=watermark]
+\inframed{ajk\framed{我看到一棵樱桃树}}。
\stoptyping
-\midaligned{\externalfigure[11-watermark.png][width=.6\textwidth]}
-\subsection[layer]{层}
+\noindent 结果为 \inframed{\framed{我看到一棵樱桃树}}。可见 \type{\inframed} 内部的 \type{\framed} 的底部有着看似多余的空白。使用盒子的参数 \type{depth} 可以消除这些空白,但问题在于这处空白从何而来及其高度是多少。该问题与底层 \TeX\ 的西文排版机制有关。
-\ConTeXt\ 的层,本质上是一个可作为全页背景的 overlay,可使用绝对坐标或相对坐标对排版元素在页面上定位放置。例如,定义一个层 foo,在三个不同位置分别放置一幅 \METAPOST\ 图形,并将其作用于当前页面:
+首先,我们需要明白,西文排版,一行文字是有基线的,但基线并非位于该行文字的最底端,而是距最底端有一段较小的距离,否则所有西文字母都在同一条线上了。在上述示例中,\type{\framed} 的底线便是其外围的 \type{\inframed} 所在行的基线。西文字体在设计时,每个字形(Glyph)是有基线位置,因此在排版时可根据实际的基线位置对字形进行对齐。一行文字的基线到该行的最底端的这段距离称为深度。一行文字的基线到该行最顶端的这段距离称为高度。因此,一行文字的真正高度等于深度 + 高度;在 \ConTeXt\ 中,它等于我们使用 \type{\setupinterlinespace} 设定的尺寸。
-\starttyping[option=TEX]
-\definelayer[foo]
-\setlayer[foo][x=0cm,y=0cm]{\useMPgraphic{一个矩形}}
-\setlayer[foo][x=6cm,y=1cm]{\useMPgraphic{一个矩形}}
-\stoptyping
-\starttyping[option=TEX]
-\setlayer
- [foo]
- [x=\textwidth,y=2cm,hoffset=-4cm,vhoffset=-.5cm]{\useMPgraphic{一个矩形}}
-\flushlayer[foo]
-\stoptyping
-\definelayer[test]
-\setlayer[test][x=0cm,y=0cm]{\useMPgraphic{一个矩形}}
-\setlayer[test][x=6cm,y=1cm]{\useMPgraphic{一个矩形}}
-\setlayer
- [test]
- [x=\textwidth,y=2cm,hoffset=-4cm,voffset=-3cm]{\useMPgraphic{一个矩形}}
-\flushlayer[test]
-\noindent 上述代码定义的层 foo,其坐标原点是层被投放的位置,亦即在本行文字的左上角。$x$ 坐标向右递增,$y$ 坐标向下递增。
-\definelayer[foo]
-\setlayer[foo][x=0cm,y=0cm]{\useMPgraphic{circle}}
-\setlayer[foo][preset=rightbottom]{\useMPgraphic{circle}}
-\setupbackgrounds[page][background=foo]
-
-如果将层的宽度和高度分别设为页面的宽度和高度,并将其设为页面背景,则坐标原点在页面的左上角,且可使用一些预定义位置投放内容。例如以下代码可在当前页面的左上角和右下角位置各放一个圆圈:
+无论是 \TeX\ 还是 \ConTeXt\ 盒子,它们本身是没有深度的,但是当它们里面的文字或盒子有深度时,它们便有了深度。至于深度值具体是多大,可以借助 \TeX\ 的盒子寄存器进行测量。例如,定义一个盒子寄存器 box0:
\starttyping[option=TEX]
-\startuniqueMPgraphic{circle}
-draw fullcircle scaled 2cm withpen pencircle scaled 2pt withcolor darkgreen;
-\stopuniqueMPgraphic
-\definelayer[foo][width=\paperwidth,height=\paperheight]
-\setlayer[foo][x=0cm,y=0cm]{\uniqueMPgraphic{circle}}
-\setlayer[foo][preset=rightbottom]{\uniqueMPgraphic{circle}}
-\setupbackgrounds[page][background=foo]
+\setbox0\hbox{\inframed{\framed{我看到一棵樱桃树}}}
\stoptyping
-\startuniqueMPgraphic{circle}
-draw fullcircle scaled 2cm withpen pencircle scaled 2pt withcolor darkgreen;
-\stopuniqueMPgraphic
-\definelayer[foo][width=\paperwidth,height=\paperheight]
-\setlayer[foo][x=0cm,y=0cm]{\uniqueMPgraphic{circle}}
-\setlayer[foo][preset=rightbottom]{\uniqueMPgraphic{circle}}
-\setupbackgrounds[page][background=foo]
-
-\noindent 需要注意的是,层被使用一次后,便会被清空,因而将其作为页面背景,仅对当前页有效。
+\setbox0\hbox{\inframed{\framed{我看到一棵樱桃树}}}
-通过 \type{preset} 参数可调整层的坐标原点和坐标方向。在上述代码中,\type{rightbottom} 可将层的坐标原点定位于层的右下角,同时 $x$ 坐标方向变为向左递增,$y$ 坐标方向变为向上递增。
+\noindent 现在我们有了一个 0 号盒子,使用 \type{\wd},\type{\ht} 和 \type{\dp} 可分别测量该盒子的宽度、高度和深度……顺便复习一下表格的用法:
-\ConTeXt\ 预定义的 \type{preset} 参数值有
+\startsample
+\starttabulate[|c|c|c|]
+\HL
+\NC 宽度 \NC 高度 \NC 深度 \NC\NR
+\HL
+\NC \the\wd0 \NC \the\ht0 \NC \the\dp0 \NC\NR
+\HL
+\stoptabulate
+\stopsample
+\simplesample[option=TEX]{\getsample}
-\startitemize[packed,columns,five]
-\item lefttop\item righttop\item leftbottom\item rightbottom\item middle\item middletop
-\item middlebottom\item middleleft\item middleright\item lefttopleft\item lefttopright
-\stopitemize
+将上述所得深度信息取负作为 \type{\inframed} 的参数 \type{depth} 的值,即
-\noindent 使用这些参数值时,要注意坐标方向。例如,若 \type{preset=middleright},其 $x$ 坐标方向变为向左递增,而 $y$ 坐标方向依然保持向上递增,以下代码可予以验证:
-
-\starttyping[option=TEX]
-\definelayer[bar][width=\paperwidth,height=\paperheight]
-\setlayer[bar][preset=middleright]{
- \startMPcode
- draw (0, 0) withpen pensquare scaled 12pt withcolor darkred;
- \stopMPcode
-}
-\stoptyping
\starttyping[option=TEX]
-\setlayer[bar][preset=middleright,x=2cm,y=2cm]{
- \startMPcode
- draw (0, 0) withpen pensquare scaled 12pt
- withcolor transparent (1, .3, darkred);
- \stopMPcode
-}
-\setupbackgrounds[page][background=bar]
+\inframed[depth=-\dp0]{\framed{我看到一棵樱桃树}}
\stoptyping
-\definelayer[bar][width=\paperwidth,height=\paperheight]
-\setlayer[bar][preset=middleright]{
- \startMPcode
- draw (0, 0) withpen pensquare scaled 12pt withcolor darkred;
- \stopMPcode
-}
-\setlayer[bar][preset=middleright,x=2cm,y=2cm]{
- \startMPcode
- draw (0, 0) withpen pensquare scaled 12pt
- withcolor transparent (1, .3, darkred);
- \stopMPcode
-}
-\setupbackgrounds[page][background=bar]
+\noindent 便可消除深度,结果为 \inframed[depth=-\dp0]{\framed{我看到一棵樱桃树}}。
\section{小结}
-也许你意犹未尽,甚至觉得我语焉不详。切莫怪我,我原本仅仅是介绍如何使用 \METAPOST\ 绘制一个边框受随机扰动的盒子。不过,在大致掌握了本章所述的内容的基础上,关于 \METAPOST\ 更多的知识,特别本章所有你觉得语焉不详之处,皆可阅读它的手册\cite[mpman]以增进认识。此外,\ConTeXt\ 开发者 Hans Hagen 所写的 \MetaFun\ 手册除了讲述 \MetaFun\ 之外也大量介绍了 \METAPOST\ 的基本知识和技巧,该手册在你的 \ConTeXt\ 系统中,使用以下命令查找:
-
-\starttyping
-$ mtxrun --script base --search metafun-s.pdf
-\stoptyping \ No newline at end of file
+\TeX\ 盒子是无形的。\ConTeXt\ 盒子是有形的。老子曾说过,恒无欲,以观其妙;恒有欲,以观其所徼。故而,\TeX\ 要懂一些,\ConTeXt\ 也要懂一些。
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/12.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/12.tex
index cbbc82666f9..4ea4987933c 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/12.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/12.tex
@@ -1,280 +1,724 @@
-\chapter{幻灯片}
+\chapter{学一点 \METAPOST}
-现在你已经领略甚至可能全部掌握了 \ConTeXt\ 常用的的排版元素,若不使用它们而是依然使用 Microsoft PowerPoint 制作幻灯片甚为可惜。如果你已决意使用 \ConTeXt\ 制作幻灯片,你会发现,你几乎不需要再学习多少新的 \ConTeXt\ 命令便可随心所欲地制作清新质朴的幻灯片了。
+想必你已迫不及待想学习 \METAPOST\ 了。这大概是来自人类上古基因的冲动。人类先学会的是绘画,而后才是文字。只是不要妄图通过这区区一章内容掌握 \METAPOST,因为关于它的全部内容,足够写一本至少三百多页的书籍了。不过,本章内容足以给你打开一扇窗户,让 \METAPOST\ 的优雅气息拂过时常过于严肃的 \ConTeXt\ 世界。
-\section{纸面尺寸}
+\section{作图环境}
-纸面尺寸是每一页的打印尺寸。至此为止,本文档之前所有的示例,在 \type{TEXpage} 环境里的,纸面尺寸取决于文档内容的多少,而在 \type{text} 环境里的,纸面尺寸默认是 A4,即 $21\,{\rm cm}\times 29.7\,{\rm cm}$,如果你需要将该尺寸换成 A5,只需在样式文件中作以下设定
+\METAPOST\ 是一种计算机作图语言,与 \TeX\ 一样,皆为宏编程语言。使用 \METAPOST\ 语言编写的代码可被 mpost 程序编译成 PS 格式的图形文件。自 \LuaTeX\ 开始,mpost 的核心功能集成到了 \LuaTeX\ 中,从此以后,在 \TeX\ 环境中使用 \METAPOST\ 语言作图便不需依赖外部程序了。
-\starttyping[option=TEX]
-\setuppapersize[A5]
+\ConTeXt\ 为 \METAPOST\ 代码提供了五种环境:
+
+\starttyping
+\startMPcode ... \stopMPcode
+\startMPpage ... \stopMPpage
+\startuseMPgraphic{name} ... \stopuseMPgraphic
+\startuniqueMPgraphic{name} ... \stopuniqueMPgraphic
+\startreusableMPgraphic{name} ... \stopreusableMPgraphic
\stoptyping
-制作幻灯片通常不需要太大的纸面尺寸。\ConTeXt\ 提供了 S4 尺寸($400\,{\rm pt}\times 300\,{\rm pt}$),可将其作为幻灯片的纸面尺寸。也可以自己定义纸面尺寸并使用,例如
+\noindent 第一种环境用于临时作图,生成的图形会被插入到代码所在位置。第二种环境是生成单独的图形文件,以作其他用途。后面三种环境,生成的图形可根据环境的名称作为文章插图随处使用,但它们又有三种不同用途:
-\starttyping[option=TEX]
-\definepapersize[foo][width=640pt,height=480pt]
-\setuppapersize[foo]
+\startitemize[nowhite]
+\item useMPgraphic:每被使用一次,对应的 \METAPOST\ 代码便会被重新编译一次。
+\item uniqueMPgraphic:只要图形所处环境不变,\METAPOST\ 代码只会被编译一次。
+\item reusableMPgraphic:无论如何使用,其 \METAPOST\ 只会被编译一次。
+\stopitemize
+
+\noindent 大多数情况下,建议选用 uniqueMPgraphic,但若图形中存在一些需要每次使用时都要有所变化的内容,可选用 useMPgraphic。
+
+另外需要注意,在 \ConTeXt\ 中使用 \METAPOST\ 时,通常会使用 \ConTeXt\ 定义的一些 \METAPOST\ 宏,这些宏构成的集合,名曰 \MetaFun。
+
+\section{画一个盒子}
+
+\METAPOST\ 作图语句遵守基本的英文语法,理解起来颇为简单。例如,用粗度为 2 pt 的圆头笔用暗红色绘制一条经过 $(0, 0)$,$(3\,{\rm cm}, 0)$,$(3\,{\rm cm}, 1\,{\rm cm})$,$(0, 1\,{\rm cm})$ 的封闭路径,
+
+\startsample
+\startMPcode
+pickup pencircle scaled 2pt;
+draw (0, 0) -- (3cm, 0) -- (3cm, 1cm)
+ -- (0, 1cm) -- cycle withcolor darkred;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\noindent 上述代码中,\type{(0, 0) -- ... -- cycle} 构造的是一条封闭路径,可将其保存于路径变量:
+
+\starttyping[option=MP]
+path p;
+p := (0, 0) -- (3cm, 0) -- (3cm, 1cm) -- (0, 1cm) -- cycle;
+pickup pencircle scaled 2pt;
+draw p withcolor darkred;
\stoptyping
-实际上,纸面尺寸仅对排版结果的打印很重要,倘若只是在计算机(或投影仪)屏幕上观看排版结果,我们总是可以通过调整正文字体大小去应对过大或过小的纸面尺寸,但是纸面尺寸的宽高比例,对于屏幕非常重要。通常,幻灯片的宽高比应当与屏幕的分辨率相适应为最佳。例如,我的屏幕分辨率是 $1600\times 900$,那么我要制作的幻灯片页面的宽高比也应当是 $16:9$,故而纸面尺寸可设定为
+\noindent 将路径保存在变量中,是为了更便于对路径进行一些运算,例如
+
+\startsample
+\startMPcode
+path p;
+p := (0, 0) -- (3cm, 0)
+ -- (3cm, 1cm) -- (0, 1cm) -- cycle;
+pickup pencircle scaled 2pt;
+draw p withcolor darkred;
+draw p shifted (2cm, .5cm) withcolor darkblue;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\noindent 路径 \type{p} 被向右平移了 2 cm,继而被向上平移动了 0.5 cm。
+
+还有一种构造矩形路径的方法:先构造一个单位正方形,然后对其缩放。例如
+
+\startsample
+\startMPcode
+pickup pencircle scaled 2pt;
+draw fullsquare xscaled 3cm yscaled 1cm
+ withcolor darkred;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\MetaFun\ 宏 \type{randomized} 可用于对路径随机扰动。例如,对一个宽为 3 cm,高为 1cm 的矩形路径以幅度 2mm 的程度予以扰动:
+
+\startsample
+\startuseMPgraphic{随机晃动的矩形}
+pickup pencircle scaled 2pt;
+draw (fullsquare xscaled 3cm yscaled 1cm)
+ randomized 2mm withcolor darkred;
+\stopuseMPgraphic
+\useMPgraphic{随机晃动的矩形}
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+还记得 overlay 吗?只要将上述 useMPgraphic 环境构造的图形制作为 overlay,便可将其作为 \type{\framed} 的背景,从而可以得到一种外观颇为别致的盒子。
+
+\startsample
+\defineoverlay[晃晃][\useMPgraphic{随机晃动的矩形}]
+\framed[frame=off,background=晃晃,width=3cm]{光辉岁月}
+\stopsample
+\simplesample[option=TEX]{\getsample}
+
+在 \ConTeXt\ 为 \METAPOST\ 提供的作图环境里,可分别通过 \type{\overlaywidth} 和 \type{\overlayheight} 获得 overlay 的宽度和高度。在将 overlay 作为 \type{\framed} 的背景时,\type{\framed} 的宽度和高度便是 overlay 的宽度和高度。基于这一特性,便可实现 \METAPOST\ 绘制的图形能够自动适应 \type{\framed} 的宽度和高度的变化。例如
+
+\startsample
+\startuseMPgraphic{新的随机晃动的矩形}
+path p;
+p := fullsquare xscaled \overlaywidth yscaled \overlayheight;
+pickup pencircle scaled 2pt;
+draw p randomized 2mm withcolor darkred;
+\stopuseMPgraphic
+
+\defineoverlay[新的晃晃][\useMPgraphic{新的随机晃动的矩形}]
+\framed
+ [frame=off,background=新的晃晃]
+ {今天只有残留的躯壳,迎接光辉岁月,风雨中抱紧自由。}
+\stopsample
+\typesample[option=MP]
+\midaligned{\getsample}
+
+对于需要重复使用的盒子,为了避免每次重复设置其样式,可以将它定义为专用盒子。例如
\starttyping[option=TEX]
-\definepapersize[foo][width=640pt,height=360pt]
-\setuppapersize[foo]
+\defineframed[funnybox][frame=off,background=新的晃晃]
+\funnybox{今天只有残留的躯壳,迎接光辉岁月,风雨中抱紧自由。}
\stoptyping
-现在,我们可以制作幻灯片的最原始的形式:
+\METAPOST\ 可以为一条封闭路径填充颜色。在此需要明确,何为封闭路径。例如
-\starttyping[option=TEX]
-\usemodule[visual]
-\definepapersize[foo][width=640pt,height=360pt]
-\setuppapersize[foo]
-\starttext
-\title{\fakewords{3}{5}}
-\fakewords{50}{100}
-\stoptext
+\starttyping[option=MP]
+path p, q, r;
+p := (0, 0) -- (1, 0) -- (1, 1) -- (0, 0) -- (0, 0);
+q := (0, 0) -- (1, 0) -- (1, 1) -- (0, 0) -- cycle;
+r := fullsquare;
\stoptyping
-\midaligned{\externalfigure[12-slides-1.pdf][width=.6\textwidth,frame=on]}
-\section{页面布局}
+\noindent 其中路径 \type{p} 的终点的坐标恰好是其起点,但它并非封闭路径,而路径 \type{q} 和 \type{r} 皆为封闭路径。下面示例,为封闭路径填充颜色:
-在 \type{text} 环境之前添加以下代码
+\startsample
+\startMPcode
+path p;
+p := (fullsquare xscaled 3cm yscaled 1cm) randomized 2mm;
+pickup pencircle scaled 2pt;
+fill p withcolor darkgray;
+draw p withcolor darkred;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
-\starttyping[option=TEX]
-\showframe
-\stoptyping
+\noindent 注意,对于封闭路径,应当先填充颜色,再绘制路径,否则所填充的颜色会覆盖一部分路径线条。
-\noindent 可在页面上显示当前的页面布局,结果如图 \in[12-layout-1] 所示。可根据图 \in[ConTeXt-layout] 理解页面布局中各区域名称和尺寸参数名称。
+\section{颜色}
-\placefigure[here][12-layout-1]{\ConTeXt\ 默认的页面布局}{\externalfigure[12-layout-1.pdf][width=.6\textwidth]}
+\METAPOST\ 以含有三个分量的向量表示颜色。向量的三个分量分别表示红色、绿色和蓝色,取值范围为 [0, 1],例如 \type{(0.4, 0.5, 0.6)}。可将颜色保存到 color 类型的变量中,以备绘图中重复使用。例如定义一个值为暗红色的颜色变量:
-\placefigure[here][ConTeXt-layout]{页面布局注解}{\externalfigure[ConTeXt-layout.svg][width=.8\textwidth]}
+\starttyping[option=MP]
+color foo;
+foo := (0.3, 0, 0);
+\stoptyping
-使用 \type{\setlayout} 可对各区域尺寸进行调整,例如让版心居中,即图 \in[ConTeXt-layout] 所示的 \type{width} 和 \type{textheight} 确定的区域居中,因为在默认情况下,它有些偏左。我们已经知道,页面的横向尺寸是 640 pt,按照以下设定便可将问题解决:
+由于 METAPOST 内部已经定义了用于表示红色的变量 \type{red},因此 \type{foo} 的定义也可写为
-\starttyping[option=TEX]
-\setuplayout
- [leftedge=0pt,leftedgedistance=0pt,
- leftmargin=80pt,leftmargindistance=10pt,
- backspace=90pt,
- rightedge=0pt,rightedgedistance=0pt,
- rightmargin=80pt,rightmargindistance=10pt,
- width=460pt]
+\starttyping[option=MP]
+color foo;
+foo := 0.3 * red;
\stoptyping
-\noindent 上述设定,实现了页面布局中页面总宽度值 640 pt 的分配,但是要注意一点,\type{backspace} 的值等于 4 个以 \type{left} 为前缀的参数值之和,虽然在设定了它的各个分量后,但 \ConTeXt\ 在遇到默认的 \type{backspace} 值与实际的 \type{left...} 参数值之和不符时,会根据 \type{backspace} 值进行页面布局。倘若我们不关心 \type{left...} 参数,即 \ConTeXt\ 默认对页面左侧留白区域默认如何分配,仅需要让 \ConTeXt\ 知道 \type{backspace=90pt},则上述代码可简化为
+\noindent 小于 1 的倍数,可以忽略前缀 0,且可以直接作用于颜色:
-\starttyping[option=TEX]
-\setuplayout
- [backspace=90pt,
- rightedge=0pt,rightedgedistance=0pt,
- rightmargin=80pt,rightmargindistance=10pt,
- width=460pt]
+\starttyping[option=MP]
+foo := .3red;
\stoptyping
-\noindent 还可以进一步简化,因为 \ConTeXt\ 对 \type{rightedge} 和 \type{rightedgedistance} 赋予的默认值原本就是 0,因此有
+使用 \type{transparent} 宏可用于构造带有透明度的颜色值。例如
+
+\startsample
+\startMPcode
+path p; p := fullsquare scaled 1cm;
+color foo; foo := .3red;
+pickup pencircle scaled 4pt;
+draw p withcolor transparent (1, 0.3, foo);
+draw p shifted (.5cm, .5cm) withcolor transparent (1, 0.25, blue);
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\noindent \type{transparent} 的第一个参数表示选用的颜色透明方法,共有 12 种方法可选:
+
+\startitemize[n,packed,columns,four]
+\item normal
+\item multiply
+\item screen
+\item overlay
+\item softlight
+\item hardlight
+\item colordodge
+\item colorburn
+\item darken
+\item lighten
+\item difference
+\item exclusion
+\stopitemize
+\noindent 第二个参数表示透明度,取值范围 [0, 1],其值越大,透明程度越低。第三个参数为颜色值。需要注意的是,\METAPOST\ 并不支持以 \type{color} 类型的变量保存带透明度的颜色值,而且 \METAPOST\ 里也没有与之对应的变量类型。
+
+\section{文字}
+
+使用 \MetaFun\ 宏 \type{textext} 可在 \METAPOST\ 图形中插入文字,且基于 \METAPOST\ 图形变换命令可对文字进行定位、缩放、旋转。例如
+
+\startsample
+\startMPcode
+string s; % 字符串类型变量
+s = "\color[darkred]{\bf 江山如此多娇}";
+draw textext(s);
+draw textext(s) shifted (4cm, 0);
+draw textext(s) scaled 1.5 shifted (8cm, 0) ;
+draw textext(s) scaled 1.5 rotated 45 shifted (12cm, 0);
+\stopMPcode
+\stopsample
+\typesample[option=MP]
+\midaligned{\getsample}
+
+也可使用 \type{\thetextext} 宏直接对文字进行定位,从而可省去 \type{shifted} 变换。例如
+
+\startsample
+\startMPcode
+string s; s = "{\bf 江山如此多娇}";
+draw (0, 0) withpen pensquare scaled 11pt withcolor darkred;
+draw thetextext(s, (4cm, 0)) withcolor darkred;
+\stopMPcode
+\stopsample
+\typesample[option=MP]
+\getsample
+
+\section{方向路径}
+
+\METAPOST\ 宏 \type{drawarrow} 可绘制带箭头的路径。例如
+
+\startsample
+\startMPcode
+path p; p := (0, 0) -- (4cm, 0) -- (4cm, 2cm) -- (0, 2cm) -- (0, 1cm);
+pickup pencircle scaled 2pt;
+drawarrow p withcolor darkred;
+drawarrow p shifted (6cm, 0) dashed (evenly scaled .5mm) withcolor darkred;
+\stopMPcode
+\stopsample
+\typesample[option=MP]
+\midaligned{\getsample}
+
+\noindent 上述代码也给出了虚线路径的画法。
+
+\METAPOST\ 的任何一条路径,从起点到终点可基于取值范围为 [0, 1] 的参数选择该路径上的某一点。基于该功能可实现路径标注。例如选择路径参数 0.5 对应的点,在该点右侧放置 \ConTeXt\ 旋转 90 度的文字:
+
+\startsample
+\startMPcode
+path p; p := (0, 0) -- (4cm, 0)
+ -- (4cm, 2cm) -- (0, 2cm) -- (0, 1cm);
+pair pos; pos := point .5 along p;
+pickup pencircle scaled 2pt;
+drawarrow p withcolor darkred;
+draw pos withpen pensquare scaled 4pt
+ withcolor darkgreen;
+draw thetextext.rt("\rotate[rotation=-90]{路过}",
+ pos shifted (1mm, 0));
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\noindent 上述代码中出现了 \type{thetextext} 的后缀形式。除了默认形式,\type{thetextext} 还有 4 种后缀形式,后缀名为 \inframed{\type{.lft}},\inframed{\type{.top}},\inframed{\type{.rt}} 和 \inframed{\type{.bot}},分别表示将文字放在指定位置的左侧、上方、右侧和下方。
+
+\section{画面}
+
+\METAPOST\ 有一种变量类型 \type{picture},可将其用于将一组绘图语句合并为一个图形,然后予以绘制。使用 \METAPOST\ 宏 \type{image} 可构造 \type{picture} 实例。例如
+
+\startsample
+\startMPcode
+path a; a := fullsquare xscaled 4cm yscaled 1cm;
+picture p; p := image(
+ fill a withcolor darkgray;
+ draw a withpen pencircle scaled 2pt withcolor darkblue;
+);
+draw p;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+使用 \METAPOST\ 宏 \type{center} 可以获得 \type{picture} 实例的中心坐标,结果可保存于一个 \type{pair} 类型的变量。例如
+
+\startsample
+\startMPcode
+picture p; p := image(draw textext("密云不雨,自我西郊"););
+pair c; c := center p;
+draw c withpen pensquare scaled 4pt withcolor darkred;
+draw p withcolor darkblue;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+使用 \MetaFun\ 宏 \type{bbwidth} 和 \type{bbheight} 可以获得 \type{picture} 实例的宽度和高度。使用这两个宏,可为任何图形和文字构造边框。例如
+
+\startsample
+\startMPcode
+picture p; p := image(draw textext("归妹愆期,迟归有时"));
+numeric w, h; w := bbwidth(p); h := bbheight(p);
+path q; q := fullsquare xscaled w yscaled h;
+fill q withcolor darkgray;
+draw q withpen pencircle scaled 2pt withcolor darkred;
+draw p;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\noindent 上述实例为文字构造的边框太紧了,利用现有所学,让它宽松一些并不困难:
+
+\startsample
+\startMPcode
+picture p; p := image(draw textext("归妹愆期,迟归有时"));
+numeric w, h; w := bbwidth(p); h := bbheight(p);
+numeric offset; offset := 5mm;
+path q;
+q := fullsquare xscaled (w + offset)
+ yscaled (h + offset)
+ shifted center p;
+fill q withcolor darkgray;
+draw q withpen pencircle scaled 2pt withcolor darkred;
+draw p;
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\section[macro]{宏}
+
+定义一个宏,令其接受一个字符串类型的参数,返回一个矩形框,并令文字居于矩形框中心:
+
+\startsample
+\startMPcode
+vardef framed (expr text, offset) =
+ picture p; p := image(draw textext(text));
+ numeric w, h; w := bbwidth(p); h := bbheight(p);
+ path q;
+ q := fullsquare xscaled (w + offset) yscaled (h + offset) shifted center p;
+ image(fill q withcolor lightgray;
+ draw q withpen pencircle scaled 2pt withcolor darkred;
+ draw p;)
+enddef;
+draw framed("{\bf 亢龙有悔}", 5mm);
+\stopMPcode
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\METAPOST\ 的 \type{vardef} 用于定义一个有返回值的宏,宏定义的最后一条语句即返回值,该条语句不可以分号作为结尾。\METAPOST\ 还有其他几种宏定义形式,但是对于大多数作图任务而言,\type{vardef} 已足够应付。
+
+\section[sec:flow-chart]{画一幅简单的流程图}
+
+现在,请跟随我敲击键盘的手指,逐步画一幅描述数字求和过程的流程图,希望这次旅程能让你对 \METAPOST\ 的基本语法有一些全面的认识。
+
+首先,构造一个结点,表示数据输入“”
-\starttyping[option=TEX]
-\setuplayout
- [backspace=90pt,
- rightmargin=80pt,rightmargindistance=10pt,
- width=460pt]
+\starttyping[option=MP]
+string f; f := "\framed[frame=off,align=center]";
+picture a;
+a := image(
+ % 符号 & 用于拼接两个字符串
+ draw textext(f & "{$i\leftarrow 1$\\$s\leftarrow 0$}");
+);
\stoptyping
-如果我们只关心版心的横向居中问题,并不关心左右留白区域的尺寸,最为简单的布局方式是
+然后,用 \in[macro] 节定义的 \type{framed} 宏构造两个运算过程结点:
-\starttyping[option=TEX]
-\setuplayout[width=middle]
+\starttyping[option=MP]
+numeric offset; offset := 5mm;
+picture b; b := framed(f & "{$s\leftarrow s + i$}", offset);
+picture c; c := framed(f & "{$i\leftarrow i + 1$}", offset);
\stoptyping
-以上设置的是页面横向布局。对于纵向布局,存在与 \type{backspace} 类似的问题,即 \type{topspace} 的设定。\type{tospace} 的值是 \type{top} + \type{topdistance},但是在 \type{\setuplayout} 中只对后者进行设定是无效的,必须先设定 \type{tospace},然后再将其值分配给 \type{top} 和 \type{topdistance},或让 \ConTeXt\ 自动分配。
+还需要定义一个宏,用它构造菱形的条件判断结点:
-对于页面纵向布局参数,我要去掉页面顶部和底部留白,只需作以下设定
+\starttyping[option=MP]
+vardef diamond (expr text, offset) =
+ picture p; p := image(draw textext(text));
+ numeric w, h; w := bbwidth(p); h := bbheight(p);
+ path q;
+ q := fulldiamond xscaled (w + offset) yscaled (h + offset) shifted center p;
+ image(fill q withcolor darkgray;
+ draw q withpen pencircle scaled 2pt withcolor darkred;
+ draw p withcolor white;)
+enddef;
+picture d; d := diamond(f & "{$i > 100$}", 3 * offset);
+\stoptyping
-\starttyping[option=TEX]
-topspace=0pt,height=middle,bottom=0pt
+最后,再构造一个结点表示程序输出:
+
+\starttyping[option=MP]
+picture e;
+e := image(draw textext(f & "{$s$}"););
\stoptyping
-\noindent 现在全部的页面布局设定如下:
+保持结点 \type{a} 不动,对 \type{b},\type{c},\type{d} 和 \type{e} 进行定位:
-\starttyping[option=TEX]
-\setuplayout[width=middle,topspace=0pt,height=middle,footer=40pt]
+\starttyping[option=MP]
+b := b shifted (0, -2cm);
+c := c shifted (4cm, -4.5cm);
+d := d shifted (0, -4.5cm);
+e := e shifted (0, -7cm);
\stoptyping
-完成页面布局设定后,别忘记去掉 \type{text} 环境之前的 \type{\showframe} 语句。此外,我建议你在 \type{text} 环境里动手试验一番 \type{\showlayout}。
+现在可以画出所有结点了,即
-\section[slide-fonts]{字体}
+\starttyping[option=MP]
+draw a; draw b; draw c; draw d; draw e;
+\stoptyping
+\midaligned{\externalfigure[12/flowchart-1.pdf][frame=on]}
+\blank
-在 \ConTeXt\ 使用汉字字体,对此估计你已经颇为熟悉了。在幻灯片中,我使用以下字体:
+现在开始构造连接各结点的路径。首先构造结点 \type{a} 的底部中点到 \type{b} 的顶部中点的路径:
-\starttyping[option=TEX]
-\definefallbackfamily
- [myfonts][ss][latinmodernsans][range={0x0000-0x0400},force=yes]
-\definefontfamily[myfonts][ss][simhei][bf=simhei,it=kaiti,bi=simhei]
-\setscript[hanzi]
-\setupbodyfont[myfonts,ss,16pt]
+\starttyping[option=MP]
+path ab;
+ab := .5[llcorner a, lrcorner a] -- .5[ulcorner b, urcorner b];
\stoptyping
-\noindent 上述字体设定并不完整,尚未设定衬线字族和等宽字族,这些待需要时再予以设定。
+\noindent 其中 \type{llcorner} 用于获取路径或画面实例的最小包围盒的左下角顶点坐标。同理,\type{ulcorner},\type{urcorner} 和 \type{lrcorner} 分别获取包围盒的左上角、右上角和右下角顶点坐标。\type{.5[..., ...]} 用于计算两个点连线的中点。
-\section[regular-style]{常规样式}
+用类似的方法可以构造其他连接各结点的路径:
+
+\starttyping[option=MP]
+path bd;
+bd := .5[llcorner b, lrcorner b] -- .5[ulcorner d, urcorner d];
+path dc;
+dc := .5[lrcorner d, urcorner d] -- .5[ulcorner c, llcorner c];
+path cb;
+cb := .5[ulcorner c, urcorner c] -- (4cm, -2cm) -- .5[urcorner b, lrcorner b];
+path de;
+de := .5[llcorner d, lrcorner d] -- .5[ulcorner e, urcorner e];
+\stoptyping
-首先,消除 \ConTeXt\ 默认在页面顶部设置的页码:
+画出所有路径:
-\starttyping[option=TEX]
-\setuppagenumbering[location=]
+\starttyping[option=MP]
+drawarrow ab withcolor darkred; drawarrow bd withcolor darkred;
+drawarrow cb withcolor darkred; drawarrow dc withcolor darkred;
+drawarrow de withcolor darkred;
\stoptyping
+\midaligned{\externalfigure[12/flowchart-2.pdf][frame=on]}
+\blank
-\noindent 幻灯片通常不需要页码,即使需要页码,默认的页码出现的位置和字号皆不合适。
+最后一步,路径标注:
-设置行间距为 1.75 倍,即 $1.75\times 16\,{\rm pt}$:
+\starttyping[option=MP]
+pair no; no := point .4 along dc;
+pair yes; yes := point .5 along de;
+draw thetextext.top("否", no);
+draw thetextext.rt("是", yes);
+\stoptyping
+\midaligned{\externalfigure[12/flowchart-3.pdf][frame=on]}
-\starttyping[option=TEX]
-\setupinterlinespace[line=28pt]
+\section{代码简化}
+
+\in[sec:flow-chart] 节中用于绘制程序流程图的代码存在许多重复。我们可以尝试使用条件、循环,宏等形式对代码进行简化,但我对它们给出的讲解并不会细致,为的正是走马观花,观其大略。
+
+首先,观察宏 \type{framed} 和 \type{diamond} 的定义,发现二者仅有的不同是前者用 \type{fullsquare} 绘制盒子,后者用 \type{fulldiamond}。因此,可以重新定义一个更为灵活的宏,用于制作结点:
+
+\starttyping[option=MP]
+vardef make_node(expr text, shape, offset) =
+ picture p; p := image(draw textext(text));
+ numeric w, h; w := bbwidth(p); h := bbheight(p);
+ if path shape:
+ path q;
+ q := shape xysized (w + offset, h + offset) shifted center p;
+ image(fill q withcolor lightgray;
+ draw q withpen pencircle scaled 2pt withcolor darkred;
+ draw p;)
+ else:
+ image(draw p;)
+ fi
+enddef;
\stoptyping
-以下代码设置了了第 1 级列表样式,(1)定义一个新的列表项符号,将其设置列表项默认符号;(2)消除列表项之间的额外间距;(3)列表项的符号和内容之间插入 .5em 的间距;(4)列表前后各空 1/4 行,因为在幻灯片中,纵向空间颇为珍贵。
+\noindent 由于上述代码使用了 \METAPOST\ 的条件判断语法,以 \type{path shape} 判断 \type{shape} 是否为路径变量,从而使得 \type{make_node} 能构用于构造有无边框和有边框的结点:
\starttyping[option=MP]
-\startuseMPgraphic{square}
- path a, b;
- a := (-.5, 0) -- (-.5, .5) -- (.5, .5);
- b := (-.5, -.5) -- (.5, -.5) -- (.5, 0);
- for i = a, b:
- draw i scaled 10pt withpen pencircle scaled 2pt withcolor darkred;
- endfor;
- draw (0, 0) withpen pensquare scaled 4pt withcolor darkred;
-\stopuseMPgraphic
+numeric offset; offset := 5mm;
+string f; f := "\framed[frame=off,align=center]";
+picture a, b, c, d, e;
+a := make_node(f & "{$i\leftarrow 1$\\$s\leftarrow 0$}", none, 0);
+b := make_node(f & "{$s\leftarrow s + i$}", fullsquare, offset);
+c := make_node(f & "{$i\leftarrow i + 1$}", fullsquare, offset);
+d := make_node(f & "{$i > 100$}", fulldiamond, offset);
+e := make_node(f & "{$s$}", none, 0);
\stoptyping
-\starttyping[option=TEX]
-\definesymbol[10][{\lower.15ex\hbox{\useMPgraphic{square}}}]
-\setupitemize
- [1][10,packed]
- [distance=0.4em,
- before={\blank[quarterline]},after={\blank[quarterline]}]
+
+在 \type{vardef} 宏中使用条件语句时需要注意,通常情况下不要条件结束语句 \type{fi} 后面添加分号,否则 \type{vardef} 宏的返回值会带上这个分号。在其他情境下,通常需要在 \type{fi} 加分号。还要注意,我在 \type{make_node} 宏中使用 \type{xysized} 取代了之前的 \type{xscale} 和 \type{yscale},可直接指定路径或画面的尺寸。之所以如此,是因为我们无法确定 \type{make_node} 宏的第 2 个参数对应的路径是否为标准图形。
+
+在绘制结点和路径时,存在重复使用 \type{draw} 语句的情况,例如
+
+\starttyping[option=MP]
+drawarrow ab withcolor darkred;
+drawarrow bd withcolor darkred;
+drawarrow cb withcolor darkred;
+drawarrow dc withcolor darkred;
+drawarrow de withcolor darkred;
\stoptyping
-\noindent 如果你还需要二级、三级列表,可参照上述设定制作适合的样式。
-将幻灯片一级无编号标题和有编号标题均设置为居中对齐,字号级别为 \type{b},颜色为 \type{darkred},前后各空半行:
+\noindent 可使用循环语句予以简化:
-\starttyping[option=TEX]
-\setuphead
- [title,chapter]
- [align=center,style=\ssb,color=darkred,
- before={\blank[halfline]},after={\blank[halfline]}]
+\starttyping[option=MP]
+for i = ab, bd, cb, dc, de:
+ draw i withcolor darkred;
+endfor;
\stoptyping
-现在,在 \type{text} 环境中随便写点什么,察验上述设定是否起效。
+为了便于获得路径或画面的包围盒的四边中点,定义以下宏:
-\starttyping[option=TEX]
-\starttext
-\startbuffer[foo]
-\chapter{蒙}
-亨。匪我求童蒙,童蒙求我;初筮告,再三渎,渎则不告。利贞。
-\startitemize
-\item 初六,发蒙,利用刑人,用说桎梏;以往吝。
-\item 九二,包蒙,吉。纳妇,吉;子克家。
-\item 六三,勿用取女,见金夫,不有躬,无攸利。
-\item 六四,困蒙,吝。
-\item 六五,童蒙,吉。
-\item 上九,击蒙,不利为寇,利御寇。
-\stopitemize
-\stopbuffer
-\dorecurse{10}{\getbuffer[foo]}
-\stoptext
+\starttyping[option=MP]
+vardef left(expr p) = .5[llcorner p, ulcorner p] enddef;
+vardef top(expr p) = .5[ulcorner p, urcorner p] enddef;
+vardef right(expr p) = .5[lrcorner p, urcorner p] enddef;
+vardef bottom(expr p) = .5[llcorner p, lrcorner p] enddef;
\stoptyping
-\midaligned{\externalfigure[12-slides-2.pdf][width=.6\textwidth,frame=on]}
-\noindent 上述代码使用了 \ConTeXt\ 的 \type{buffer} 环境和循环宏 \type{\dorecurse}。所谓 \type{buff},是一个可以设定名字的缓存,它可以包含 \ConTeXt\ 排版代码。\type{\getbuffer} 可获得指定名字的缓存中所包含的全部代码。\type{\dorecurse} 可以将其所含内容重复指定次数。上述代码所产生的效果是生成十页内容相同的幻灯片。
+\noindent 以绘制结点 \type{b} 的四边中点为测试用例
-截止至此,我们第一次在示例中使用有编号标题。对于 \type{\chapter} 建议在幻灯片样式中增加以下设定,将其数字编号更改为中文编号,另外设置编号不参与对齐,亦即只有标题内容参与对齐:
+\starttyping[option=MP]
+for i = left(b), top(b), right(b), bottom(b):
+ draw i withpen pensquare scaled 4pt withcolor darkblue;
+endfor;
+\stoptyping
+\midaligned{\externalfigure[12/flowchart-4.pdf]}
-\starttyping[option=TEX]
-\setuphead[chapter][conversion=chinesenumerals,alternative=inmargin]
+基于上述宏,可以更为简洁地构造连接各结点的路径:
+
+\starttyping[option=MP]
+path ab; ab := bottom(a) -- top(b);
+path bd; bd := bottom(b) -- top(d);
+path dc; dc := right(d) -- left(c);
+path cb; cb := top(c) -- (xpart center c, ypart center b) -- right(b);
+path de; de := bottom(d) -- top(e);
\stoptyping
-\midaligned{\externalfigure[12-slides-3.pdf][width=.6\textwidth,frame=on]}
-\blank
-\noindent 如果你还需要二级、三级标题,可参照上述设定制作适合的样式。
+\noindent \type{center} 是 \METAPOST\ 宏,可用于获取路径或画面的包围盒中心点坐标。\type{xpart} 和 \type{ypart} 也皆为 \METAPOST\ 宏,用于获取点的坐标分量。
-\section{页脚}
+路径标注也可以通过定义一个宏予以简化:
-在 \in[regular-style] 节中,我关闭了 \ConTeXt\ 好意提供的页码。因为我希望页码出现在页面的右下角,且除以总页数,以便清楚幻灯片的进度。
+\starttyping[option=MP]
+vardef tag(expr p, text, pos, loc) =
+ if loc = "left": thetextext.lft(text, point pos along p)
+ elseif loc = "right": thetextext.rt(text, point pos along p)
+ elseif loc = "top": thetextext.top(text, point pos along p)
+ elseif loc = "bottom": thetextext.bot(text, point pos along p)
+ else thetextext(text, point pos along p)
+ fi
+enddef;
+\stoptyping
-\ConTeXt\ 提供了 \type{\setupfootertexts} 命令,可以在页脚左、右区域放入文字、盒子或图形等内容,同时提供了 \type{\setupfooter} 用于设定页脚区域的文字样式。另外,\type{\userpagenumber} 和 \type{\lastuserpage} 可分别用于获取当前页的页码和最后一页的页码。基于这些命令,便可实现能够表示进度的页码。例如
+\noindent 其用法为
-\starttyping[option=TEX]
-\showframe
-\setupfooter[style=small,color=darkred]
-% 页脚左侧区域为空,右侧区域放置用于表示进度的页码
-\setupfootertexts[margin][][\hss\userpagenumber/\lastuserpage]
+\starttyping[option=MP]
+draw tag(dc, "否", .5, "top"); draw tag(de, "是", .5, "right");
\stoptyping
-\noindent 结果如图 \in[页码进度] 所示。
-\placefigure[here][页码进度]{第 4 页幻灯片}{\externalfigure[12-slides-4.pdf][page=4,width=.6\textwidth,frame=on]}
-现在,我们已经有了一个基本可用的幻灯片样式了。倘若使用刚学过的 \METAPOST\ 语言,琢磨一下,给幻灯片增加些许不庸俗又实用的装饰,也许会让人觉得你的幻灯片颇为用心。
-\section{进度条}
+\section{层层叠叠}
-现在,我们放弃使用当前页码除以总页数的方式表示进度,而是颇为用心地用 \METAPOST\ 在页面底部绘制一个进度条。实际上,用不了几行代码便可实现:
+\ConTeXt\ 有一个以 overlay 为基础的层(Layer)机制。利用层机制,我们可将 \METAPOST\ 图形绘制在页面上的任何一个位置。在学习层之前,我们需要对 overlay 的认识再加深一些。
-\starttyping[option=MP]
-\startuseMPgraphic{processbar}
-numeric w, n, s, t;
-w := \overlaywidth; n := \lastuserpage;
-s := .5w / (n + 2); t := \userpagenumber - 1;
-path p; p := (fullsquare scaled \overlayheight);
-pickup pencircle scaled 2pt;
-picture q;
-q := image(for i = 0 upto n - 1:
- p := (p shifted (2s, 0)) randomized .5pt;
- if t = i: fill p withcolor darkgreen; fi;
- draw p withcolor transparent(1, 0.5, darkgray);
- endfor;);
-draw q xsized w;
+\subsection{overlay}
+
+实际上 overlay 环境是一个图形「栈」。通过它,可实现图形(包括文字)的叠加。例如,对于以下 \METAPOST\ 图形:
+
+\startsample
+\startuseMPgraphic{一个矩形}
+path p; p := fullsquare xscaled 4cm yscaled 1cm;
+draw p randomized 3mm
+ withcolor transparent (1, .5 randomized .25, red)
+ withpen pencircle scaled 2pt;
\stopuseMPgraphic
-\stoptyping
+\startoverlay
+ {\useMPgraphic{一个矩形}}
+ {\useMPgraphic{一个矩形}}
+ {\useMPgraphic{一个矩形}}
+\stopoverlay
+\stopsample
+\simplesample[option=MP]{\getsample}
+
+\noindent 上述代码中,\type{transparent (1, .5 randomized .3, red)} 用于构造在一定程度上不确定透明度的红色,透明度在 [0.2, 0.8] 之间,亦即 \type{randomized} 不仅可作用于路径,也可作用于数字或颜色值。由于上述 \METAPOST\ 图形环境包含着随机内容,将其作为插图,在一个 overlay 中多次使用,每次使用都会产生不同的结果,在 overlay 中它们会被叠加到一起。
+
+之前在为 \type{\framed} 定义 overlay 时,overlay 中只有单个图形,亦即我们并未充分利用 overlay 的特性。以下代码定义的 \type{\framed} 的背景便包含了三个叠加的 overlay:
+
+\startsample
+\defineoverlay
+ [叠叠]
+ [\startoverlay
+ {\useMPgraphic{一个矩形}}
+ {\useMPgraphic{一个矩形}}
+ {\useMPgraphic{一个矩形}}
+ \stopoverlay]
+\defineframed
+ [foo]
+ [frame=off,background={叠叠},width=4cm]
+\foo{迎接光辉岁月}
+\stopsample
+\simplesample[option=TEX]{\getsample}
+
+\noindent \type{\framed} 的背景支持多个 overlay 叠加,以下代码与上例等效:
\starttyping[option=TEX]
-\defineoverlay[process][\useMPgraphic{processbar}]
-\setupfootertexts[{\framed[frame=off,offset=0pt,
- width=\makeupwidth,height=.8em,
- background=process,empty=yes]{}}]
+\defineoverlay[叠叠-1]{\useMPgraphic{一个矩形}}
+\defineoverlay[叠叠-2]{\useMPgraphic{一个矩形}}
+\defineoverlay[叠叠-3]{\useMPgraphic{一个矩形}}
+\defineframed[foo][frame=off,background={叠叠-1,重叠-2,重叠-3}]
+\foo{迎接光辉岁月}
\stoptyping
-\noindent 上述代码唯一需要解释之处是,当 \type{\setupfootertexts} 只有一个参数时,该参数的值会被安置在页脚的中间区域。所构造的进度条效果如图 \in[processbar] 所示。
+\noindent 这意味着,\type{\framed} 的背景,本质上也是一个 overlay。
-\placefigure[here][processbar]{第 3 页幻灯片}{\externalfigure[slides.pdf][width=.6\textwidth,page=4,frame=on]}
+基于 overlay,也可为文档设置水印。例如,若在 \type{\starttext} 之前添加以下代码:
-\section{封面和致谢}
+\starttyping[option=TEX]
+\startuseMPgraphic{square}
+path p; p := fullsquare xscaled 4cm yscaled 1cm;
+draw p randomized 3mm
+ withcolor transparent (1, .5 randomized .3, red)
+ withpen pencircle scaled 2pt;
+\stopuseMPgraphic
+\defineoverlay[watermark][\useMPgraphic{square}]
+\setupbackgrounds[page][background=watermark]
+\stoptyping
+\midaligned{\externalfigure[12/watermark.png][width=.6\textwidth]}
+
+\subsection[layer]{层}
-幻灯片的封面和最后的致谢页皆可使用 \type{sandardmakeup} 环境制作。例如
+\ConTeXt\ 的层,本质上是一个可作为全页背景的 overlay,可使用绝对坐标或相对坐标对排版元素在页面上定位放置。例如,定义一个层 foo,在三个不同位置分别放置一幅 \METAPOST\ 图形,并将其作用于当前页面:
+
+\starttyping[option=TEX]
+\definelayer[foo]
+\setlayer[foo][x=0cm,y=0cm]{\useMPgraphic{一个矩形}}
+\setlayer[foo][x=6cm,y=1cm]{\useMPgraphic{一个矩形}}
+\stoptyping
+\starttyping[option=TEX]
+\setlayer
+ [foo]
+ [x=\textwidth,y=2cm,hoffset=-4cm,vhoffset=-.5cm]{\useMPgraphic{一个矩形}}
+\flushlayer[foo]
+\stoptyping
+\definelayer[test]
+\setlayer[test][x=0cm,y=0cm]{\useMPgraphic{一个矩形}}
+\setlayer[test][x=6cm,y=1cm]{\useMPgraphic{一个矩形}}
+\setlayer
+ [test]
+ [x=\textwidth,y=2cm,hoffset=-4cm,voffset=-3cm]{\useMPgraphic{一个矩形}}
+\flushlayer[test]
+\noindent 上述代码定义的层 foo,其坐标原点是层被投放的位置,亦即在本行文字的左上角。$x$ 坐标向右递增,$y$ 坐标向下递增。
+\definelayer[foo]
+\setlayer[foo][x=0cm,y=0cm]{\useMPgraphic{circle}}
+\setlayer[foo][preset=rightbottom]{\useMPgraphic{circle}}
+\setupbackgrounds[page][background=foo]
+
+如果将层的宽度和高度分别设为页面的宽度和高度,并将其设为页面背景,则坐标原点在页面的左上角,且可使用一些预定义位置投放内容。例如以下代码可在当前页面的左上角和右下角位置各放一个圆圈:
\starttyping[option=TEX]
-\startstandardmakeup[align=center]
-\ssd \color[darkred]{如何用 \ConTeXt\ 制作幻灯片}
-\blank[2*line]
-\ssb 李某人
-\blank[line]
-2023 年 3 月 28 日
-\stopstandardmakeup
+\startuniqueMPgraphic{circle}
+draw fullcircle scaled 2cm withpen pencircle scaled 2pt withcolor darkgreen;
+\stopuniqueMPgraphic
+\definelayer[foo][width=\paperwidth,height=\paperheight]
+\setlayer[foo][x=0cm,y=0cm]{\uniqueMPgraphic{circle}}
+\setlayer[foo][preset=rightbottom]{\uniqueMPgraphic{circle}}
+\setupbackgrounds[page][background=foo]
\stoptyping
-\noindent 结果如图 \in[cover] 所示。
+\startuniqueMPgraphic{circle}
+draw fullcircle scaled 2cm withpen pencircle scaled 2pt withcolor darkgreen;
+\stopuniqueMPgraphic
+\definelayer[foo][width=\paperwidth,height=\paperheight]
+\setlayer[foo][x=0cm,y=0cm]{\uniqueMPgraphic{circle}}
+\setlayer[foo][preset=rightbottom]{\uniqueMPgraphic{circle}}
+\setupbackgrounds[page][background=foo]
-之所以使用 \type{standardmakeup} 环境,是因为它是完全的空白页,且不会参与页码计数。
-\placefigure[here][cover]{封面}{\externalfigure[slides.pdf][width=.6\textwidth,page=1,frame=on]}
+\noindent 需要注意的是,层被使用一次后,便会被清空,因而将其作为页面背景,仅对当前页有效。
-\section{不要太刺眼}
+通过 \type{preset} 参数可调整层的坐标原点和坐标方向。在上述代码中,\type{rightbottom} 可将层的坐标原点定位于层的右下角,同时 $x$ 坐标方向变为向左递增,$y$ 坐标方向变为向上递增。
-白色背景,往往过于刺眼。我们可将幻灯片背景色设置为浅灰色:
+\ConTeXt\ 预定义的 \type{preset} 参数值有
+
+\startitemize[packed,columns,five]
+\item lefttop\item righttop\item leftbottom\item rightbottom\item middle\item middletop
+\item middlebottom\item middleleft\item middleright\item lefttopleft\item lefttopright
+\stopitemize
+
+\noindent 使用这些参数值时,要注意坐标方向。例如,若 \type{preset=middleright},其 $x$ 坐标方向变为向左递增,而 $y$ 坐标方向依然保持向上递增,以下代码可予以验证:
\starttyping[option=TEX]
-\setupbackgrounds[page][backgroundcolor=lightgray,background=color]
+\definelayer[bar][width=\paperwidth,height=\paperheight]
+\setlayer[bar][preset=middleright]{
+ \startMPcode
+ draw (0, 0) withpen pensquare scaled 12pt withcolor darkred;
+ \stopMPcode
+}
\stoptyping
-\noindent 结果如图 \in[slide-background] 所示。
-\placefigure[here][slide-background]{浅灰色背景}{\externalfigure[slides-finished.pdf][width=.6\textwidth,page=1,frame=on]}
+\starttyping[option=TEX]
+\setlayer[bar][preset=middleright,x=2cm,y=2cm]{
+ \startMPcode
+ draw (0, 0) withpen pensquare scaled 12pt
+ withcolor transparent (1, .3, darkred);
+ \stopMPcode
+}
+\setupbackgrounds[page][background=bar]
+\stoptyping
+
+\definelayer[bar][width=\paperwidth,height=\paperheight]
+\setlayer[bar][preset=middleright]{
+ \startMPcode
+ draw (0, 0) withpen pensquare scaled 12pt withcolor darkred;
+ \stopMPcode
+}
+\setlayer[bar][preset=middleright,x=2cm,y=2cm]{
+ \startMPcode
+ draw (0, 0) withpen pensquare scaled 12pt
+ withcolor transparent (1, .3, darkred);
+ \stopMPcode
+}
+\setupbackgrounds[page][background=bar]
\section{小结}
-本章仅介绍了非常基本的幻灯片制作过程。一份精致的幻灯片样式,值得你用心设计,但是切记,不要喧宾夺主。质胜文则野,文胜质则史。孔子说,好的幻灯片样式,总是是文质彬彬的。本文制作的幻灯片示例,路数偏野。
+也许你意犹未尽,甚至觉得我语焉不详。切莫怪我,我原本仅仅是介绍如何使用 \METAPOST\ 绘制一个边框受随机扰动的盒子。不过,在大致掌握了本章所述的内容的基础上,关于 \METAPOST\ 更多的知识,特别本章所有你觉得语焉不详之处,皆可阅读它的手册\cite[mpman]以增进认识。此外,\ConTeXt\ 开发者 Hans Hagen 所写的 \MetaFun\ 手册除了讲述 \MetaFun\ 之外也大量介绍了 \METAPOST\ 的基本知识和技巧,该手册在你的 \ConTeXt\ 系统中,使用以下命令查找:
+
+\starttyping
+$ mtxrun --script base --search metafun-s.pdf
+\stoptyping \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/13.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/13.tex
index 9e620179a3a..21352467917 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/13.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/13.tex
@@ -1,271 +1,280 @@
-\chapter{写一本书?}
+\chapter{幻灯片}
-至此,你所掌握的关于 \CONTEXT\ 的所有知识,无论是用于撰写书信,随笔,论文,还是制作幻灯片,皆已游刃有余。现在再掌握 \ConTeXt\ 对文档逻辑结构的划分以及为文档添加目录等功能,便可写书了,这是 \TEX\ 系统一直以来最为擅长的事情,也是 \TEX\ 系统为何复杂到令很多人畏惧的原因,他们从未想过自己有一天会写一本书。
+现在你已经领略甚至可能全部掌握了 \ConTeXt\ 常用的的排版元素,若不使用它们而是依然使用 Microsoft PowerPoint 制作幻灯片甚为可惜。如果你已决意使用 \ConTeXt\ 制作幻灯片,你会发现,你几乎不需要再学习多少新的 \ConTeXt\ 命令便可随心所欲地制作清新质朴的幻灯片了。
-\section{书的内容结构}
+\section{纸面尺寸}
-一本书,通常是由一组文章构成的,可分为序、前言、目录、正文篇章、跋、参考文献、索引、附录等内容,再加上封面,衬页、扉页等页面。对于书籍制作,\CONTEXT\ 对 \type{text} 环境进行了更为细致的划分:
+纸面尺寸是每一页的打印尺寸。至此为止,本文档之前所有的示例,在 \type{TEXpage} 环境里的,纸面尺寸取决于文档内容的多少,而在 \type{text} 环境里的,纸面尺寸默认是 A4,即 $21\,{\rm cm}\times 29.7\,{\rm cm}$,如果你需要将该尺寸换成 A5,只需在样式文件中作以下设定
\starttyping[option=TEX]
-\starttext
-\startfrontmatter
-% 封面、扉页、序、前言、目录等内容
-\stopfrontmatter
-\startbodymatter
-% 正文篇章
-\stopbodymatter
-\startbackmatter
-% 跋,参考文献列表、索引等内容
-\stopbackmatter
-\startappendices
-% 附录
-\stopappendices
-\stoptext
+\setuppapersize[A5]
\stoptyping
-\section{文件结构}
+制作幻灯片通常不需要太大的纸面尺寸。\ConTeXt\ 提供了 S4 尺寸($400\,{\rm pt}\times 300\,{\rm pt}$),可将其作为幻灯片的纸面尺寸。也可以自己定义纸面尺寸并使用,例如
-将一本书的内容全部放在一份 \CONTEXT\ 源文件中并不违法,但是数十万甚至上百万字的内容,无论是撰写还是修改必定极为不便。通常是将按照内容结构,将每部分内容制作为单独的 \type{.tex} 源文件,然后使用 \type{\input} 载入到主文件中。例如,主文档的主文件内容如下:
-
-\starttyping[option=TEX]
-\starttext
-\startfrontmatter
-\input cover % cover.tex:封面
-\input preface % preface.tex:序
-\stopfrontmatter
-\stoptyping
\starttyping[option=TEX]
-\startbodymatter
-\input 01 % 01.tex:第一章
-\input 02 % 02.tex:第二章
-% ... ...
-\stopbodymatter
-\startbackmatter
-\title{参考文献}
-\placelistofpublications % 参考文献列表
-\stopbackmatter
-\startappendices
-\null % 暂时为空
-\stopappendices
-\stoptext
+\definepapersize[foo][width=640pt,height=480pt]
+\setuppapersize[foo]
\stoptyping
-\noindent 主文件 \type{\input} 的所有文件皆与主文件在同一目录。
-
-\section{样式}
-
-原则上,书籍的所有排版样式皆应在单独的文件中设定,然后使用 \type{\input} 或 \type{\environment} 命令在 \type{text} 环境之前将其载入。例如
+实际上,纸面尺寸仅对排版结果的打印很重要,倘若只是在计算机(或投影仪)屏幕上观看排版结果,我们总是可以通过调整正文字体大小去应对过大或过小的纸面尺寸,但是纸面尺寸的宽高比例,对于屏幕非常重要。通常,幻灯片的宽高比应当与屏幕的分辨率相适应为最佳。例如,我的屏幕分辨率是 $1600\times 900$,那么我要制作的幻灯片页面的宽高比也应当是 $16:9$,故而纸面尺寸可设定为
\starttyping[option=TEX]
-\environment book-style % 载入book-style.tex
-\starttext
-% ... ... ...
-\stoptext
+\definepapersize[foo][width=640pt,height=360pt]
+\setuppapersize[foo]
\stoptyping
-\section{目录}
-
-\type{\placecontent} 可将全文章节标题及其所在页码等信息汇总为一个列表,以方便读者查阅。例如
+现在,我们可以制作幻灯片的最原始的形式:
\starttyping[option=TEX]
\usemodule[visual]
+\definepapersize[foo][width=640pt,height=360pt]
+\setuppapersize[foo]
\starttext
\title{\fakewords{3}{5}}
-\placecontent
-\section{\fakewords{3}{5}}
-... ... ...
-\section{\fakewords{3}{5}}
-... ... ...
+\fakewords{50}{100}
\stoptext
\stoptyping
-\midaligned{%
- \clip[width=\textwidth,height=6cm,voffset=3cm]{%
- \externalfigure[13-toc.pdf][width=\textwidth,frame=on]%
- }%
-}
+\midaligned{\externalfigure[13/slides-1.pdf][width=.6\textwidth,frame=on]}
-使用 \type{\setupcombinedlist} 可设定目录样式,例如设定可在目录中出现的标题级别以及列表样式。若得到常见的目录样式,只需作以下设定:
+\section{页面布局}
-\starttyping[option=TEX]
-\setupcombinedlist[content][alternative=c]
-\stoptyping
-\midaligned{%
- \clip[width=\textwidth,height=6cm,voffset=3cm]{%
- \externalfigure[13-toc-2.pdf][width=\textwidth,frame=on]%
- }%
-}
-\blank
-\noindent 目录列表样式参数 \type{alternative} 有 \type{a},\type{b},\type{c},\type{d} 四个值可选,默认是 \type{b}。本文档目录使用的是 \type{d}。
-
-\type{\setupcombinedlist} 亦可用于指定可出现在目录列表中的标题级别,例如
+在 \type{text} 环境之前添加以下代码
\starttyping[option=TEX]
-\setupcombinedlist[content][list={chapter,section}]
+\showframe
\stoptyping
-注意,当 \type{\placecontent} 出现在 \type{\chapter} 之后时,生成的目录仅针对该章之内的各节。若是写书,需将 \type{\placecontent} 放在 \type{frontmatter} 环境,例如:
+\noindent 可在页面上显示当前的页面布局,结果如图 \in[12-layout-1] 所示。可根据图 \in[ConTeXt-layout] 理解页面布局中各区域名称和尺寸参数名称。
-\starttyping[option=TEX]
-\startfrontmatter
-\title{目录}
-\placecontent
-\stopfrontmatter
-\stoptyping
+\placefigure[here][12-layout-1]{\ConTeXt\ 默认的页面布局}{\externalfigure[13/layout-1.pdf][width=.6\textwidth]}
-\noindent 可对全篇被列入目录列表的章节生成目录。
+\placefigure[here][ConTeXt-layout]{页面布局注解}{\externalfigure[13/ConTeXt-layout.svg][width=.8\textwidth]}
-使用 \type{\setuplist} 可对出现在目录列表中相应级别的标题样式分别予以设定,例如
+使用 \type{\setlayout} 可对各区域尺寸进行调整,例如让版心居中,即图 \in[ConTeXt-layout] 所示的 \type{width} 和 \type{textheight} 确定的区域居中,因为在默认情况下,它有些偏左。我们已经知道,页面的横向尺寸是 640 pt,按照以下设定便可将问题解决:
\starttyping[option=TEX]
-\setuplist[chapter]
- [alternative=a,
- before={\blank[halfline]},after={\blank[halfline]},style=bold]
-\setuplist[section]
- [alternative=d,style=normal,pagestyle=smallbold]
+\setuplayout
+ [leftedge=0pt,leftedgedistance=0pt,
+ leftmargin=80pt,leftmargindistance=10pt,
+ backspace=90pt,
+ rightedge=0pt,rightedgedistance=0pt,
+ rightmargin=80pt,rightmargindistance=10pt,
+ width=460pt]
\stoptyping
-\section{让无编号标题进入目录}
-
-\CONTEXT\ 默认不允许无编号标题出现在目录中,但是倘若对无编号标题,例如 \type{\title} 作以下设定
+\noindent 上述设定,实现了页面布局中页面总宽度值 640 pt 的分配,但是要注意一点,\type{backspace} 的值等于 4 个以 \type{left} 为前缀的参数值之和,虽然在设定了它的各个分量后,但 \ConTeXt\ 在遇到默认的 \type{backspace} 值与实际的 \type{left...} 参数值之和不符时,会根据 \type{backspace} 值进行页面布局。倘若我们不关心 \type{left...} 参数,即 \ConTeXt\ 默认对页面左侧留白区域默认如何分配,仅需要让 \ConTeXt\ 知道 \type{backspace=90pt},则上述代码可简化为
\starttyping[option=TEX]
-\setuphead[title][incrementnumber=list]
+\setuplayout
+ [backspace=90pt,
+ rightedge=0pt,rightedgedistance=0pt,
+ rightmargin=80pt,rightmargindistance=10pt,
+ width=460pt]
\stoptyping
-\noindent 之后便可将 \type{\title} 添加到目录列表,即
+\noindent 还可以进一步简化,因为 \ConTeXt\ 对 \type{rightedge} 和 \type{rightedgedistance} 赋予的默认值原本就是 0,因此有
\starttyping[option=TEX]
-\setupcombinedlist[content][list={title,chapter,section}]
+\setuplayout
+ [backspace=90pt,
+ rightmargin=80pt,rightmargindistance=10pt,
+ width=460pt]
\stoptyping
-需要注意的是,在 \type{frontmatter} 环境中放置目录列表时,若使用以下代码
+如果我们只关心版心的横向居中问题,并不关心左右留白区域的尺寸,最为简单的布局方式是
\starttyping[option=TEX]
-\startfrontmatter
-\title{目录}
-\placecontent
-\stopfrontmatter
+\setuplayout[width=middle]
\stoptyping
-\noindent 由于此时 \type{\title} 已被列入目录列表,因此 \type{\title{目录}} 本身会出现在目录列表中。为避免这一问题,需要为目录页单独定义一个标题。\CONTEXT\ 支持我们定义自己的标题,例如
+以上设置的是页面横向布局。对于纵向布局,存在与 \type{backspace} 类似的问题,即 \type{topspace} 的设定。\type{tospace} 的值是 \type{top} + \type{topdistance},但是在 \type{\setuplayout} 中只对后者进行设定是无效的,必须先设定 \type{tospace},然后再将其值分配给 \type{top} 和 \type{topdistance},或让 \ConTeXt\ 自动分配。
+
+对于页面纵向布局参数,我要去掉页面顶部和底部留白,只需作以下设定
\starttyping[option=TEX]
-\definehead[TOC][title]
+topspace=0pt,height=middle,bottom=0pt
\stoptyping
-\noindent 定义了一个新的标题 \type{\TOC},它与 \type{\title} 的样式相同。在 \type{frontmatter} 环境中使用 \type{\TOC}:
+\noindent 现在全部的页面布局设定如下:
\starttyping[option=TEX]
-\startfrontmatter
-\TOC{目录}
-\placecontent
-\stopfrontmatter
+\setuplayout[width=middle,topspace=0pt,height=middle,footer=40pt]
\stoptyping
-\noindent 由于我们并未将 \type{\TOC} 列入目录列表,因此上述问题得以解决。
-
-\section{书签}
-
-对于内容较多的 PDF 文档,提供书签(Bookmark)可更加便于他人阅读。书签通常显示于 PDF 阅读器的侧栏,如图 \in[13-bookmarks] 所示,点击某个书签便可跳转至其关联的页面。
+完成页面布局设定后,别忘记去掉 \type{text} 环境之前的 \type{\showframe} 语句。此外,我建议你在 \type{text} 环境里动手试验一番 \type{\showlayout}。
-\placefigure[here][13-bookmarks]{PDF 书签}{\externalfigure[13-bookmarks.png][width=.6\textwidth]}
+\section[slide-fonts]{字体}
-为 \ConTeXt\ 生成的 PDF 文件制作书签,非常简单,只需在样式文件中添加以下语句,
+在 \ConTeXt\ 使用汉字字体,对此估计你已经颇为熟悉了。在幻灯片中,我使用以下字体:
\starttyping[option=TEX]
-\setupinteraction[state=start,focus=standard]
-\setupinteractionscreen[option=bookmark]
-\placebookmarks[title,chapter,section][title,chapter]
+\definefallbackfamily
+ [myfonts][ss][latinmodernsans][range={0x0000-0x0400},force=yes]
+\definefontfamily[myfonts][ss][simhei][bf=simhei,it=kaiti,bi=simhei]
+\setscript[hanzi]
+\setupbodyfont[myfonts,ss,16pt]
\stoptyping
-\noindent 其中,\type{\setupinteraction} 用于开启 PDF 的用户交互特性。\type{\setupinteractionscreen} 用于设定 PDF 文件被阅读器打开后,以何种形式如何呈现在屏幕上,若其 \type{option} 值为 \type{bookmark},则文件打开后,会自动开启阅读器的侧边栏并显示书签;若设置 \type{option} 为 \type{max},则文件在被打开后会全屏显示。上述 \type{\placebookmarks} 语句的用途是设置可出现在书签栏的标题级别,且仅允许 \type{\title} 和 \type{\chapter} 级别的标题,其子标题列表可被展开。
+\noindent 上述字体设定并不完整,尚未设定衬线字族和等宽字族,这些待需要时再予以设定。
-需要注意的是,\CONTEXT\ 同样默认无编号标题不被列入书签,但是倘若做以下设定
+\section[regular-style]{常规样式}
+
+首先,消除 \ConTeXt\ 默认在页面顶部设置的页码:
\starttyping[option=TEX]
-\setuphead[title][incrementnumber=list]
+\setuppagenumbering[location=]
\stoptyping
-\noindent 则 \type{\title} 亦可出现在书签列表中。
-
-还需要注意一点, 书签功能取决于你所用的 PDF 阅读器是否支持。此外,你的 PDF 阅读器可能会将 \ConTeXt\ 生成的书签视为索引(Index),而其本身则提供了另一个叫作书签的功能,允许用户手动在侧边栏为文档的某一页建立链接,与 \CONTEXT\ 的书签原理相同。
+\noindent 幻灯片通常不需要页码,即使需要页码,默认的页码出现的位置和字号皆不合适。
-\section[reference]{引用}
+设置行间距为 1.75 倍,即 $1.75\times 16\,{\rm pt}$:
-在本文档的插图、表格、数学公式等章节中,已简略介绍了 \CONTEXT\ 引用的用法。\CONTEXT\ 的标题和列表也支持引用。例如,本节的标题对应的排版命令是
+\starttyping[option=TEX]
+\setupinterlinespace[line=28pt]
+\stoptyping
+以下代码设置了了第 1 级列表样式,(1)定义一个新的列表项符号,将其设置列表项默认符号;(2)消除列表项之间的额外间距;(3)列表项的符号和内容之间插入 .5em 的间距;(4)列表前后各空 1/4 行,因为在幻灯片中,纵向空间颇为珍贵。
+
+\starttyping[option=MP]
+\startuseMPgraphic{square}
+ path a, b;
+ a := (-.5, 0) -- (-.5, .5) -- (.5, .5);
+ b := (-.5, -.5) -- (.5, -.5) -- (.5, 0);
+ for i = a, b:
+ draw i scaled 10pt withpen pencircle scaled 2pt withcolor darkred;
+ endfor;
+ draw (0, 0) withpen pensquare scaled 4pt withcolor darkred;
+\stopuseMPgraphic
+\stoptyping
\starttyping[option=TEX]
-\section[reference]{引用}
+\definesymbol[10][{\lower.15ex\hbox{\useMPgraphic{square}}}]
+\setupitemize
+ [1][10,packed]
+ [distance=0.4em,
+ before={\blank[quarterline]},after={\blank[quarterline]}]
\stoptyping
+\noindent 如果你还需要二级、三级列表,可参照上述设定制作适合的样式。
-可以在文章几乎任何一个位置,像下面这样引用本节:
+将幻灯片一级无编号标题和有编号标题均设置为居中对齐,字号级别为 \type{b},颜色为 \type{darkred},前后各空半行:
\starttyping[option=TEX]
-我在 \at[reference] 页 \in[reference] 节\about[reference]中的一些内容。
+\setuphead
+ [title,chapter]
+ [align=center,style=\ssb,color=darkred,
+ before={\blank[halfline]},after={\blank[halfline]}]
\stoptyping
-\noindent 结果为
-\blank[line]
-\blueframed{我引用了本文档 \at[reference] 页 \in[reference] 节\about[reference]中的一些内容。}
-\blank[line]
-
-使用 \type{\textreference} 可在文档几乎任何位置插入引用。例如
+现在,在 \type{text} 环境中随便写点什么,察验上述设定是否起效。
\starttyping[option=TEX]
-我在此处放置了一个引用\textreference[myref]{一个引用}。
+\starttext
+\startbuffer[foo]
+\chapter{蒙}
+亨。匪我求童蒙,童蒙求我;初筮告,再三渎,渎则不告。利贞。
+\startitemize
+\item 初六,发蒙,利用刑人,用说桎梏;以往吝。
+\item 九二,包蒙,吉。纳妇,吉;子克家。
+\item 六三,勿用取女,见金夫,不有躬,无攸利。
+\item 六四,困蒙,吝。
+\item 六五,童蒙,吉。
+\item 上九,击蒙,不利为寇,利御寇。
+\stopitemize
+\stopbuffer
+\dorecurse{10}{\getbuffer[foo]}
+\stoptext
\stoptyping
-\blank[line]
-\blueframed{我在此处放置了一个引用\textreference[myref]{一个引用}。}
-\blank[line]
-\noindent 注意,一个引用,其内容是不会显示在排版结果中的。然后在文档某处使用该引用,
+\midaligned{\externalfigure[13/slides-2.pdf][width=.6\textwidth,frame=on]}
+
+\noindent 上述代码使用了 \ConTeXt\ 的 \type{buffer} 环境和循环宏 \type{\dorecurse}。所谓 \type{buff},是一个可以设定名字的缓存,它可以包含 \ConTeXt\ 排版代码。\type{\getbuffer} 可获得指定名字的缓存中所包含的全部代码。\type{\dorecurse} 可以将其所含内容重复指定次数。上述代码所产生的效果是生成十页内容相同的幻灯片。
+
+截止至此,我们第一次在示例中使用有编号标题。对于 \type{\chapter} 建议在幻灯片样式中增加以下设定,将其数字编号更改为中文编号,另外设置编号不参与对齐,亦即只有标题内容参与对齐:
\starttyping[option=TEX]
-我在此处使用一个引用,它是 \at[myref] 的「\in[myref]」。
+\setuphead[chapter][conversion=chinesenumerals,alternative=inmargin]
\stoptyping
-\blank[line]
-\blueframed{我在此处使用一个引用,它是第 \at[myref] 页的「\in[myref]」。}
-\blank[line]
+\midaligned{\externalfigure[13/slides-3.pdf][width=.6\textwidth,frame=on]}
+\blank
+
+\noindent 如果你还需要二级、三级标题,可参照上述设定制作适合的样式。
-如果你希望一个引用,其内容不仅出现在排版结果中,且想给他加个外框,只需定义一个宏来帮助你实现这一需求。例如
+\section{页脚}
+
+在 \in[regular-style] 节中,我关闭了 \ConTeXt\ 好意提供的页码。因为我希望页码出现在页面的右下角,且除以总页数,以便清楚幻灯片的进度。
+
+\ConTeXt\ 提供了 \type{\setupfootertexts} 命令,可以在页脚左、右区域放入文字、盒子或图形等内容,同时提供了 \type{\setupfooter} 用于设定页脚区域的文字样式。另外,\type{\userpagenumber} 和 \type{\lastuserpage} 可分别用于获取当前页的页码和最后一页的页码。基于这些命令,便可实现能够表示进度的页码。例如
\starttyping[option=TEX]
-\def\framedref[#1]#2{\inframed{#2}\textreference[#1]{#2}}
+\showframe
+\setupfooter[style=small,color=darkred]
+% 页脚左侧区域为空,右侧区域放置用于表示进度的页码
+\setupfootertexts[margin][][\hss\userpagenumber/\lastuserpage]
+\stoptyping
+\noindent 结果如图 \in[页码进度] 所示。
+\placefigure[here][页码进度]{第 4 页幻灯片}{\externalfigure[13/slides-4.pdf][page=4,width=.6\textwidth,frame=on]}
+
+现在,我们已经有了一个基本可用的幻灯片样式了。倘若使用刚学过的 \METAPOST\ 语言,琢磨一下,给幻灯片增加些许不庸俗又实用的装饰,也许会让人觉得你的幻灯片颇为用心。
+
+\section{进度条}
+
+现在,我们放弃使用当前页码除以总页数的方式表示进度,而是颇为用心地用 \METAPOST\ 在页面底部绘制一个进度条。实际上,用不了几行代码便可实现:
+
+\starttyping[option=MP]
+\startuseMPgraphic{processbar}
+numeric w, n, s, t;
+w := \overlaywidth; n := \lastuserpage;
+s := .5w / (n + 2); t := \userpagenumber - 1;
+path p; p := (fullsquare scaled \overlayheight);
+pickup pencircle scaled 2pt;
+picture q;
+q := image(for i = 0 upto n - 1:
+ p := (p shifted (2s, 0)) randomized .5pt;
+ if t = i: fill p withcolor darkgreen; fi;
+ draw p withcolor transparent(1, 0.5, darkgray);
+ endfor;);
+draw q xsized w;
+\stopuseMPgraphic
\stoptyping
+
\starttyping[option=TEX]
-我在此处放置了一个引用\textreference[myref]{一个引用}。
+\defineoverlay[process][\useMPgraphic{processbar}]
+\setupfootertexts[{\framed[frame=off,offset=0pt,
+ width=\makeupwidth,height=.8em,
+ background=process,empty=yes]{}}]
\stoptyping
-\blank[line]
-\def\framedref[#1]#2{\inframed{#2}\textreference[#1]{#2}}
-\blueframed{我在此处放置了\framedref[myref]{一个引用}。}
-\blank[line]
-\section{索引}
+\noindent 上述代码唯一需要解释之处是,当 \type{\setupfootertexts} 只有一个参数时,该参数的值会被安置在页脚的中间区域。所构造的进度条效果如图 \in[processbar] 所示。
-索引通常放在 \type{backmatter} 环境,即附在书的正文之后,
+\placefigure[here][processbar]{第 3 页幻灯片}{\externalfigure[13/slides.pdf][width=.6\textwidth,page=4,frame=on]}
-\starttyping[option=TEX]
-\startbackmatter
-\title{索引}
-\placeindex
-\stopbackmatter
-\stoptyping
+\section{封面和致谢}
-\noindent 以便检索在正文某页检索一些关键词这些关键词在正文中需由 \type{\index} 给出。例如
+幻灯片的封面和最后的致谢页皆可使用 \type{sandardmakeup} 环境制作。例如
\starttyping[option=TEX]
-我在此演示 \type{\placeindex}\index[placeindex]{\type{\placeindex}}
-和 \type{\index}\index[index]{\type{\index}} 的用法。
-\stoptyping
-\blank[line]
-\blueframed{我在此演示 \type{\placeindex}\index[placeindex]{\type{\placeindex}} 和 \type{\index}\index[index]{\type{\index}} 的用法。}
+\startstandardmakeup[align=center]
+\ssd \color[darkred]{如何用 \ConTeXt\ 制作幻灯片}
+\blank[2*line]
+\ssb 李某人
\blank[line]
+2023 年 3 月 28 日
+\stopstandardmakeup
+\stoptyping
+\noindent 结果如图 \in[cover] 所示。
-\noindent \tex{placeindex} 产生的结果为
+之所以使用 \type{standardmakeup} 环境,是因为它是完全的空白页,且不会参与页码计数。
+\placefigure[here][cover]{封面}{\externalfigure[13/slides.pdf][width=.6\textwidth,page=1,frame=on]}
-\blank[line]
-\blueframed{\placeindex}
-\blank[line]
+\section{不要太刺眼}
+
+白色背景,往往过于刺眼。我们可将幻灯片背景色设置为浅灰色:
+
+\starttyping[option=TEX]
+\setupbackgrounds[page][backgroundcolor=lightgray,background=color]
+\stoptyping
+\noindent 结果如图 \in[slide-background] 所示。
+\placefigure[here][slide-background]{浅灰色背景}{\externalfigure[13/slides-finished.pdf][width=.6\textwidth,page=1,frame=on]}
\section{小结}
-用 \CONTEXT\ 排版一本书并不难,难的是书该如何写。 \ No newline at end of file
+本章仅介绍了非常基本的幻灯片制作过程。一份精致的幻灯片样式,值得你用心设计,但是切记,不要喧宾夺主。质胜文则野,文胜质则史。孔子说,好的幻灯片样式,总是是文质彬彬的。本文制作的幻灯片示例,路数偏野。
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/14.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/14.tex
new file mode 100644
index 00000000000..7e8c20aebf3
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/14.tex
@@ -0,0 +1,271 @@
+\chapter{写一本书?}
+
+至此,你所掌握的关于 \CONTEXT\ 的所有知识,无论是用于撰写书信,随笔,论文,还是制作幻灯片,皆已游刃有余。现在再掌握 \ConTeXt\ 对文档逻辑结构的划分以及为文档添加目录等功能,便可写书了,这是 \TEX\ 系统一直以来最为擅长的事情,也是 \TEX\ 系统为何复杂到令很多人畏惧的原因,他们从未想过自己有一天会写一本书。
+
+\section{书的内容结构}
+
+一本书,通常是由一组文章构成的,可分为序、前言、目录、正文篇章、跋、参考文献、索引、附录等内容,再加上封面,衬页、扉页等页面。对于书籍制作,\CONTEXT\ 对 \type{text} 环境进行了更为细致的划分:
+
+\starttyping[option=TEX]
+\starttext
+\startfrontmatter
+% 封面、扉页、序、前言、目录等内容
+\stopfrontmatter
+\startbodymatter
+% 正文篇章
+\stopbodymatter
+\startbackmatter
+% 跋,参考文献列表、索引等内容
+\stopbackmatter
+\startappendices
+% 附录
+\stopappendices
+\stoptext
+\stoptyping
+
+\section{文件结构}
+
+将一本书的内容全部放在一份 \CONTEXT\ 源文件中并不违法,但是数十万甚至上百万字的内容,无论是撰写还是修改必定极为不便。通常是将按照内容结构,将每部分内容制作为单独的 \type{.tex} 源文件,然后使用 \type{\input} 载入到主文件中。例如,主文档的主文件内容如下:
+
+\starttyping[option=TEX]
+\starttext
+\startfrontmatter
+\input cover % cover.tex:封面
+\input preface % preface.tex:序
+\stopfrontmatter
+\stoptyping
+\starttyping[option=TEX]
+\startbodymatter
+\input 01 % 01.tex:第一章
+\input 02 % 02.tex:第二章
+% ... ...
+\stopbodymatter
+\startbackmatter
+\title{参考文献}
+\placelistofpublications % 参考文献列表
+\stopbackmatter
+\startappendices
+\null % 暂时为空
+\stopappendices
+\stoptext
+\stoptyping
+
+\noindent 主文件 \type{\input} 的所有文件皆与主文件在同一目录。
+
+\section{样式}
+
+原则上,书籍的所有排版样式皆应在单独的文件中设定,然后使用 \type{\input} 或 \type{\environment} 命令在 \type{text} 环境之前将其载入。例如
+
+\starttyping[option=TEX]
+\environment book-style % 载入book-style.tex
+\starttext
+% ... ... ...
+\stoptext
+\stoptyping
+
+\section{目录}
+
+\type{\placecontent} 可将全文章节标题及其所在页码等信息汇总为一个列表,以方便读者查阅。例如
+
+\starttyping[option=TEX]
+\usemodule[visual]
+\starttext
+\title{\fakewords{3}{5}}
+\placecontent
+\section{\fakewords{3}{5}}
+... ... ...
+\section{\fakewords{3}{5}}
+... ... ...
+\stoptext
+\stoptyping
+\midaligned{%
+ \clip[width=\textwidth,height=6cm,voffset=3cm]{%
+ \externalfigure[14/toc.pdf][width=\textwidth,frame=on]%
+ }%
+}
+
+使用 \type{\setupcombinedlist} 可设定目录样式,例如设定可在目录中出现的标题级别以及列表样式。若得到常见的目录样式,只需作以下设定:
+
+\starttyping[option=TEX]
+\setupcombinedlist[content][alternative=c]
+\stoptyping
+\midaligned{%
+ \clip[width=\textwidth,height=6cm,voffset=3cm]{%
+ \externalfigure[14/toc-2.pdf][width=\textwidth,frame=on]%
+ }%
+}
+\blank
+\noindent 目录列表样式参数 \type{alternative} 有 \type{a},\type{b},\type{c},\type{d} 四个值可选,默认是 \type{b}。本文档目录使用的是 \type{d}。
+
+\type{\setupcombinedlist} 亦可用于指定可出现在目录列表中的标题级别,例如
+
+\starttyping[option=TEX]
+\setupcombinedlist[content][list={chapter,section}]
+\stoptyping
+
+注意,当 \type{\placecontent} 出现在 \type{\chapter} 之后时,生成的目录仅针对该章之内的各节。若是写书,需将 \type{\placecontent} 放在 \type{frontmatter} 环境,例如:
+
+\starttyping[option=TEX]
+\startfrontmatter
+\title{目录}
+\placecontent
+\stopfrontmatter
+\stoptyping
+
+\noindent 可对全篇被列入目录列表的章节生成目录。
+
+使用 \type{\setuplist} 可对出现在目录列表中相应级别的标题样式分别予以设定,例如
+
+\starttyping[option=TEX]
+\setuplist[chapter]
+ [alternative=a,
+ before={\blank[halfline]},after={\blank[halfline]},style=bold]
+\setuplist[section]
+ [alternative=d,style=normal,pagestyle=smallbold]
+\stoptyping
+
+\section{让无编号标题进入目录}
+
+\CONTEXT\ 默认不允许无编号标题出现在目录中,但是倘若对无编号标题,例如 \type{\title} 作以下设定
+
+\starttyping[option=TEX]
+\setuphead[title][incrementnumber=list]
+\stoptyping
+
+\noindent 之后便可将 \type{\title} 添加到目录列表,即
+
+\starttyping[option=TEX]
+\setupcombinedlist[content][list={title,chapter,section}]
+\stoptyping
+
+需要注意的是,在 \type{frontmatter} 环境中放置目录列表时,若使用以下代码
+
+\starttyping[option=TEX]
+\startfrontmatter
+\title{目录}
+\placecontent
+\stopfrontmatter
+\stoptyping
+
+\noindent 由于此时 \type{\title} 已被列入目录列表,因此 \type{\title{目录}} 本身会出现在目录列表中。为避免这一问题,需要为目录页单独定义一个标题。\CONTEXT\ 支持我们定义自己的标题,例如
+
+\starttyping[option=TEX]
+\definehead[TOC][title]
+\stoptyping
+
+\noindent 定义了一个新的标题 \type{\TOC},它与 \type{\title} 的样式相同。在 \type{frontmatter} 环境中使用 \type{\TOC}:
+
+\starttyping[option=TEX]
+\startfrontmatter
+\TOC{目录}
+\placecontent
+\stopfrontmatter
+\stoptyping
+
+\noindent 由于我们并未将 \type{\TOC} 列入目录列表,因此上述问题得以解决。
+
+\section{书签}
+
+对于内容较多的 PDF 文档,提供书签(Bookmark)可更加便于他人阅读。书签通常显示于 PDF 阅读器的侧栏,如图 \in[13-bookmarks] 所示,点击某个书签便可跳转至其关联的页面。
+
+\placefigure[here][13-bookmarks]{PDF 书签}{\externalfigure[14/bookmarks.png][width=.6\textwidth]}
+
+为 \ConTeXt\ 生成的 PDF 文件制作书签,非常简单,只需在样式文件中添加以下语句,
+
+\starttyping[option=TEX]
+\setupinteraction[state=start,focus=standard]
+\setupinteractionscreen[option=bookmark]
+\placebookmarks[title,chapter,section][title,chapter]
+\stoptyping
+
+\noindent 其中,\type{\setupinteraction} 用于开启 PDF 的用户交互特性。\type{\setupinteractionscreen} 用于设定 PDF 文件被阅读器打开后,以何种形式如何呈现在屏幕上,若其 \type{option} 值为 \type{bookmark},则文件打开后,会自动开启阅读器的侧边栏并显示书签;若设置 \type{option} 为 \type{max},则文件在被打开后会全屏显示。上述 \type{\placebookmarks} 语句的用途是设置可出现在书签栏的标题级别,且仅允许 \type{\title} 和 \type{\chapter} 级别的标题,其子标题列表可被展开。
+
+需要注意的是,\CONTEXT\ 同样默认无编号标题不被列入书签,但是倘若做以下设定
+
+\starttyping[option=TEX]
+\setuphead[title][incrementnumber=list]
+\stoptyping
+
+\noindent 则 \type{\title} 亦可出现在书签列表中。
+
+还需要注意一点, 书签功能取决于你所用的 PDF 阅读器是否支持。此外,你的 PDF 阅读器可能会将 \ConTeXt\ 生成的书签视为索引(Index),而其本身则提供了另一个叫作书签的功能,允许用户手动在侧边栏为文档的某一页建立链接,与 \CONTEXT\ 的书签原理相同。
+
+\section[reference]{引用}
+
+在本文档的插图、表格、数学公式等章节中,已简略介绍了 \CONTEXT\ 引用的用法。\CONTEXT\ 的标题和列表也支持引用。例如,本节的标题对应的排版命令是
+
+\starttyping[option=TEX]
+\section[reference]{引用}
+\stoptyping
+
+可以在文章几乎任何一个位置,像下面这样引用本节:
+
+\starttyping[option=TEX]
+我在 \at[reference] 页 \in[reference] 节\about[reference]中的一些内容。
+\stoptyping
+
+\noindent 结果为
+\blank[line]
+\blueframed{我引用了本文档 \at[reference] 页 \in[reference] 节\about[reference]中的一些内容。}
+\blank[line]
+
+使用 \type{\textreference} 可在文档几乎任何位置插入引用。例如
+
+\starttyping[option=TEX]
+我在此处放置了一个引用\textreference[myref]{一个引用}。
+\stoptyping
+\blank[line]
+\blueframed{我在此处放置了一个引用\textreference[myref]{一个引用}。}
+\blank[line]
+\noindent 注意,一个引用,其内容是不会显示在排版结果中的。然后在文档某处使用该引用,
+
+\starttyping[option=TEX]
+我在此处使用一个引用,它是 \at[myref] 的「\in[myref]」。
+\stoptyping
+\blank[line]
+\blueframed{我在此处使用一个引用,它是第 \at[myref] 页的「\in[myref]」。}
+\blank[line]
+
+如果你希望一个引用,其内容不仅出现在排版结果中,且想给他加个外框,只需定义一个宏来帮助你实现这一需求。例如
+
+\starttyping[option=TEX]
+\def\framedref[#1]#2{\inframed{#2}\textreference[#1]{#2}}
+\stoptyping
+\starttyping[option=TEX]
+我在此处放置了一个引用\textreference[myref]{一个引用}。
+\stoptyping
+\blank[line]
+\def\framedref[#1]#2{\inframed{#2}\textreference[#1]{#2}}
+\blueframed{我在此处放置了\framedref[myref]{一个引用}。}
+\blank[line]
+
+\section{索引}
+
+索引通常放在 \type{backmatter} 环境,即附在书的正文之后,
+
+\starttyping[option=TEX]
+\startbackmatter
+\title{索引}
+\placeindex
+\stopbackmatter
+\stoptyping
+
+\noindent 以便检索在正文某页检索一些关键词这些关键词在正文中需由 \type{\index} 给出。例如
+
+\starttyping[option=TEX]
+我在此演示 \type{\placeindex}\index[placeindex]{\type{\placeindex}}
+和 \type{\index}\index[index]{\type{\index}} 的用法。
+\stoptyping
+\blank[line]
+\blueframed{我在此演示 \type{\placeindex}\index[placeindex]{\type{\placeindex}} 和 \type{\index}\index[index]{\type{\index}} 的用法。}
+\blank[line]
+
+\noindent \tex{placeindex} 产生的结果为
+
+\blank[line]
+\blueframed{\placeindex}
+\blank[line]
+
+\section{小结}
+
+用 \CONTEXT\ 排版一本书并不难,难的是书该如何写。 \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bib-style.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bib-style.tex
index 3aac77b6dc8..e02c8a96911 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bib-style.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bib-style.tex
@@ -1,10 +1,14 @@
\setupbtxlist
[default]
- [starter={[},stopper={]},
- width=fit,
- distance=.5em,
- before={\blank[.25em]},
- after={\blank[.25em]},]
+ [align={normal,verytolerant,stretch},
+ before={\blank[quarterline]},after={\blank[quarterline]},
+ numberalign=middle,
+ width=2.5em] % width 居然列表编号宽度,若设为 fit,则列表内容左侧不齐
+
+\definebtx
+ [default:list:numbering]
+ [default:list]
+ [left={[},right={]}]
\setupbtx
[default:list:author]
@@ -35,8 +39,8 @@
\stopsetups
\starttexdefinition btx:default:url
- \goto{\hyphenatedurl{\btxflush{url}}}
- [url(\btxflush{url})]
+ 「\underbar{\goto{\hyphenatedurl{\btxflush{url}}}
+ [url(\btxflush{url})]}」
\stoptexdefinition
\starttexdefinition btx:default:author
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex
index 57c033c6318..e266595d81f 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex
@@ -70,7 +70,7 @@ draw p withcolor \MPcolor{lightsteelblue};
\blank[1cm]
\hfil\bfa 李延瑞\hfil
\blank[.25cm]
- \hfil\bf 2023 年 3 月 29 日\hfil
+ \hfil\bf 2023 年 3 月 31 日\hfil
\stopcoverbox
\stopcolor
\blank[14cm]
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.bib b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.bib
index 5ce2928904d..66a643b58cb 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.bib
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.bib
@@ -16,13 +16,6 @@
year = {2017}
}
-@online{ctxnotes,
- author = {李延瑞},
- title = {\ConTeXt\ 学习笔记:Using MkIV},
- url = {http://mirrors.ctan.org/info/context-notes-zh-cn/ctxnotes.pdf},
- year = {2009}
-}
-
@online{bash-tutor,
author = {李延瑞},
title = {写给高年级小学生的《Bash》指南},
@@ -30,6 +23,13 @@
year = {2018}
}
+@online{texlive,
+ author = {TUG},
+ title = {\TEX\ Live},
+ url = {https://tug.org/texlive/},
+ year = {2023}
+}
+
@online{faking-text,
author = {Hans Hagen},
title = {Faking text and more},
@@ -98,4 +98,11 @@
title = {Math fonts},
url = {https://wiki.contextgarden.net/Math_fonts},
year = {2020}
+}
+
+@online{code-render,
+ author = {李延瑞},
+ title = {源码凸显},
+ url = {https://segmentfault.com/a/1190000043405105},
+ year = {2023}
} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex
index 7b4847b28cf..e1991b11e83 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex
@@ -3,14 +3,15 @@
\starttext
\startfrontmatter
\input cover
+\input license
\setuppagenumber[number=1]
\setupuserpagenumber[numberconversion=romannumerals]
\setups{FrontHeaderFooter}
\input preface % 自序
\TOC{目录}
-\definelistextra[page][before=\page]
-\placecontent[extras={page=10}] % 强行在第 10 章之前分页
+\placecontent
\stopfrontmatter
+
\startbodymatter
\setuppagenumber[number=1]
\setupuserpagenumber[numberconversion=number]
@@ -28,13 +29,17 @@
\input 11
\input 12
\input 13
+\input 14
+\input zhfonts
\stopbodymatter
+
\startbackmatter
\input postscript
-\stopbackmatter
-\startappendices
-\input zhfonts
\title{参考文献}
\placelistofpublications
+\stopbackmatter
+
+\startappendices
+\null
\stopappendices
\stoptext
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex
index c6fe8890fa2..66dba8f8bf9 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex
@@ -8,8 +8,8 @@
focus=standard,
color=darkblue,
title={ConTeXt 蹊径},
- author={李延瑞},
- keyword={TeX, ConTeXt, LMTX, MkIV, LuaTeX, LuaMetaTeX}]
+ author={李延瑞 (lyr.m2@live.cn)},
+ keyword={TeX, ConTeXt MkIV, ConTeXt LMTX, LuaTeX, LuaMetaTeX}]
% 书签
\setupinteractionscreen[option=bookmark]
\placebookmarks[title,chapter,section][chapter]
@@ -66,8 +66,9 @@
[section]
[alternative=d,
style=normal,
+ numberstyle=bold,
pagecommand=\PageNumber,
- pagestyle=smallbold]
+ pagestyle=smallitalic]
% 页眉:通用
\startsetups HeaderFooter
@@ -96,9 +97,9 @@
\setupnotation[footnote][way=bypage] % 来自 wolfgang 的 tip
% 汉化
-\setuplabeltext[en][chapter={第\;,\;章\kern.5em}]
-\setuplabeltext[en][figure=图\;]
-\setuplabeltext[en][table=表\;]
+\setuplabeltext[en][chapter={第 , 章\kern.5em}]
+\setuplabeltext[en][figure={图 }]
+\setuplabeltext[en][table={表 }]
\setupheadtext[en][pubs={\bfc 参考文献}]
\setupheadtext[en][content={\bfc 目录}]
%---- 列表 ----
@@ -110,7 +111,10 @@
\definedescription
[definition]
[location=top,hang=20,width=broad,indenting=always,style=\ss,headstyle=\bf]
-
+% 表格标题
+\setupcaption
+ [table]
+ [headstyle=normal,style=small,location=top]
% 抄录
\setuplinenumbering[style=small]
@@ -132,11 +136,7 @@ draw q withcolor \MPcolor{lightsteelblue};
[frame=off,background={blue box},
offset=0pt,loffset=.5em,roffset=.5em,before={\blank},after={\blank[.95em]}]
\setuptyping
- [before={\startblueframe[width=\textwidth]},
- after={\stopblueframe},escape=yes]
-\definetyping
- [narrowtyping]
- [option=TEX,before={\startblueframe[width=fit]},after={\stopblueframe},escape=yes]
+ [before={\startblueframe[width=\textwidth]},after={\stopblueframe},escape=yes]
\startuniqueMPgraphic{blue box2}
path p;
@@ -168,17 +168,44 @@ draw p randomized s withcolor \MPcolor{lightsteelblue};
\inframed[frame=off,background=color,backgroundcolor=indianred,offset=4pt]{#1}%
}
-% sample
+% ---------- sample ----------------------
+\definebuffer[sample]
\definefloat[Sample][Samples]
-\setuplabeltext[en][Sample={示例\;}]
-\definebuffer[samplecode]
-\def\mysample[#1]#2#3{%
- \placeSample[force][#1]{#2}{%
+\setuplabeltext[en][Sample={示例 }]
+
+% 参数为一个放在页面右侧的盒子,基于该盒子的宽度,计算其左侧空间宽度
+\def\defineLeftWidth#1{%
+ \newdimen\LeftWidth
+ \LeftWidth=\textwidth
+ \newdimen\RightObjectWidth
+ \RightObjectWidth=\wd#1
+ \ifdim\RightObjectWidth>0pt
+ \advance\LeftWidth by -\RightObjectWidth
+ \advance\LeftWidth by -1em
+ \fi
+}
+\def\sample[#1][#2]#3#4{%
+ \setbox\scratchbox\hbox{#4}%
+ \defineLeftWidth{\scratchbox}%
+ \placeSample[here][#2]{#3}{%
\hbox to \textwidth{%
- \hbox to .45\textwidth{\getsamplecode}\hfill\externalfigure[#3][maxwidth=.45\textwidth]%
- }%
+ \hbox{\typesample[#1,
+ before={\startblueframe[width=\LeftWidth]},
+ after={\stopblueframe}]}\hss\unhbox\scratchbox}%
}%
}
+\def\simplesample[#1]#2{%
+ \setbox\scratchbox\hbox{#2}%
+ \defineLeftWidth{\scratchbox}%
+ \placeSample[here,none][]{}{%
+ \hbox to \textwidth{%
+ \hbox{\typesample[#1,
+ before={\startblueframe[width=\LeftWidth]},
+ after={\stopblueframe}]}\hss\unhbox\scratchbox}%
+ }%
+ \blank[back]
+}
+
% 修改 MPcode 代码部分高亮颜色
\definestartstop
[MetapostSnippetName]
@@ -193,4 +220,4 @@ draw p randomized s withcolor \MPcolor{lightsteelblue};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 参考文献 GB
\input bib-style
-\stopenvironment \ No newline at end of file
+\stopenvironment
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cmd-window.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/cmd-window.png
index 81629fcb6ef..81629fcb6ef 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cmd-window.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/cmd-window.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/foo.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/foo.pdf
index 0da6514b9f1..0da6514b9f1 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/foo.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/foo.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/win-r.jpg b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/win-r.jpg
index b33d05417ad..b33d05417ad 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/win-r.jpg
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/01/win-r.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/aligned-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/aligned-1.pdf
index e7c5b46d7c9..e7c5b46d7c9 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/aligned-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/aligned-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/aligned-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/aligned-2.pdf
index 8f52afbeee6..8f52afbeee6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/aligned-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/aligned-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fakewords.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/fakewords.pdf
index 8170c00d847..8170c00d847 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fakewords.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/fakewords.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/letter.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/letter.pdf
index 9a2aa7345d0..9a2aa7345d0 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/letter.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/letter.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/lines.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/lines.pdf
index b5445178d10..b5445178d10 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/lines.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/lines.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/parindentcolor.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/parindentcolor.pdf
index 36f765a403d..36f765a403d 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/parindentcolor.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/parindentcolor.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-2.pdf
index 36512005804..36512005804 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-3.pdf
index efb7228ddb0..efb7228ddb0 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-4.pdf
index 795bd8b5b40..795bd8b5b40 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-5.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-5.pdf
index 45ed389aebf..45ed389aebf 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars-5.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars-5.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars.pdf
index 1db69657522..1db69657522 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pars.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/pars.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/starting-area.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/starting-area.pdf
index 40598ce3da4..40598ce3da4 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/starting-area.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/starting-area.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/true-words.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/true-words.pdf
index 0faf5af1e30..0faf5af1e30 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/true-words.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/02/true-words.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bad-latin.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/bad-latin.pdf
index 34bf4d40d71..34bf4d40d71 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bad-latin.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/bad-latin.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-1.pdf
index 00d0481dcd3..00d0481dcd3 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-2.pdf
index 0c53fb84bd1..0c53fb84bd1 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-3.pdf
index 5c09f0bd80a..5c09f0bd80a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-4.pdf
index c79c91dd5e6..c79c91dd5e6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-5.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-5.pdf
index d7c29695f34..d7c29695f34 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/breakinglines-5.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/breakinglines-5.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/defaultfonts.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/defaultfonts.pdf
index 0a2af2b0ca5..0a2af2b0ca5 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/defaultfonts.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/defaultfonts.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fallbacks.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/fallbacks.pdf
index 599fe4e0887..599fe4e0887 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fallbacks.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/fallbacks.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fontsize-level.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/fontsize-level.pdf
index 91c34eab9b5..91c34eab9b5 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/fontsize-level.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/fontsize-level.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/indenting-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/indenting-1.pdf
index 52333e11b76..52333e11b76 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/indenting-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/indenting-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/indenting-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/indenting-2.pdf
index be10c57825b..be10c57825b 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/indenting-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/indenting-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/msfonts.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/msfonts.png
index a1e05840f5a..a1e05840f5a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/msfonts.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/msfonts.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/qian.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/qian.pdf
index 461e463a48e..461e463a48e 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/qian.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/qian.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/setupbodyfont.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/setupbodyfont.pdf
index 9086488f21b..9086488f21b 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/setupbodyfont.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/setupbodyfont.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/tex-root.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/tex-root.png
index 0a7d60fbd1a..0a7d60fbd1a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/tex-root.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/03/tex-root.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pagenumber.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/pagenumber.png
index 16906a2736a..16906a2736a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/pagenumber.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/pagenumber.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/style-file.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/style-file.png
index 1612428c773..1612428c773 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/style-file.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/style-file.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-2.pdf
index dafa5e5f8b6..dafa5e5f8b6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-3.pdf
index ede9539c350..ede9539c350 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-4.pdf
index 595fad74e96..595fad74e96 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-5.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-5.pdf
index 5dec6e3ec1c..5dec6e3ec1c 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu-5.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu-5.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu.pdf
index b40135449a7..b40135449a7 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zaoshu.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/04/zaoshu.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-2.pdf
index 355e2722a73..355e2722a73 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-3.pdf
index 8476132bf84..8476132bf84 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-4.pdf
index 2c8ecf2d794..2c8ecf2d794 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-5.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-5.pdf
index 4633d66ca49..4633d66ca49 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-5.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-5.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-6.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-6.pdf
index 162f257cb5a..162f257cb5a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-6.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-6.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-7.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-7.pdf
index 7bce0357e28..7bce0357e28 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-7.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-7.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-8.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-8.pdf
index 12cabf988f6..12cabf988f6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list-8.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list-8.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list.pdf
index 40a311e607e..40a311e607e 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-todo-list.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05/todo-list.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-05.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-05.pdf
deleted file mode 100644
index f622fb5a850..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-05.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-01.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-01.pdf
index b58373132e6..b58373132e6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-01.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-01.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-02.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-02.pdf
index 43adbf2577a..43adbf2577a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-02.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-02.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-03.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-03.pdf
index 28e3443a8d5..28e3443a8d5 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-03.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-03.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-04.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-04.pdf
index 279e7212f00..279e7212f00 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10-bibtex-example-04.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06/bibtex-example-04.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ctxnotes-2.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/ctxnotes-2.png
index 11190a179d0..11190a179d0 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ctxnotes-2.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/ctxnotes-2.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ctxnotes.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/ctxnotes.png
index faaf5634320..faaf5634320 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ctxnotes.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/ctxnotes.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-2.pdf
index 801ec7b83dc..801ec7b83dc 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-3.pdf
index 5ba88c0db7a..5ba88c0db7a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-4.pdf
index 8a1efdd6ecf..8a1efdd6ecf 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb.pdf
index 60e2a8572f5..60e2a8572f5 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-floatcomb.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/floatcomb.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-1.pdf
index 9f7ba941b73..9f7ba941b73 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-2.pdf
index 47b7d5728e9..47b7d5728e9 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-3.pdf
index 4a780c6814b..4a780c6814b 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert.pdf
index 627236d1010..627236d1010 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hibert.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/hibert.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-metapost.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/metapost.pdf
index 5b8683edee7..5b8683edee7 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/05-metapost.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08/metapost.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-01.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/01.pdf
index 334748a68d2..334748a68d2 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-01.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/01.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-02.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/02.pdf
index b28053808fd..b28053808fd 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-02.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/02.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-03.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/03.pdf
index 2b790a5def1..2b790a5def1 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-03.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/03.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-04.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/04.pdf
index fec31050253..fec31050253 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-04.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/04.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-three-line-table.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/three-line-table.pdf
index ac000edc791..ac000edc791 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/06-three-line-table.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/09/three-line-table.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10/colors.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10/colors.png
new file mode 100644
index 00000000000..ee8a9182925
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/10/colors.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08-vbox-and-hbox.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11/vbox-and-hbox.pdf
index 243b337735f..243b337735f 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/08-vbox-and-hbox.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11/vbox-and-hbox.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-1.pdf
index 54e71e8a71c..54e71e8a71c 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-2.pdf
index 3567cae7089..3567cae7089 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-3.pdf
index cf06b847eb6..cf06b847eb6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-4.pdf
index 5a1e6a2d8e6..5a1e6a2d8e6 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-flowchart-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/flowchart-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-watermark.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/watermark.png
index 4e689c338cb..4e689c338cb 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/11-watermark.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12/watermark.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ConTeXt-layout.svg b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/ConTeXt-layout.svg
index d50f52a0560..d50f52a0560 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/ConTeXt-layout.svg
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/ConTeXt-layout.svg
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-layout-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/layout-1.pdf
index 9bc70bc4caf..9bc70bc4caf 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-layout-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/layout-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/m_k_i_v_ConTeXt-layout_svg_c60ccda70ef92e32d7a6334f31c23259.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/m_k_i_v_ConTeXt-layout_svg_c60ccda70ef92e32d7a6334f31c23259.pdf
index 6b5a8ecb674..6ba65a0be2c 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/m_k_i_v_ConTeXt-layout_svg_c60ccda70ef92e32d7a6334f31c23259.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/m_k_i_v_ConTeXt-layout_svg_c60ccda70ef92e32d7a6334f31c23259.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-1.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-1.pdf
index 2485deadde8..2485deadde8 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-1.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-2.pdf
index 4b26477642a..4b26477642a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-3.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-3.pdf
index 28f9344b4fe..28f9344b4fe 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-3.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-4.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-4.pdf
index 8ceef2f8c95..8ceef2f8c95 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/12-slides-4.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-4.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/slides-finished.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-finished.pdf
index b49b06afcbe..b49b06afcbe 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/slides-finished.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides-finished.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/slides.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides.pdf
index 3d65bd5a281..3d65bd5a281 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/slides.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13/slides.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-bookmarks.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/bookmarks.png
index d11a152edc5..d11a152edc5 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-bookmarks.png
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/bookmarks.png
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-toc-2.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/toc-2.pdf
index 1329c57d270..1329c57d270 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-toc-2.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/toc-2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-toc.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/toc.pdf
index 60c2b9fbddd..60c2b9fbddd 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/13-toc.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/14/toc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bookmark.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bookmark.png
deleted file mode 100644
index 7dc8c6f060f..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/bookmark.png
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cow.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cow.pdf
deleted file mode 100644
index 2441faf74e7..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/cow.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/gardeninglion.jpg b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/gardeninglion.jpg
deleted file mode 100644
index 262d8e4c7fc..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/gardeninglion.jpg
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/header.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/header.png
deleted file mode 100644
index 04cd4ec1951..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/header.png
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hello.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hello.png
deleted file mode 100644
index 01b096bd203..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/hello.png
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/linux-terminal-icon.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/linux-terminal-icon.png
deleted file mode 100644
index 561da8dbb88..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/linux-terminal-icon.png
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/search.png b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/search.png
deleted file mode 100644
index 74e12ca6a2b..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/search.png
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-01.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/01.pdf
index 12e3519ae66..12e3519ae66 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-01.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/01.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-02.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/02.pdf
index f4795fec8cb..f4795fec8cb 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-02.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/02.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-03.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/03.pdf
index c1ccc3fcfc8..c1ccc3fcfc8 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts-03.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/03.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/none-zhfonts.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/none-zhfonts.pdf
index 5064281d405..5064281d405 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/none-zhfonts.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/none-zhfonts.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/zhfonts.pdf
index 8958d73fc36..8958d73fc36 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/figures/zhfonts/zhfonts.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/license.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/license.tex
new file mode 100644
index 00000000000..a2c21c225e3
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/license.tex
@@ -0,0 +1,12 @@
+\startstandardmakeup[align=center]
+{\tfd \CONTEXT\ 蹊径}
+\blank[2*line]
+{\tfa 李延瑞(lyr.m2@live.cn)}
+\blank[line]
+\useURL[ctx-notes][https://github.com/liyanrui/ConTeXt-notes]
+{\tfa 项目主页:\from[ctx-notes]}
+\vfill
+Copyright \copyright\ 2023 李延瑞
+\blank
+Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation.
+\stopstandardmakeup \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/postscript.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/postscript.tex
index da911d06687..815a3e71d85 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/postscript.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/postscript.tex
@@ -6,7 +6,7 @@
我还没有学会。
-这份文档所介绍的 \CONTEXT\ 知识或许尚不及它全部功能的百分之一,且 \CONTEXT\ 依然在发展着。学无止境,以我生之有涯随知识之无涯,这样不好。弱水三千,仅取一瓢饮,会好一些。
+这份文档所介绍的 \CONTEXT\ 知识或许尚不及它全部功能的百分之一,且 \CONTEXT\ 依然在发展着。学无止境,以生之有涯,随知识之无涯,这样不好。弱水三千,仅取一瓢饮,会好一些。
我应该去外面走走了,不然春天又悄悄离去了。
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/preface.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/preface.tex
index bc545f60ab6..efc49426767 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/preface.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/preface.tex
@@ -2,22 +2,22 @@
\useURL[王垠][https://www.yinwang.org]%[][\hyphenatedurl{https://www.yinwang.org}]
-我最早听闻并接触 \ConTeXt,大概是 2008 年在王垠\footnote{一个敢于自我否定的人,曾致力于在国内推广 GNU/Linux 和 \TEX,后来以其对计算机科学和编程语言设计的洞察而闻名,详见其个人主页 \bluebox{\from[王垠]}。}的个人主页上看到他对 \ConTeXt 的谥美之文。当时我猎奇心甚为严重,又觉得大家都在用的 \LaTeX\ 无法体现我的气质,便开始自学 \CONTEXT。或许这是年青人的通病。
+我最早听闻并接触 \CONTEXT,大概是 2008 年在王垠\footnote{一个敢于自我否定的人,曾致力于在国内推广 GNU/Linux 和 \TEX,后来以其对计算机科学和编程语言设计的洞察而闻名,详见其个人主页 \bluebox{\from[王垠]}。}的个人主页上看到他对 \CONTEXT 的谥美之文。当时我猎奇心甚为严重,又觉得大家都在用的 \LaTeX\ 无法体现我的气质,便开始自学 \CONTEXT。或许这是年青人的通病。
-现在,我已不再年青,却依然喜欢 \ConTeXt。曾经沧海难为水,或许这是人老了之后的通病,而我觉得更可能是因为 \CONTEXT\ 依然年青。2008 年,\CONTEXT\ 正处于从 Mk\Romannumerals{2} 版本向 Mk\Romannumerals{4} 版本跃迁期间。待 2019 年 MK\Romannumerals{4} 版本尘埃落定时,\CONTEXT\ 的开发者大刀阔斧,如火如荼,开启了下一个版本 \LMTX\cite[Hagen2019]的开发工作,至今方兴未艾。
+现在,我已不再年青,却依然喜欢 \CONTEXT。曾经沧海难为水,或许这是人老了之后的通病,而我觉得更可能是因为 \CONTEXT\ 依然年青。2008 年,\CONTEXT\ 正处于从 Mk\Romannumerals{2} 版本向 Mk\Romannumerals{4} 版本跃迁期间。待 2019 年 MK\Romannumerals{4} 版本尘埃落定时,\CONTEXT\ 的开发者大刀阔斧,如火如荼,开启了下一个版本 \LMTX\cite[Hagen2019]的开发工作,至今方兴未艾。
-任何工具,只要有人长时间维持和改进,便会趋向于复杂而难以被他人驾驭,但是它能胜任复杂的任务。\TEX\ 是复杂的,以它为基础的 Plain \TeX,\LaTeX\ 和 \ConTeXt\ 则更为复杂。事实上,并非工具趋向于变得复杂,而是任务趋向于变得复杂,更本质一些,是人心趋向于变得复杂。例如,使用 Markdown 之类的标记语言写散文类的文章,轻松愉快,这是近年来 Markdown 广泛用于网文创作的主要原因。倘若用 Markdown 写一本含有许多插图、数学公式、表格、参考文献等内容的书籍,便需要为它增加许多功能,最终的结果相当于又重新发明了一次 \TeX。
+任何工具,只要有人长时间维持和改进,便会趋向于复杂而难以被他人驾驭,但是它能胜任复杂的任务。\TEX\ 是复杂的,以它为基础的 Plain \TeX,\LaTeX\ 和 \CONTEXT\ 则更为复杂。事实上,并非工具趋向于变得复杂,而是任务趋向于变得复杂,更本质一些,是人心趋向于变得复杂。例如,使用 Markdown 之类的标记语言写散文类的文章,轻松愉快,这是近年来 Markdown 广泛用于网文创作的主要原因。倘若用 Markdown 写一本含有许多插图、数学公式、表格、参考文献等内容的书籍,便需要为它增加许多功能,最终的结果相当于又重新发明了一次 \TeX。
-Plain \TeX,\LaTeX\ 和 \ConTeXt\ 虽然皆为构建在 \TeX\ 系统上的宏包,但是国内熟悉前两者的人数远多于 \ConTeXt,究其原因,我觉得是因为 \ConTeXt\ 入门文档甚少,其中中文文档则更为罕见。\ConTeXt\ 创始人兼主要开发者 Hans Hagen 为 \ConTeXt\ 撰写了一份内容全面、排版精美的英文版入门文档\cite[ma-cb-en],对于具备一些英文阅读能力的人,原本可从该文档入门,但遗憾的是,除非读者知道如何在 \ConTeXt\ 中使用汉字(也包括日、韩文字)字体,否则所学知识仅能用于英文排版。
+Plain \TeX,\LaTeX\ 和 \CONTEXT\ 虽然皆为构建在 \TeX\ 系统上的宏包,但是国内熟悉前两者的人数远多于 \CONTEXT,究其原因,我觉得是因为 \CONTEXT\ 入门文档甚少,其中中文文档则更为罕见。\CONTEXT\ 创始人兼主要开发者 Hans Hagen 为 \CONTEXT\ 撰写了一份内容全面、排版精美的英文版入门文档\cite[ma-cb-en],对于具备一些英文阅读能力的人,原本可从该文档入门,但遗憾的是,除非读者知道如何在 \CONTEXT\ 中使用汉字(也包括日、韩文字)字体,否则所学知识仅能用于英文排版。
\useURL[ctan][https://ctan.org]
-我曾于 2009 年写过一份 \ConTeXt 学习笔记\cite[ctxnotes],介绍了在 \ConTeXt\ Mk\Romannumerals{4} 中如何加载汉字字体以及基本的 \ConTeXt\ 排版命令的用法,内容颇为粗陋,由 CTeX 论坛里的朋友整合至 ctex-doc 项目并打包呈交 \bluebox{\from[ctan]} 网站。2011 年夏天曾许诺将我发布于网络上的一些相关文章合并至该笔记,但因俗务缠身,后来兴趣又有漂移,便不了了之。
+我曾于 2009 年写过一份 \CONTEXT 学习笔记,介绍了在 \CONTEXT\ Mk\Romannumerals{4} 中如何加载汉字字体以及基本的 \CONTEXT\ 排版命令的用法,内容颇为粗陋,由 CTeX 论坛里的朋友整合至 ctex-doc 项目并打包呈交 \bluebox{\from[ctan]} 网站。2011 年夏天曾许诺将我发布于网络上的一些相关文章合并至该笔记,但因俗务缠身,后来兴趣又有漂移,便不了了之。
-光阴荏苒,时过境迁,当年曾在 CTeX 论坛一起折腾 \TeX\ 的朋友大多已不知所踪——在他们看来,我亦如是。2018 年,CTeX 论坛因国内日益严厉的互联网监管政策被迫无限期关闭,导致国内 \TeX\ 学习、研究和使用热情似乎遭受了毁灭性打击,爱好者们离散江湖,白头宫女在,闲坐说玄宗。现在,若学习 \LaTeX\ 尚能找到一些讨论区,而 \ConTeXt\ 似乎再也无人问津了。爱好终归属于自己。即使现在国内只有我一个人还在喜欢 \ConTeXt,依然应当为自己写一份新的 \ConTeXt\ 学习笔记,以偿旧诺。
+光阴荏苒,时过境迁,当年曾在 CTeX 论坛一起折腾 \TeX\ 的朋友大多已不知所踪——在他们看来,我亦如是。2018 年,CTeX 论坛因国内日益严厉的互联网监管政策被迫无限期关闭,导致国内 \TeX\ 学习、研究和使用热情似乎遭受了毁灭性打击,爱好者们离散江湖,白头宫女在,闲坐说玄宗。现在,若学习 \LaTeX\ 尚能找到一些讨论区,而 \CONTEXT\ 似乎再也无人问津了。爱好终归属于自己。即使现在国内只有我一个人还在喜欢 \CONTEXT,依然应当为自己写一份新的 \CONTEXT\ 学习笔记,以偿旧诺。
值此情境,需篡改古词一阙,歌以咏志:芦叶满汀洲,寒沙带浅流,二十年重过南楼。欲买桂花同载酒,终不负,少年游。
\vfill
\startalignment[flushright,broad]
-2023 年 3 月写于乡下老家
+2023 年 3 月写于山东郯城乡下老家
\stopalignment \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex
index b2fa8d7bb1f..00ff1399b08 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex
@@ -1,8 +1,8 @@
-\title{zhfonts 模块}
+\chapter{需要 zhfonts 吗?}
-基于第 \in[chinese-fonts] 章介绍的汉字字体的设定方法,使用 \CONTEXT\ 足以排版中文文档,但是存在汉字标点符号的间距过大且无法与正文左右边界对齐等问题。若你对此无法忍受,可以考虑使用我写的 zhfonts 模块。
+基于第 \in[chinese-fonts] 章介绍的汉字字体的设定方法,使用 \CONTEXT\ 足以排版中文文档,但是存在汉字标点符号的间距过大且无法与正文左右边界对齐等问题。若你对此无法忍受,可以考虑使用我写的 zhfonts 模块,另外该模块显著简化了中文字体的设定。
-\section{标点间距微调}
+\section{zhfonts 初印象}
根据现在你已经掌握的 \CONTEXT\ 知识,理解以下代码,想必已不在话下:
@@ -37,11 +37,13 @@
若认真对比图 \in[none-zhfonts] 和图 \in[zhfonts] 中的标点符号的排版结果,则不难发现 zhfonts 模块解决的问题是标点间距微调。
\placefigure[here][none-zhfonts]{未使用 zhfonts 的中文标点排版效果}{%
- \clip[width=\textwidth,height=5cm,voffset=1.8cm]{\externalfigure[none-zhfonts.pdf][width=\textwidth]}}
+ \clip[width=\textwidth,height=5cm,voffset=1.8cm]{%
+ \externalfigure[zhfonts/none-zhfonts.pdf][width=\textwidth]}}
\placefigure[here][zhfonts]{使用 zhfonts 的中文标点排版结果}{%
- \clip[width=\textwidth,height=4.25cm,voffset=1.8cm]{\externalfigure[zhfonts.pdf][width=\textwidth]}}
+ \clip[width=\textwidth,height=4.25cm,voffset=1.8cm]{%
+ \externalfigure[zhfonts/zhfonts.pdf][width=\textwidth]}}
-\section{安装 zhfonts 模块}
+\section{安装 zhfonts}
\useURL[zhfonts][https://github.com/liyanrui/zhfonts/archive/refs/heads/master.zip]
下载 zhfonts-master.zip 包,网络链接为\\
@@ -72,7 +74,7 @@ zhfonts 默认使用 11 pt 正体字(宋体 + Latin Modern Serif)作为正
我能吞下玻璃而不伤身体。I can eat glass, it does not hurt me.
\stopTEXpage
\stoptyping
-\placefigure[none]{}{\externalfigure[zhfonts-01.pdf]}
+\placefigure[none]{}{\externalfigure[zhfonts/01.pdf]}
使用模块参数 \type{style=ss} 或 \type{style=tt},可将正文字体切换为模块参数 \type{size} 所设定大小的无衬线字体或等宽字体。例如
@@ -83,7 +85,7 @@ zhfonts 默认使用 11 pt 正体字(宋体 + Latin Modern Serif)作为正
我能吞下玻璃而不伤身体。I can eat glass, it does not hurt me.
\stopTEXpage
\stoptyping
-\placefigure[none]{}{\externalfigure[zhfonts-02.pdf]}
+\placefigure[none]{}{\externalfigure[zhfonts/02.pdf]}
\section{\type{\setupzhfonts}}
@@ -139,7 +141,7 @@ zhfonts 并未使用汉字字体中的西文字形,而是是将汉字字体作
\bf 这是汉字,These are English characters.
\stopTEXpage
\stoptyping
-\placefigure[none]{}{\externalfigure[zhfonts-03.pdf]}
+\placefigure[none]{}{\externalfigure[zhfonts/03.pdf]}
\section{小结}