├── Makefile ├── NEWS ├── README ├── artwork ├── 0cover-l.png ├── 0cover.png ├── 0watchrock-l.png ├── 0watchrock.png ├── README ├── ch01-usingbook-l.png ├── ch01-usingbook.png ├── ch02-usingtex-l.png ├── ch02-usingtex.png ├── ch03-examples-l.png ├── ch03-examples.png ├── ch04-concepts-l.png ├── ch04-concepts.png ├── ch05-para-l.png ├── ch05-para.png ├── ch06-pages-l.png ├── ch06-pages.png ├── ch07-horizvert-l.png ├── ch07-horizvert.png ├── ch08-math-l.png ├── ch08-math.png ├── ch09-general-l.png ├── ch09-general.png ├── ch10-tips-l.png ├── ch10-tips.png ├── ch11-errors-l.png ├── ch11-errors.png ├── ch12-compendium-l.png ├── ch12-compendium.png ├── ch13-summary-l.png └── ch13-summary.png ├── backm.tex ├── book.tex ├── capsule.tex ├── concepts.tex ├── config.tex ├── copyrght.tex ├── eplain.tex ├── eplain3.tex ├── errata.future ├── errors.tex ├── examples.tex ├── fdl.tex ├── fonts.tex ├── frontm.tex ├── genops.tex ├── index.tex ├── index1.icn ├── index2.icn ├── macros.tex ├── math.tex ├── modes.tex ├── pages.tex ├── paras.tex ├── preface.tex ├── read1st.tex ├── tips.tex ├── usebook.tex ├── usermacs.tex ├── usingtex.tex ├── xeCJK-base.tex └── xmptext.tex /Makefile: -------------------------------------------------------------------------------- 1 | # public domain 2 | all: book.dvi book.pdf #book.html 3 | 4 | book.dvi: fdl.tex preface.tex 5 | tex '\nonstopmode\input book' 6 | book.pdf: fdl.tex preface.tex 7 | pdftex '\nonstopmode\input book' 8 | book.html: 9 | httex book.tex 10 | 11 | dist: all 12 | rm -f x.tex 13 | tar czf impatient.tgz Makefile README *.icn \ 14 | *.tex book.aux book.idx book.toc book.ccs book.sdx \ 15 | book.dvi book.pdf 16 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | $Id: NEWS,v 1.3 2014/11/13 17:07:59 karl Exp $ 2 | This NEWS file records noteworthy changes, very tersely. 3 | 4 | Copyright 2013, 2014 Karl Berry. 5 | 6 | Copying and distribution of this file, with or without modification, 7 | are permitted in any medium without royalty provided the copyright 8 | notice and this notice are preserved. 9 | 10 | 11 | Version 2.4 (13 November 2014) 12 | - Chinese translation. 13 | - fixes from new Chinese translator, Zou Hu. 14 | 15 | Version 2.3 (21 May 2013) 16 | - first release on ftp.gnu.org. Now looking for a maintainer. 17 | - update to GFDLv1.3. 18 | - simple configure script and Makefile added. 19 | - no changes to the text. 20 | - There is now a `NEWS' file (this one), giving a history of 21 | user-visible changes. 22 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | $Id: README,v 1.5 2014/11/13 17:07:59 karl Exp $ 2 | This is the README file for the GNU (free documentation) edition of the 3 | book TeX for the Impatient, released under the GNU Free Documentation 4 | License. (This README file itself is public domain.) 5 | 6 | Primary distribution point: ftp://ftp.gnu.org/gnu/teximpatient/ 7 | automatic redirection: http://ftpmirror.gnu.org/teximpatient 8 | list of mirrors for manual selection: http://www.gnu.org/prep/ftp.html 9 | 10 | Home page: http://www.gnu.org/software/teximpatient/ 11 | 12 | Development sources, etc.: http://savannah.gnu.org/projects/teximpatient/ 13 | 14 | Information about the free edition is included at the end of the preface 15 | and on the copyright page. 16 | 17 | A French translation is included in the distribution, 18 | and a Chinese translation is at https://bitbucket.org/zohooo/impatient 19 | (with PDF at 20 | http://zoho.is-programmer.com/user_files/zoho/epics/tex-impatient-cn.pdf). 21 | 22 | Original high-resolution scans of the artwork are available from 23 | http://ftpmirror.gnu.org/teximpatient/artwork. Reduced-size bitmaps are 24 | in the artwork/ subdirectory here. 25 | 26 | 27 | Some random thoughts for people thinking of working with the source: 28 | 29 | - See errata.future for some relatively small ideas for enhancements. 30 | 31 | - You may want to translate the source into some more standard 32 | format, such as Texinfo; we used many homegrown macros mostly to make 33 | typing and markup easier. 34 | 35 | - You may also want to redo the index creation to use makeindex or some 36 | other standard program, instead of the homegrown Icon programs (or else 37 | they need to be fixed; right now somehow the + characters used for 38 | spaces in book.idx are preserved in book.sdx, which is wrong). Until 39 | the index can be easily regenerated, the page breaks can't change 40 | without the index becoming useless. 41 | 42 | - Printing the GFDL required many kludges, a true Eplain-compatible 43 | version is needed (which in turn would require using the current eplain 44 | to print the book). 45 | 46 | Happy TeXing. 47 | -------------------------------------------------------------------------------- /artwork/0cover-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/0cover-l.png -------------------------------------------------------------------------------- /artwork/0cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/0cover.png -------------------------------------------------------------------------------- /artwork/0watchrock-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/0watchrock-l.png -------------------------------------------------------------------------------- /artwork/0watchrock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/0watchrock.png -------------------------------------------------------------------------------- /artwork/README: -------------------------------------------------------------------------------- 1 | $Id: README,v 1.1 2011/01/27 22:16:26 karl Exp $ 2 | These original drawings by Kathryn Hargreaves are released under the 3 | GFDL, version 1.2 or later, just like the text of the book. 4 | 5 | Updates to the book source to incorporate these images would be very welcome. 6 | -------------------------------------------------------------------------------- /artwork/ch01-usingbook-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch01-usingbook-l.png -------------------------------------------------------------------------------- /artwork/ch01-usingbook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch01-usingbook.png -------------------------------------------------------------------------------- /artwork/ch02-usingtex-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch02-usingtex-l.png -------------------------------------------------------------------------------- /artwork/ch02-usingtex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch02-usingtex.png -------------------------------------------------------------------------------- /artwork/ch03-examples-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch03-examples-l.png -------------------------------------------------------------------------------- /artwork/ch03-examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch03-examples.png -------------------------------------------------------------------------------- /artwork/ch04-concepts-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch04-concepts-l.png -------------------------------------------------------------------------------- /artwork/ch04-concepts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch04-concepts.png -------------------------------------------------------------------------------- /artwork/ch05-para-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch05-para-l.png -------------------------------------------------------------------------------- /artwork/ch05-para.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch05-para.png -------------------------------------------------------------------------------- /artwork/ch06-pages-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch06-pages-l.png -------------------------------------------------------------------------------- /artwork/ch06-pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch06-pages.png -------------------------------------------------------------------------------- /artwork/ch07-horizvert-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch07-horizvert-l.png -------------------------------------------------------------------------------- /artwork/ch07-horizvert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch07-horizvert.png -------------------------------------------------------------------------------- /artwork/ch08-math-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch08-math-l.png -------------------------------------------------------------------------------- /artwork/ch08-math.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch08-math.png -------------------------------------------------------------------------------- /artwork/ch09-general-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch09-general-l.png -------------------------------------------------------------------------------- /artwork/ch09-general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch09-general.png -------------------------------------------------------------------------------- /artwork/ch10-tips-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch10-tips-l.png -------------------------------------------------------------------------------- /artwork/ch10-tips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch10-tips.png -------------------------------------------------------------------------------- /artwork/ch11-errors-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch11-errors-l.png -------------------------------------------------------------------------------- /artwork/ch11-errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch11-errors.png -------------------------------------------------------------------------------- /artwork/ch12-compendium-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch12-compendium-l.png -------------------------------------------------------------------------------- /artwork/ch12-compendium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch12-compendium.png -------------------------------------------------------------------------------- /artwork/ch13-summary-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch13-summary-l.png -------------------------------------------------------------------------------- /artwork/ch13-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/artwork/ch13-summary.png -------------------------------------------------------------------------------- /backm.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | % This is part of the book TeX for the Impatient. 3 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 4 | % See file fdl.tex for copying conditions. 5 | % 6 | % Backmatter. 7 | 8 | \input macros 9 | 10 | \ifcompletebook 11 | \noheadlinetrue\pagebreak 12 | \ifodd\pageno\else \noheadlinetrue\pagebreak \fi 13 | \fi 14 | 15 | \edgetabsfalse 16 | 17 | % About the authors. 18 | % 19 | \backsinkage 20 | %\leftline{\sectionfonts About the authors} 21 | \bookmark{1}{作者简介}% 22 | \leftline{\sectionfonts 作者简介} 23 | \vskip\belowsectionskip 24 | 25 | \noindent Paul W. Abrahams, Sc.D., CCP, is a consulting computer 26 | scientist and a past president of the Association for Computing 27 | Machinery. His specialties are programming languages, software systems 28 | design and implementation, and technical writing. He received his 29 | doctorate from the Massachusetts Institute of Technology in 1963 in 30 | mathematics, studying artificial intelligence under Marvin Minsky and 31 | John McCarthy. He is one of the designers of the first {\sc LISP} 32 | system and the designer of the {\sc CIMS PL/I} system, developed when he 33 | was a professor at New York University. More recently, he has designed 34 | {\sc SPLASH}, a Systems Programming LAnguage for Software Hackers. Paul 35 | resides in Deerfield, Massachusetts, where he writes, hacks, hikes, 36 | hunts wild mushrooms, and listens to classical music. 37 | 38 | Kathryn A. Hargreaves received her M.S. degree in computer science from 39 | the University of Massachusetts, Boston, in August 1989. Her 40 | specialities are digital typography and human vision. She developed a 41 | set of programs to produce high-quality, freely distributable digital 42 | type for the Free Software Foundation and also worked with 43 | Robert~A. Morris as an Adjunct Research Associate. In 1986 she completed 44 | the Reentry Program in Computer Science for Women and Minorities at the 45 | University of California at Berkeley, where she also worked in the \TeX\ 46 | research group under Michael Harrison. She has studied letterform design 47 | with Don Adleta, Andr\'e G\"urtler, and Christian Mengelt at the Rhode 48 | Island School of Design. A journeyman typographer, she has worked at 49 | Headliners\slash Identicolor, San Francisco, and Future Studio, Los 50 | Angeles, two leading typographical firms. She also holds an M.F.A. in 51 | Painting\slash Sculpture\slash Graphic Arts from the University of 52 | California at Los Angeles. Kathy paints watercolors, designs 53 | letterforms, plays piano, and reads feminist film criticism. 54 | 55 | Like Kathy, Karl Berry received his M.S. degree in computer science from 56 | the University of Massachusetts, Boston, in August 1989. He also 57 | worked for the Free Software Foundation, did research with Morris, 58 | and has studied with Adleta, G\"urtler, and Mengelt. He has been 59 | working with \TeX\ since 1983 and has installed and maintained the \TeX\ 60 | system at a number of universities. He was the maintainer of the Web2c 61 | system developed by Tim Morgan for a number of years, among other \TeX\ 62 | projects. He became the president of the \TeX\ Users Group in 2003. 63 | 64 | \noheadlinetrue\pagebreak 65 | 66 | 67 | % Colophon. 68 | % 69 | \backsinkage 70 | %\leftline{\sectionfonts Colophon} 71 | \bookmark{1}{书尾}% 72 | \leftline{\sectionfonts 书尾} 73 | \vskip\belowsectionskip 74 | 75 | \noindent This book was composed using \TeX\ (of course), developed by 76 | Donald~E. Knuth. The main text is set in Computer Modern, also designed 77 | by Knuth. The heads of the original book were set in Zapf Humanist (the 78 | Bitstream version of Optima), designed by Hermann Zapf. 79 | 80 | The paper was Amherst Ultra Matte 45 lb. The printing and binding were 81 | done by Arcadia Graphics-Halliday. The phototypeset output was produced 82 | at Type 2000,~Inc., in Mill Valley, California. Proofs were made on an 83 | Apple LaserWriter Plus and on a Hewlett Packard LaserJet~II\null. 84 | 85 | Cross-referencing, indexing, and the table of contents were done 86 | mechanically, using the macros of \chapterref{eplain} together with 87 | additional macros custom-written for this book. The production of the 88 | index was supported by an additional program written in Icon. 89 | 90 | 91 | \noheadlinetrue 92 | \iftrue 93 | \pagebreak 94 | \printconceptpage 95 | \fi 96 | 97 | \byebye 98 | -------------------------------------------------------------------------------- /book.tex: -------------------------------------------------------------------------------- 1 | % This is part of the book TeX for the Impatient. 2 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 3 | % See file fdl.tex for copying conditions. 4 | 5 | % Top-level control. 6 | % 7 | \input macros 8 | % Here we override part of the configuration 9 | % since we're doing a full run. 10 | \rewritetocfiletrue % always do a table of contents 11 | \xrefwarningtrue 12 | \completebooktrue 13 | \edgetabsfalse 14 | \includeartwork{0cover} 15 | \input frontm 16 | % (not for web) 17 | \edgetabstrue 18 | \settabdepth{\bigtab} 19 | \includeartwork{0watchrock} 20 | \input usebook 21 | \includeartwork{ch01-usingbook} 22 | \input usingtex 23 | \includeartwork{ch02-usingtex} 24 | \input examples 25 | \includeartwork{ch03-examples} 26 | \nextedgetab 27 | \input concepts 28 | \includeartwork{ch04-concepts} 29 | \nextedgetab 30 | \settabdepth{\smalltab} 31 | \input paras 32 | \includeartwork{ch05-para} 33 | \nextedgetab 34 | \input pages 35 | \includeartwork{ch06-pages} 36 | \nextedgetab 37 | \input modes 38 | \includeartwork{ch07-horizvert} 39 | \nextedgetab 40 | \input math 41 | \includeartwork{ch08-math} 42 | \nextedgetab 43 | \input genops 44 | \includeartwork{ch09-general} 45 | \nextedgetab 46 | \settabdepth{\bigtab} 47 | \input tips 48 | \includeartwork{ch10-tips} 49 | \input errors 50 | \includeartwork{ch11-errors} 51 | \input usermacs 52 | \includeartwork{ch12-compendium} 53 | \nextedgetab 54 | \input capsule 55 | \includeartwork{ch13-summary} 56 | \nextedgetab 57 | \backmatter 58 | \input fdl 59 | \input index 60 | \edgetabsfalse 61 | \input backm 62 | 63 | \bye 64 | -------------------------------------------------------------------------------- /config.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/tex-impatient-cn/e3cea2c4f278b80adb7fbf65f2ac311dfb88c1ac/config.tex -------------------------------------------------------------------------------- /copyrght.tex: -------------------------------------------------------------------------------- 1 | % This is part of the book TeX for the Impatient. 2 | % Copyright (C) 2003, 2013 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 3 | % See file fdl.tex for copying conditions. 4 | 5 | \input macros 6 | 7 | 8 | % Copyright page. 9 | % 10 | \noheadlinetrue 11 | \sinkage 12 | 13 | \noindent `\TeX' is a trademark of the American Mathematical Society. 14 | 15 | \noindent `\Metafont' is a trademark of Addison-Wesley Publishing Company. 16 | 17 | \bigskip 18 | \noindent This book, \thisbook, contains both tutorial and reference 19 | information on all features of both plain and primitive \TeX. 20 | 21 | \bigskip 22 | 23 | \noindent Copyright \copyright{} 2003, 2013 Paul~W. Abrahams, 24 | Kathryn~A. Hargreaves, and Karl Berry. 25 | 26 | \bigskip 27 | \noindent Permission is granted to copy, distribute and/or modify this 28 | document under the terms of the GNU Free Documentation License, Version 29 | 1.1 or any later version published by the Free Software Foundation; with 30 | no Invariant Sections, with no Front-Cover texts, and with no Back-Cover 31 | texts. A copy of the license is included in the chapter entitled ``GNU 32 | Free Documentation License''. 33 | 34 | \medskip\noindent 35 | Under the terms of the GFDL, anyone is allowed to modify and 36 | redistribute this material, and it is our hope that others will find it 37 | useful to do so. That includes translations, either to other natural 38 | languages, or to other computer source or output formats. 39 | 40 | \medskip\noindent 41 | In our interpretation of the GFDL, you may also extract text from this 42 | book for use in a new document, as long as the new document is also 43 | under the GFDL, and as long as proper credit is given (as provided for 44 | in the license). 45 | 46 | 47 | \pagebreak 48 | \byebye 49 | -------------------------------------------------------------------------------- /errata.future: -------------------------------------------------------------------------------- 1 | $Id: errata.future,v 1.2 2011/01/27 22:16:24 karl Exp $ 2 | 3 | Ideas for future changes. Did not make these in the free edition since 4 | I didn't want to change the page breaks because I didn't want to install 5 | Icon so I could regenerate the index -- aside from lack of time and 6 | inclination. :) See the README. 7 | 8 | 9 | - incorporate the images in the artwork/ subdirectory. 10 | 11 | - discuss CTAN, other Internet resources, plain or generic macro 12 | packages, and so on. 13 | 14 | - extend with descriptions of e-TeX, pdftex, omega. 15 | 16 | - html output, perhaps using tex2page. 17 | http://www.ccs.neu.edu/home/dorai/tex2page/tex2page-doc.html 18 | (tex4ht did nothing useful with it, but maybe with work ...) 19 | 20 | 21 | from Will Adams: 22 | 23 | - p. 105 (and throughout) the encoding for Zapf Dingbats doesn't 24 | agree w/ what was used and instead of a right pointing hand dingbat, a 25 | Star of David appears on the .pdf 26 | 27 | - p. 113 - text overlaps / crashes here, I think 'cause some stuff 28 | escaped out of Verbatim mode. 29 | 30 | - colophon - this appears on a verso, not a recto, which I find a bit odd. 31 | 32 | One last bit of consideration is how you want to handle the cover / 33 | frontmatter. 34 | 35 | 36 | from Karl and Kathy: 37 | 38 | * The default values should probably be in roman everywhere. I don't 39 | think `6pt plus 1pt minus 2pt' looks bad in roman any more, which was 40 | the original impetus for printing them in typewriter, as I recall. 41 | It is pretty random right now. (Numbers are usually printed in roman, 42 | for example.) 43 | 44 | * The index might look better printed without the commas after the term. 45 | Also, there should be some way to indicate usages of control sequences, 46 | as opposed to explanations. We could do what Knuth did, and print the 47 | entries in another font (typewriter would be appropriate, perhaps). We 48 | could also just have a subentry `examples' or `using' or something. 49 | 50 | * `\langle f' and `l\rangle' are too close. I don't know if the macros 51 | can be hacked to add more space for just those characters. 52 | 53 | * The way (short) lists are punctuated is inconsistent. In (at least) 54 | four places (pp.3,18,56,265) the items are capitalized and end with 55 | period. In most others (2,72,74,81,83,234) they are not capitalized and 56 | have no ending punctuation. And in two (76,238) they are not capitalized 57 | and end with a period. I realize that the same form is not always 58 | appropriate, but this is not true very often. Personally, I prefer a 59 | form like: 60 | 61 | \list 62 | \item item 1, 63 | \item item 2, 64 | \item last item. 65 | \endlist 66 | 67 | but whatever. 68 | 69 | * In most places where we say `.dvi' we aren't really talking about the 70 | file extension. `{\sc DVI}' would be more appropriate. 71 | 72 | * The Preface, Brief Contents, and Contents chapter opening pages start 73 | too high and too far to the left. This is probably a consequence of 74 | \chapter changing and \shortchapter not. 75 | 76 | 77 | (The rest of the changes are by page number.) 78 | 79 | 1 Section 13 is also designed to be accessed randomly. Also, wouldn't it 80 | be better to use section names as well as numbers? 81 | 82 | 7 (first para) local information tells you => local information will 83 | tell you, since they couldn't have found it yet. 84 | 85 | 9 (first para) by typing something => by first typing something, since 86 | they have to do more to input screed. 87 | (bottom) unclosed left parenthesis => unmatched left parenthesis. 88 | 89 | 10 The third in the subsection (with ``typeset me'') looks like it has 90 | extra space in it. 91 | 92 | 12 (bottom) supposed to produce => supposed to do, because the macro 93 | might not be supposed to produce anything at all. 94 | 95 | 16 Say that TeX does its own spacing in formulas. This is probably the 96 | most crucial fact about doing math in TeX. Index `spacing, in formulas' 97 | and `formulas, spacing in'. 98 | (math formulas) can appear in text ... or set off => can appear in 99 | text ... or can appear set off, for structure. 100 | enclose a text formula in => enclose a text formula within 101 | 102 | 17 (last para) The kind of entity TeX is assembling determines the mode 103 | it's in, it doesn't define it. I tend to think of it in the other 104 | direction: the mode TeX is in determines the entity TeX is assembling. 105 | 106 | 21 (last para) It would be clearer to actually define \xmpheader in the 107 | first example and then use it. As it is, it's not entirely clear which 108 | commands in the first example go into it. 109 | (bottom) is defined in plain TeX => is either a primitive or defined 110 | in plain TeX. 111 | 112 | 22 You use the en-dash in the place where an em-dash should be in the 113 | last sentence. 114 | 115 | 23 (three instances near the top) The comments should have periods at 116 | the end and be capitalized properly. We are remarkably inconsistent on 117 | this throughout. In some cases, the comments aren't complete sentences, 118 | so periods are unnecessary. But sometimes, as here, they are complete 119 | sentences, so we should have periods. And sometimes they're sentences 120 | and not capitalized. 121 | 122 | 24 If we didn't put space between these paragraphs, you would have a 123 | hard time => If we hadn't ..., you would have had ..., to remove the 124 | time warp. 125 | 126 | 25 % The left brace start => % The { starts, to shorten the line. 127 | (middle) % Skips like this => % Skips like that, because one of the 128 | skips was just given. 129 | 130 | 26 fonts won't give you => fonts don't give you 131 | page 100 and page 97 => pages 97 and 100 132 | 133 | 32 (bottom) try to use these commands => try to use those commands, 134 | since the commands are above the comment. 135 | Also, they can get lists with more levels than one by using the Eplain 136 | list stuff, instead of programming it themselves, alas. 137 | 138 | 34 The title might be better as `Using non-Computer Modern fonts' or 139 | something, since we haven't said what the first source is. 140 | 141 | 37 (towards the top) => Use \vtop for short multiline entries => Use 142 | \vtop to get whole paragraphs, since ``multiline entries'' is a pretty 143 | stupid term (that I wrote). 144 | (towards the bottom) % without the kern, the `f' and `l' would be too 145 | close => % Without the kern, the `f' and `l' would be a ligature. 146 | 147 | 44 (after example input) Put the page reference (p.176) after the 148 | `\settabs 2 \columns'. 149 | 150 | 45 (towards the bottom) treats each entry as a group => puts each entry 151 | into a group, because alignment entries are certainly other things 152 | besides groups. 153 | 154 | 46 (top) The \tabskip (p.184) => The \tabskip parameter (p.184), and 155 | (top) The \noalign (p.183) commands => The \noalign commands (p.183), 156 | because it reads better; also, we say `the \strut commands (p.167)' 157 | below. 158 | (third para) Two consecutive sentences start with ``A vertical 159 | alignment''. The second one could probably be ``It''. 160 | 161 | 51 I guess the box picture never got fixed. (The `reference point' moved 162 | up quite a bit, and the arrow moved up a little. Also, the `baseline' 163 | could be moved down.) 164 | 165 | 52 (first two paragraphs): the height/depth of hboxes takes \raise and 166 | \lower into account, and the width of vboxes takes \moveleft and 167 | \moveright into account. 168 | (the list) the box (or rule) => the box or rule, because the rule 169 | case isn't subordinate or anything. This is in both items. 170 | 171 | 53 In `cgrok', the `c' is too close to the `grok'. I realize it 172 | shouldn't be a full space, but right now they're practically touching. 173 | Italic correction? Explicit space? 174 | 175 | 54 (first line) It would be nice to say the names of categories 11--13. 176 | (third para from top) Chars in categories 11 and 12 don't mean 177 | ``produce a box containing this character typeset in the current font''. 178 | They don't produce a box, for one thing. And they don't typeset ``this 179 | character'', either. They typeset whatever is in the font at their 180 | character code. I don't know how you want to explain this, but I think 181 | this is seriously wrong. 182 | (example) control sequence `foo$' => control sequence `\foo$' 183 | 184 | 55 (second para) Same problem with characters vs. character code. The 185 | input letter `h' is not transformed into the letter `h' typeset in the 186 | current font. It's transformed into the character at position 104. 187 | The locution now makes it sound as if TeX somehow searches the font for 188 | the letter `h'. 189 | (next para) We should say that the input character's ``code number'' is 190 | the ``character code''. As it is, we never define the latter (I don't 191 | think). 192 | (two more paras) An example showing the 64 less/greater stuff would be 193 | nice. 194 | 195 | 56 (under class) is in class 3 => has class 3, because the class is 196 | really an attribute of a character, not an external set of characters. 197 | (before class example) Wouldn't ``arbitrarily changed'' be better 198 | than ``randomly changed''? (Unless you really used a random number 199 | generator.) 200 | (first para of command concept): same problem with characters. TeX 201 | doesn't construct a box containing that character typeset in the current 202 | font. 203 | 204 | 57 (under control sequence) with an escape character, usually a 205 | backslash (\) => with an escape character, which is usually the 206 | backslash character, since \ isn't always an escape character. 207 | 208 | 58 (control word) It seems a bit inconsistent to footnote ``letter'' 209 | here, and not in either of the previous two concepts. 210 | (delimiter) In `... to one of the commands \left, \right, \overwithdelims, 211 | ... (see pp. 201,204)', either the 201 and 204 or the command names 212 | should be switched, since it's \left and \right that are on 204. 213 | (next para) fonts you're using have big enough parens => fonts you're 214 | using can construct big enough parens, because of extensible characters. 215 | Also, it isn't clear that the delimiters produced by \bigl et al. have 216 | fixed size. 217 | 218 | 59 (before the list) The terms l-commands and r-commands need some 219 | explanation. 220 | 221 | 60 (first line) `the ``small'' character in the ``small'' font' is 222 | misleading. We've already said the small char is in the small font. As 223 | it is, when, a couple sentences below, we say that small character can 224 | be left undefined, it sounds like the small font can't be left 225 | undefined. 226 | (demerits) `cost' should be a concept. 227 | 228 | 62 (second para) Put a tie between `family' and `1'. 229 | 230 | 65 (under format file) can be created => is created, because there's no 231 | other way to make one. 232 | (last line) two refs to page 228. 233 | 234 | 66 (example) the shrinks are 1 and 3, whereas the shrinks on the next 235 | page are 2 and 6. Might as well make them all the same. 236 | 237 | 69 {\TeX} => \TeX{} (if we must keep this horrible example). 238 | 239 | 71 The item concept is pretty useless as it is; it would be nice to say 240 | what the possible items were, and clearly distinguish items from tokens, 241 | etc. 242 | 243 | 72 (towards the bottom) insured that the dots => made the dots, because 244 | we've done something active than ``insure''. 245 | 246 | 73 (ligature) the '' and , in office'', aren't kerned. You put 247 | ``office'' in an \hbox for some reason. 248 | 249 | 80 (math mode) Should say that display math gives you space above and 250 | below the formula. 251 | 252 | 84 (page) between exercises => between exercisings? 253 | 254 | 86 (page layout) We don't give the default space between the body of the 255 | text and the headers or footers. 256 | 257 | 217 \mathsurround should make an index entry for `formulas, spacing 258 | around' or something like that. 259 | 260 | 224 I think `Converting information to tokens' is really a misnomer. 261 | How about just calling it `Conversions' and making `Environmental 262 | information' its own section. 263 | 264 | 263 `Ending the job' should be next to `Initializing TeX'. 265 | 266 | 294 Have an index entry for `logos'. 267 | 268 | 298 \unnumberedlist has become \unorderedlist. 269 | -------------------------------------------------------------------------------- /errors.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | % This is part of the book TeX for the Impatient. 3 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 4 | % See file fdl.tex for copying conditions. 5 | 6 | \input macros 7 | %\chapter{Making sense \linebreak of error messages} 8 | \chapter{理解错误信息} 9 | 10 | \chapterdef{errors} 11 | 12 | %\codefuzz = 4pc % for this chapter only (in scope of \chapter) 13 | %\bix^^{error messages} 14 | %Interpreting \TeX's error messages can sometimes 15 | %be like going to your physician 16 | %with a complaint that you're feeling fatigued and being handed, 17 | %in response, 18 | %a breakdown of your blood chemistry. The explanation of your distress 19 | %is probably there, but it's not easy to figure out what it is. 20 | %A few simple rules will go a long way in helping you to understand \TeX's 21 | %error messages and get the most benefit from them. 22 | \codefuzz = 4pc % for this chapter only (in scope of \chapter) 23 | \bix^^{错误信息} 24 | 解释 \TeX\ 的错误信息有时候就像, 25 | 你跟医生抱怨你感觉疲乏无力,医生却递给你一份血生化细目表。 26 | 对你的痛苦的解释也许就在那里,但却不容易弄清楚它是什么。 27 | 掌握一些简单规则对你理解 \TeX\ 错误信息并从中受益将大有帮助。 28 | 29 | %Your first goal should be 30 | %to understand what you did that caused \TeX\ to complain. 31 | %Your second goal (if you're working interactively) 32 | %should be to catch as many errors as you can in a single run. 33 | 你的第一个目标应当是理解什么东西导致 \TeX\ 报错。 34 | 第二个目标(如果是交互式使用 \TeX )应当是在一次运行中捕获尽可能多的错误。% 35 | \footnote{译注:本章的各个节标题为译者所加。} 36 | 37 | \section{第一个例子} 38 | 39 | %Let's look at an example. Suppose that your input 40 | %contains the line: 41 | %\csdisplay 42 | %We skip \quid a little bit. 43 | %| 44 | %You meant to type `|\quad|', but you typed `|\quid|' instead. 45 | %Here's what you'll get from \TeX\ in response: 46 | %\csdisplay 47 | %!! Undefined control sequence. 48 | %l.291 We skip \quid 49 | % a little bit. 50 | %? 51 | %| 52 | %This message will appear both at your terminal and in your log file. 53 | %^^{log file//error messages} 54 | %The first line, which always starts with an exclamation point (|!!|), 55 | %tells you what the problem is. The last two lines before the `|?|' prompt 56 | %(which in this case are also 57 | %the next two lines) tell you how far \TeX\ has gotten 58 | %when it found the error. 59 | %It found the error on line $291$ of the current input file, 60 | %and the break between the two message lines indicates 61 | %\TeX's precise position within line $291$, namely, just after |\quid|. 62 | %The current input file is the one just after the most recent unclosed 63 | %left parenthesis in the terminal output of your run (see \xref{infiles}). 64 | 我们来看一个例子。假设你的输入中包含下面这行: 65 | \csdisplay 66 | We skip \quid a little bit. 67 | | 68 | 你本想输入 `|\quad|',却输入成 `|\quid|'。 69 | 此时 \TeX\ 将给出下面的信息: 70 | \csdisplay 71 | !! Undefined control sequence. 72 | l.291 We skip \quid 73 | a little bit. 74 | ? 75 | | 76 | 此信息将同时出现在终端上和日志文件中。 77 | ^^{日志文件//错误信息} 78 | 第一行始终以感叹号(|!!|)开头,告诉你出现了什么问题。 79 | 在 `|?|' 提示符之前的最后两行(在此例子中同样也是接下来的两行)% 80 | 告诉你 \TeX\ 在何处发现此错误。 81 | 它在当前输入文件的第 $291$ 行发现了错误, 82 | 两个信息行之间的断行表示 \TeX\ 在第 $291$ 行的精确位置,即在 |\quid| 后面。 83 | 当前输入文件是指,在运行时的终端输出上, 84 | 最接近的非闭合左圆括号后显示的文件(见\xref{infiles})。 85 | 86 | %This particular error, an undefined control 87 | %sequence, is one of the most common ones you can get. 88 | %If you respond to the prompt with another~`|?|', 89 | %\TeX\ will display the following message: 90 | %{\hfuzz = 2in 91 | %\csdisplay 92 | %Type to proceed, S to scroll future error messages, 93 | %R to run without stopping, Q to run quietly, 94 | %I to insert something, E to edit your file, 95 | %1 or ... or 9 to ignore the next 1 to 9 tokens of input, 96 | %H for help, X to quit. 97 | %| 98 | %}% 99 | 这种错误,即控制序列未定义,是你最常出现的错误之一。 100 | 如果你在提示符后键入另一个 `|?|',\TeX\ 将显示下列信息: 101 | {\hfuzz = 2in 102 | \csdisplay 103 | Type to proceed, S to scroll future error messages, 104 | R to run without stopping, Q to run quietly, 105 | I to insert something, E to edit your file, 106 | 1 or ... or 9 to ignore the next 1 to 9 tokens of input, 107 | H for help, X to quit. 108 | | 109 | }% 110 | %Here's what these alternatives mean: 111 | %\ulist 112 | %\li If you type \asciichar{return}, 113 | %\TeX\ will continue processing your document. 114 | %In this case it will just ignore the |\quid|. 115 | %\li If you type `|S|' (or `|s|'---uppercase and lowercase are equivalent 116 | %here), \TeX\ will process your document without stopping \emph{except} 117 | %if it encounters a missing file. Error messages will still appear at your 118 | %terminal and in the log file. 119 | %\li If you type `|R|' or `|r|', 120 | %you'll get the same effect as `|S|' except that 121 | %\TeX\ won't even stop for missing files. 122 | %\li If you type `|Q|' or `|q|', 123 | %\TeX\ will continue processing your document but 124 | %will neither stop for errors nor display them at your terminal. The 125 | %errors will still show up in the log file. 126 | %\li If you type `|X|' or `|x|', 127 | %\TeX\ will clean up as best it can, discard the page 128 | %it's working on, and quit. You can still print or view the 129 | %pages that \TeX\ has already processed. 130 | %\li If you type `|E|' or `|e|', \TeX\ will clean up and terminate 131 | %as it would for `|X|' or `|x|' and then enter your text editor, 132 | %positioning you at the erroneous line. 133 | %(Not all systems support this option.) 134 | %\li If you type `|H|' or `|h|', 135 | %you'll get a further explanation of the error displayed 136 | %at your terminal and 137 | %possibly some advice about what to do about it. This explanation will also 138 | %appear in your log file. For the undefined control sequence above, 139 | %you'll get: 140 | %{\hfuzz = 2in 141 | %\csdisplay 142 | %The control sequence at the end of the top line 143 | %of your error message was never \def'ed. If you have 144 | %misspelled it (e.g., `\hobx'), type `I' and the correct 145 | %spelling (e.g., `I\hbox'). Otherwise just continue, 146 | %and I'll forget about whatever was undefined. 147 | %| 148 | %} 149 | %\li If you type `|?|', you'll get this same message again. 150 | %\endulist 151 | 这些选择各自的含义如下: 152 | \ulist 153 | \li 如果你键入 \asciichar{return}, 154 | \TeX\ 将继续处理你的文档。在此例子中它就忽略了 |\quid|。 155 | \li 如果你键入 `|S|'(或者 `|s|'——这时候大小写是等价的), 156 | \TeX\ 将继续处理你的文档且不再暂停,\emph{除非}找不到某文件。 157 | 但错误信息还是会出现在终端上和日志文件中。 158 | \li 如果你键入 `|R|' 或 `|r|', 159 | 你将得到与 `|S|' 相同的结果,但此时 \TeX\ 即使找不到文件也不会暂停。 160 | \li 如果你键入 `|Q|' 或 `|q|', 161 | \TeX\ 将继续处理你的文档,且遇到错误后将不会再暂停,也不会在终端上显示。 162 | 错误信息还是会记录到日志文件中。 163 | \li 如果你键入 `|X|' 或 `|x|', 164 | \TeX\ 将尽力清理干净,丢弃正在构造的页面,并退出。 165 | 你仍然可以打印或查看 \TeX\ 已经生成的页面。 166 | \li 如果你键入 `|E|' 或 `|e|', 167 | \TeX\ 将如同 `|X|' 或 `|x|' 那样清理并中止,然后打开文本编辑器,跳转到错误所在的行。% 168 | (并非所有系统都支持此选项。) 169 | \li 如果你键入 `|H|' 或 `|h|', 170 | 你将在终端上看到对此错误的进一步解释,可能还有对此错误的一些建议。 171 | 这些信息同样会记录到你的日志文件中。 172 | 对于上述例子的未定义控制序列,你将得到下列信息: 173 | {\hfuzz = 2in 174 | \csdisplay 175 | The control sequence at the end of the top line 176 | of your error message was never \def'ed. If you have 177 | misspelled it (e.g., `\hobx'), type `I' and the correct 178 | spelling (e.g., `I\hbox'). Otherwise just continue, 179 | and I'll forget about whatever was undefined. 180 | | 181 | } 182 | \li 如果你键入 `|?|',你将得到和上面相同的信息。 183 | \endulist 184 | %\noindent 185 | %The other two alternatives, typing `|I|' or a small integer, provide ways of 186 | %getting \TeX\ back on the track so that your error won't cause further errors 187 | %later in your document: 188 | %\ulist 189 | %\li If you type `|I|' or `|i|' 190 | %followed by some text, then \TeX\ will insert 191 | %that text as though it had occurred just after the point of the error, 192 | %at the innermost level where \TeX\ is working. 193 | %In the case of the example above, that means at \TeX's 194 | %position in your original input, namely, just after `|\quid|'. 195 | %Later you'll see an example that shows 196 | %the difference between inserting something at the innermost level and 197 | %inserting it into your original input. In the example above of the undefined 198 | %control sequence, if you type: 199 | %\csdisplay 200 | %I\quad 201 | %| 202 | %\TeX\ will carry out the |\quad| command and produce a quad space 203 | %where you intended to have one. 204 | %\li If you type a positive integer less than $100$ (not less than $10$ as the 205 | %message misleadingly suggests), 206 | %\TeX\ will delete that number of tokens from the innermost 207 | %level where it is working. 208 | %(If you type an integer greater than or equal to $100$, \TeX\ will 209 | %delete $10$ tokens!) 210 | %\endulist 211 | \noindent 212 | 另外两个选择,即键入 `|I|' 或一个小整数, 213 | 提供一种让 \TeX\ 回到正常轨道上的方法, 214 | 使得该错误不会在文档后面导致更多的错误: 215 | \ulist 216 | \li 如果你键入 `|I|' 或 `|i|' 并加上一些文本, 217 | \TeX\ 将把文本插入错误位置之后,放在 \TeX\ 处理的最内层级。 218 | 在上面这个例子中,这表示在 \TeX\ 的原始输入的位置,即在 `|\quid|' 之后。 219 | 稍后我们将给出一个例子,说明把某些东西插入到最内层级与插入到原始输入的区别。 220 | 在上面这个控制序列未定义的例子中,如果你键入: 221 | \csdisplay 222 | I\quad 223 | | 224 | \TeX\ 将执行 |\quad| 命令并在你需要的地方生成一个全方间隔。 225 | \li 如果你键入一个小于 $100$(错误信息让人误解为小于 $10$)的正整数, 226 | \TeX\ 将从它处理的最内层级删除该数目的记号。% 227 | (如果你键入大于或等于 $100$ 的整数,\TeX\ 将只删除 $10$ 个记号!) 228 | \endulist 229 | 230 | \section{第二个例子} 231 | 232 | %Here's an example of another common error: 233 | %\csdisplay 234 | %Skip across \hskip 3cn by 3 centimeters. 235 | %| 236 | %The error message for this is: 237 | %\csdisplay 238 | %!! Illegal unit of measure (pt inserted). 239 | % 240 | % c 241 | % 242 | % n 243 | %l.340 Skip across \hskip 3cn 244 | % by 3 centimeters. 245 | %| 246 | %^^|| 247 | %In this case \TeX\ has observed that `|3|' is followed by something that 248 | %isn't a proper unit of measure, and so it's assumed the unit of measure to be 249 | %points. \TeX\ will read the tokens of `|cn|' again and insert them into 250 | %your input, which is not what you want. In this case you can get a better 251 | %result by first typing `|2|' to bypass the `|cn|'. 252 | %You'll get the message: 253 | %\csdisplay 254 | % n 255 | % 256 | %l.340 Skip across \hskip 3cn 257 | % by 3 centimeters. 258 | %| 259 | 这里是另一种常见错误的例子: 260 | \csdisplay 261 | Skip across \hskip 3cn by 3 centimeters. 262 | | 263 | 这个例子的错误信息为: 264 | \csdisplay 265 | !! Illegal unit of measure (pt inserted). 266 | 267 | c 268 | 269 | n 270 | l.340 Skip across \hskip 3cn 271 | by 3 centimeters. 272 | | 273 | \eridxref{to be read again} 274 | 这里 \TeX\ 注意到 `|3|' 后面不是一个正确的度量单位,因此它假设该度量单位为点。 275 | \TeX\ 将重新读取 `|cn|' 的记号并将它们插入你的输入中,而这并不是你想要的。 276 | 在这种情形下若想得到更好的结果,你可以先键入 `|2|' 以跳过 `|cn|'。 277 | 这样你将得到如下信息: 278 | \csdisplay 279 | n 280 | 281 | l.340 Skip across \hskip 3cn 282 | by 3 centimeters. 283 | | 284 | 285 | %Now you can type 286 | %`|I\hskip 3cm|' to get the skip you wanted (in addition to the |3pt| skip 287 | %that you've already gotten).\footnote 288 | %{By typing `|I\unskip\hskip 3cm|' you can get rid of the |3pt| skip.} 289 | 现在你可以键入 `|I\hskip 3cm|' 以得到你所要的间距(加上你已经得到的 |3pt| 间距)。% 290 | \footnote{若改为键入 `|I\unskip\hskip 3cm|',你就可以去掉这个 |3pt| 的间距。} 291 | 292 | \section{第三个例子} 293 | 294 | %If you type something that's only valid in math mode, \TeX\ will switch over 295 | %to math mode for you whether or not that's what you really wanted. 296 | %For example: 297 | %\csdisplay 298 | %So \spadesuit s are trumps. 299 | %| 300 | %Here's \TeX's error message: 301 | %\csdisplay 302 | %!! Missing $ inserted. 303 | % 304 | % $ 305 | % 306 | % \spadesuit 307 | %l.330 So \spadesuit 308 | % s are trumps. 309 | %| 310 | %Since the |\spadesuit| symbol is only allowed in math mode, 311 | %\TeX\ has inserted a `|$|' in front of it. 312 | %After \TeX\ inserts a token, it's positioned in \emph{front} of 313 | %that token, in this case the `|$|', ready to read it. 314 | %Typing `|2|' will cause \TeX\ to skip both the `|$|' 315 | %and the `|\spadesuit|' tokens, leaving it ready to process the `|s|' 316 | %in `|s are trumps.|'. 317 | %(If you just let \TeX\ continue, it will typeset `|s are trumps|' 318 | %in math mode.) 319 | 如果你输入某些仅可用于数学模式的内容,\TeX\ 将帮你切换到数学模式, 320 | 不管这是否你真正想要的。例如: 321 | \csdisplay 322 | So \spadesuit s are trumps. 323 | | 324 | 下面是 \TeX\ 的错误信息: 325 | \csdisplay 326 | !! Missing $ inserted. 327 | 328 | $ 329 | 330 | \spadesuit 331 | l.330 So \spadesuit 332 | s are trumps. 333 | | 334 | 由于 |\spadesuit| 符号仅可在数学模式中使用, 335 | \TeX\ 已经在它前面插入一个 `|$|'。 336 | 在插入某个记号之后,\TeX\ 位于该记号的\emph{前面}, 337 | 在此情形中就是位于 `|$|' 前面,并准备读取输入。 338 | 键入 `|2|' 将让 \TeX\ 跳过 `|$|' 和 `|\spadesuit|' 记号, 339 | 让它准备处理 `|s are trumps.|' 中的 `|s|'。% 340 | (若你只是让 \TeX\ 继续,它将在数学模式中排版 `|s are trumps|'。) 341 | 342 | \section{第四个例子} 343 | 344 | %Here's an example where \TeX's error diagnostic is downright wrong: 345 | %\csdisplay 346 | %\hbox{One \vskip 1in two.} 347 | %| 348 | %The error message is: 349 | %\csdisplay 350 | %!! Missing } inserted. 351 | % 352 | % } 353 | % 354 | % \vskip 355 | %l.29 \hbox{One \vskip 356 | % 1in two.} 357 | %| 358 | %^^|| 359 | %The problem is that you can't use |\vskip| when \TeX\ is in 360 | %restricted horizontal mode, i.e, constructing an hbox. 361 | %But instead of rejecting the |\vskip|, \TeX\ has inserted a right brace 362 | %in front of it in an attempt to close out the hbox. 363 | %If you accept \TeX's correction, \TeX\ will complain again 364 | %when it gets to the correct right brace later on. It will also complain 365 | %about anything before that right brace that isn't allowed in vertical mode. 366 | %These additional complaints will be particularly confusing 367 | %because the errors they indicate are bogus, a 368 | %result of the propagated effects of the inappropriate 369 | %insertion of the right brace. 370 | %Your best bet is to type `|5|', skipping past all the tokens 371 | %in `|}\vskip 1in|'. 372 | 在下面这个例子中,\TeX\ 对错误的诊断是完全不正确的: 373 | \csdisplay 374 | \hbox{One \vskip 1in two.} 375 | | 376 | 它给出的错误信息如下: 377 | \csdisplay 378 | !! Missing } inserted. 379 | 380 | } 381 | 382 | \vskip 383 | l.29 \hbox{One \vskip 384 | 1in two.} 385 | | 386 | \eridxref{inserted text} 387 | 问题在于,当 \TeX\ 位于受限水平模式中,即正在构建水平盒子时,不能使用 |\vskip|。 388 | 但 \TeX\ 不是丢掉 |\vskip|,而是在它前面插入一个右花括号,以结束该水平盒子。 389 | 如果你接受 \TeX\ 的修改,\TeX\ 遇到稍后的正确右花括号时将再次报错。 390 | 它还将对该右花括号之前的任何不能出现在竖直模式的东西报错。 391 | 这些额外的错误将是特别让人迷惑的,因为这些错误所说的都是假的, 392 | 它们是不恰当插入右花括号后产生的结果。 393 | 你的最佳做法是键入 `|5|' 以跳过在 `|}\vskip 1in|' 中的所有记号。 394 | 395 | \section{第五个例子} 396 | 397 | %Here's a similar example in which the error message is longer 398 | %than any we've seen so far: 399 | %\csdisplay 400 | %\leftline{Skip \smallskip a little further.} But no more. 401 | %| 402 | %The mistake here is that |\smallskip| only works in a vertical mode. 403 | %The error message is something like: 404 | %\csdisplay 405 | %!! Missing } inserted. 406 | % 407 | % } 408 | % 409 | % \vskip 410 | %\smallskip ->\vskip 411 | % \smallskipamount 412 | % Skip \smallskip 413 | % a little further. 414 | %\leftline #1->\line {#1 415 | % \hss } 416 | %l.93 ...Skip \smallskip a little further.} 417 | % But no more. 418 | %| 419 | %The error messages here give you a tour through the macros that are used in 420 | %\plainTeX's implementation of |\leftline|---macros 421 | %that you probably don't care about. 422 | %The first line tells you that \TeX\ intends to cure the problem by 423 | %inserting a right brace. 424 | %\TeX\ hasn't actually read the 425 | %right brace yet, so you can delete it if you choose to. 426 | %Each component of the message after the first line 427 | %(the one with the `!') occupies a pair of lines. 428 | %Here's what the successive pairs of lines mean: 429 | 这里还有个相似的例子,它的错误信息比你之前看到的都要长: 430 | \csdisplay 431 | \leftline{Skip \smallskip a little further.} But no more. 432 | | 433 | 错误在于 |\smallskip| 只能在竖直模式中使用。给出的错误信息如下: 434 | \csdisplay 435 | !! Missing } inserted. 436 | 437 | } 438 | 439 | \vskip 440 | \smallskip ->\vskip 441 | \smallskipamount 442 | Skip \smallskip 443 | a little further. 444 | \leftline #1->\line {#1 445 | \hss } 446 | l.93 ...Skip \smallskip a little further.} 447 | But no more. 448 | | 449 | 这些错误信息带你巡视了在 \plainTeX\ 中用于实现 |\leftline| 的各个宏——% 450 | 这些宏也许是你并不在乎的。 451 | 第一行告诉你 \TeX\ 试图通过插入右花括号解决此问题。 452 | \TeX\ 还未读到右花括号,因此若你想的话你可以删除它。 453 | 第一行(带 `!' 的那行)之后的信息每部分都由两行组成。 454 | 下面是各部分的两行信息的含义: 455 | %\olist 456 | %\li The first pair indicates that \TeX\ has inserted, but not yet read, 457 | %a right brace. 458 | %\li The next pair indicates that after reading the right brace, \TeX\ will 459 | %again read a `|\vskip|' command (gotten from the macro definition 460 | %of |\smallskip|). 461 | %\li The third pair indicates that \TeX\ was expanding the |\smallskip| 462 | %macro when it found the error. The pair also displays the definition of 463 | %|\smallskip| and indicates how far \TeX\ has gotten in expanding and 464 | %executing that definition. Specifically, it's just attempted 465 | %unsuccessfully to execute the |\vskip| command. In general, a 466 | %diagnostic line that starts with a control sequence followed by `|->|' 467 | %indicates that \TeX\ has been expanding and executing a macro by that 468 | %name. 469 | %\li The fourth pair indicates that \TeX\ was processing a macro argument 470 | %when it found the |\smallskip| and also indicates \TeX's position in that 471 | %argument, i.e., it's just processed the |\smallskip| (unsuccessfully). 472 | %By looking ahead to the next pair of lines 473 | %we can see that the argument was passed to 474 | %|\leftline|. 475 | %\li The fifth pair indicates that \TeX\ was expanding 476 | %the |\leftline| 477 | %macro when it found the error. 478 | %(In this example the error occurred while \TeX\ was 479 | %in the middle of interpreting several 480 | %macro definitions at different levels of expansion.) 481 | %Its position after |#1| indicates that the last thing it saw was the 482 | %first (and in this case the only) argument to |\leftline|. 483 | %\li The last pair indicates where \TeX\ is positioned in your input file. 484 | %Note that this position is well beyond the position where it's 485 | %inserting the right brace and reading `|\vskip|' again. 486 | %That's because \TeX\ has already read the entire argument to |\leftline| 487 | %from your input file, even though it's only processed part of that argument. 488 | %The dots at the beginning of the pair indicate a preceding part of the 489 | %input line that isn't shown. This preceding part, in fact, includes 490 | %the |\leftline| control sequence that made the |\vskip| illegal. 491 | %\endolist 492 | \olist 493 | \li 第一对双行表示 \TeX\ 已经插入,但尚未读到的右花括号。 494 | \li 第二对双行表示在读取右花括号后, 495 | \TeX\ 将重新读取 `|\vskip|' 命令(它来自 |\smallskip| 宏的定义中)。 496 | \li 第三对双行表示 \TeX\ 是在展开 |\smallskip| 时发现的错误。 497 | 此部分也显示 |\smallskip| 的定义,并表示在展开和执行该定义时已经读到哪里。 498 | 具体地说,它是在执行|\vskip| 命令时失败的。 499 | 一般地,以控制序列加 `|->|' 开始的信息行表示 \TeX\ 已展开执行的宏的名称。 500 | \li 第四对双行表示 \TeX\ 在处理宏参量时发现了 |\smallskip|, 501 | 同时也表示 \TeX\ 在该参量中的位置,即它正在处理 |\smallskip|(失败了)。 502 | 通过往前查找接下来两行,你可以看到此参量是传递给 |\leftline| 的。 503 | \li 第五对双行表示 \TeX\ 是在展开 |\leftline| 宏是发现的错误。% 504 | (在这个例子中,错误发生在 \TeX\ 解释多个不同层级的宏定义的中间。)% 505 | 在 |#1| 后面的位置表示它最后读取到的是 |\leftline| 的第一个(在这里也是唯一的)参量。 506 | \li 最后对双行表示 \TeX\ 在你的输入文件的位置。 507 | 注意此位置远远超出它插入右花括号并重新读取 `|\vskip|' 的位置。 508 | 这是因为 \TeX\ 已经从输入文件读取了 |\leftline| 的完整参量, 509 | 即使它仅仅处理该参量的一部分。 510 | 这两行信息开头的圆点表示输入行前面一部分内容没显示出来。 511 | 前面那部分内容实际上就包括让 |\vskip| 变得不合法的 |\leftline| 控制序列。 512 | \endolist 513 | %\noindent 514 | %In a long message like this, you'll generally find only the first line and the 515 | %last pair of lines to be useful; but it sometimes helps to know what the other 516 | %lines are about. Any text that you insert or delete will be 517 | %inserted or deleted at the 518 | %innermost level. In this example the insertion or deletion would occur 519 | %just before the 520 | %inserted right brace. 521 | %Note in particular that in this case \TeX\ puts any text you might insert 522 | %\emph{not} into your input text but into a macro definition 523 | %several levels down. (The original macro definition is of course not modified.) 524 | \noindent 525 | 在类似这样的长篇信息中,你通常发现只有第一行和最后两行是有用的; 526 | 但知道其他行是怎么回事有时候也有益处。 527 | 任何你插入或删除的文本将在最内层级中插入或删除。 528 | 在这里例子中,插入或删除将出现在 \TeX\ 插入的右花括号前。 529 | 特别要注意,在此情形中 \TeX\ 将\emph{不会}把你可能插入的文本放在你的输入文本中, 530 | 而是放在多层宏定义的最里面。% 531 | (原始的宏定义当然并不会被改动。) 532 | 533 | %You can use the ^|\errorcontextlines| command \ctsref{\errorcontextlines} 534 | %to limit the 535 | %number of pairs of error context lines that \TeX\ produces. 536 | %If you're not interested in all the information that \TeX\ is giving you, 537 | %you can set |\error!-contextlines| to $0$. That will give you just the first 538 | %and last pairs of lines. 539 | 你可以用 ^|\errorcontextlines|\ctsref{\errorcontextlines}命令限制 540 | \TeX\ 生成的错误信息双行的数目。 541 | 如果你并非对 \TeX\ 给你的所有信息都感兴趣, 542 | 你可以设定 |\error!-contextlines| 为 $0$。 543 | 这样错误信息将只有最前面两行和最后面两行。 544 | 545 | %Finally, 546 | %we'll mention two other indicators that can appear at the start of a pair 547 | %of error message lines: 548 | %\ulist 549 | %\li ^|| indicates that \TeX\ was in the middle of its output routine 550 | %when this error occurred. 551 | %\li ^|| indicates that \TeX\ was in the middle of executing a 552 | %|\write| command when this error occurred. 553 | %\TeX\ will detect such an error when it is actually doing the |\write| 554 | %(during a |\shipout|), rather than when it first encounters the |\write|. 555 | %\endulist 556 | 最后,我们提及可能出现在错误信息行对开头的另外两个指示词: 557 | \ulist 558 | \li || \eridxref{output} 表示 \TeX\ 在它的输出例行程序中间遇到此错误。 559 | \li || \eridxref{write} 表示 \TeX\ 在执行 |\write| 命令时遇到此错误。 560 | \TeX\ 将在实际执行 |\write| 时才检测这样的错误(在 |\shipout| 时), 561 | 而不是在刚遇到 |\write| 命令时。 562 | \endulist 563 | 564 | %\eix^^{error messages} 565 | %\endchapter 566 | %\byebye 567 | \eix^^{错误信息} 568 | 569 | \ifcompletebook\else 570 | \vskip4em{\sectionfonts\leftline{本章索引}} 571 | \readindexfile{i} 572 | \fi 573 | 574 | \endchapter 575 | \byebye 576 | -------------------------------------------------------------------------------- /examples.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | % This is part of the book TeX for the Impatient. 3 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 4 | % See file fdl.tex for copying conditions. 5 | 6 | \input macros 7 | %\chapter{Examples} 8 | \chapter{例子} 9 | 10 | \chapterdef{examples} 11 | 12 | %This section of the book contains a set of examples 13 | %to help get you started and to show you how to do various things with \TeX. 14 | %Each example has \TeX\ output on the left-hand page and the \TeX \ 15 | %input that led to that output on the right-hand page. 16 | %You can use these examples both as forms to imitate and 17 | %as a way of finding the 18 | %\TeX\ commands that you need in order to achieve a particular effect. 19 | %However, these examples can illustrate only a few of the 20 | %about $900$ \TeX\ commands. 21 | 这一章中包括了一组例子,来帮助你熟悉 \TeX , 22 | 同时这些例子还展示了如何使用 \TeX\ 来完成各种排版工作。 23 | 每个例子都有一个放在左页的 \TeX\ 排版的结果和放在右页的相对应的 \TeX\ 输入文本。 24 | 你可以把这些例子作为模仿的样式,也可以用来找到你想要的效果的实现命令。 25 | 不过要注意的是,这些例子仅能展示 \TeX\ $900$ 条左右的命令的一小部分。 26 | 27 | %Some of the examples are self-descriptive---that is, they discuss the very 28 | %features of \TeX\ that they are illustrating. These discussions are 29 | %necessarily sketchy because there isn't room in the examples for all the 30 | %information you'd need. The capsule summary of commands 31 | %(\chapterref{capsule}) 32 | %and the index will help you 33 | %locate the complete explanation of every \TeX\ feature shown in the 34 | %examples. 35 | 这里的某些例子是其义自现的——也就是说,它们在介绍每个所排印出来的功能。 36 | 这个介绍很粗略,因为没有足够的篇幅来讲术所有你想得到的信息。 37 | 命令速查表(\chapterref{capsule})和索引可以帮你来找到例子中的每个 \TeX\ 功能。 38 | 39 | %Because we've designed the examples to illustrate 40 | %many things at once, some examples contain a great variety of 41 | %typographical effects. These examples generally are \emph{not} good 42 | %models of typographical practice. For instance, Example~8 has some of its 43 | %equation numbers on the left and some on the right. You'd never want to 44 | %do that in a real publication. 45 | 因为我们在设计这些例子时,把很多的东西放在一起描述, 46 | 因此,这些例子展示了很多的排版效果。 47 | 这些例子一般并\emph{不是}好的排版实践模版。 48 | 比如例~8 把有些公式编号放在左边,又把另一些放在了右边。 49 | 你永远不会在一个实际的科学出版物中使用这样的公式编号。 50 | 51 | %\xrdef{xmphead} 52 | %Each example except for the first one starts with a macro (see 53 | %\xref{macro}) named |\xmpheader|. We've used |\xmpheader| in order to 54 | %conserve space in the input, since without it each example would have 55 | %several lines of material you'd already seen. 56 | %|\xmpheader| produces the title of an example and the 57 | %extra space that goes with it. You can see in the first example 58 | %what |\xmpheader| does, so you can imitate it if you wish. 59 | %Except for |\xmpheader|, every command that we use in these examples is 60 | %defined in \plainTeX. 61 | \xrdef{xmphead} 62 | 除了第一个例子以外,每个例子都由一个叫 |\xmpheader| 的宏开始(见\xref{宏})。 63 | 我们这样做是为了节省输入文本的篇幅, 64 | 否则每个例子开头你都会看到几行你先前已经看到的内容。 65 | |\xmpheader| 会排印出例子的标题和标题后的空白。 66 | 你可以参见没有使用 |\xmpheader| 的第一个例子是如何实现这一点的, 67 | 然后你就能模仿它了。 68 | 除了 |\xmpheader|,在这里使用的每个命令都是在 \PlainTeX\ 中定义过的。 69 | 70 | % The first example does the necessary eject here. 71 | {% 72 | \let\bye = \relax % We don't want to obey \bye in the example input. 73 | % These switches can't be done by a macro since \bye is outer. 74 | \doexamples {xmptext}% Typeset the actual examples. 75 | }% 76 | 77 | \ifcompletebook\else 78 | \vfil\eject{\sectionfonts\leftline{本章索引}} 79 | \readindexfile{i} 80 | \fi 81 | 82 | \endchapter 83 | \byebye 84 | -------------------------------------------------------------------------------- /fdl.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | % This file is a chapter. It must be included in a larger document to work 3 | % properly. 4 | 5 | \chapter{GNU 自由文档许可证} 6 | 7 | \begingroup 8 | % pseudo-latex since that's what the original source used. 9 | \let\label=\eqdefn 10 | \def\eqprint#1{#1\relax} 11 | \def\\{\hfil\break} 12 | \let\ref=\eqref 13 | % we have to have section numbers since we have internal references. 14 | \def\fdlkludge{\begingroup 15 | \count255=\eqnumber \advance\count255 by 1 16 | \the\count255. 17 | \endgroup} 18 | 19 | Version 1.3, 3 November 2008 20 | 21 | Copyright \copyright\ 2000,2001,2002,2007,2008 Free Software 22 | Foundation, Inc. 23 | 24 | {\tt }\\ 25 | Everyone is permitted to copy and distribute verbatim copies 26 | of this license document, but changing it is not allowed. 27 | 28 | 29 | \section{PREAMBLE} 30 | 31 | The purpose of this License is to make a manual, textbook, or other 32 | functional and useful document ``free'' in the sense of freedom: to 33 | assure everyone the effective freedom to copy and redistribute it, 34 | with or without modifying it, either commercially or noncommercially. 35 | Secondarily, this License preserves for the author and publisher a way 36 | to get credit for their work, while not being considered responsible 37 | for modifications made by others. 38 | 39 | This License is a kind of ``copyleft'', which means that derivative 40 | works of the document must themselves be free in the same sense. It 41 | complements the GNU General Public License, which is a copyleft 42 | license designed for free software. 43 | 44 | We have designed this License in order to use it for manuals for free 45 | software, because free software needs free documentation: a free 46 | program should come with manuals providing the same freedoms that the 47 | software does. But this License is not limited to software manuals; 48 | it can be used for any textual work, regardless of subject matter or 49 | whether it is published as a printed book. We recommend this License 50 | principally for works whose purpose is instruction or reference. 51 | 52 | 53 | \section{APPLICABILITY AND DEFINITIONS} 54 | 55 | \label{applicability} 56 | 57 | This License applies to any manual or other work, in any medium, that 58 | contains a notice placed by the copyright holder saying it can be 59 | distributed under the terms of this License. Such a notice grants a 60 | world-wide, royalty-free license, unlimited in duration, to use that 61 | work under the conditions stated herein. The ``Document'', below, 62 | refers to any such manual or work. Any member of the public is a 63 | licensee, and is addressed as ``you''. You accept the license if you 64 | copy, modify or distribute the work in a way requiring permission 65 | under copyright law. 66 | 67 | A ``Modified Version'' of the Document means any work containing the 68 | Document or a portion of it, either copied verbatim, or with 69 | modifications and/or translated into another language. 70 | 71 | A ``Secondary Section'' is a named appendix or a front-matter section of 72 | the Document that deals exclusively with the relationship of the 73 | publishers or authors of the Document to the Document's overall 74 | subject (or to related matters) and contains nothing that could fall 75 | directly within that overall subject. (Thus, if the Document is in 76 | part a textbook of mathematics, a Secondary Section may not explain 77 | any mathematics.) The relationship could be a matter of historical 78 | connection with the subject or with related matters, or of legal, 79 | commercial, philosophical, ethical or political position regarding 80 | them. 81 | 82 | The ``Invariant Sections'' are certain Secondary Sections whose titles 83 | are designated, as being those of Invariant Sections, in the notice 84 | that says that the Document is released under this License. If a 85 | section does not fit the above definition of Secondary then it is not 86 | allowed to be designated as Invariant. The Document may contain zero 87 | Invariant Sections. If the Document does not identify any Invariant 88 | Sections then there are none. 89 | 90 | The ``Cover Texts'' are certain short passages of text that are listed, 91 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that 92 | the Document is released under this License. A Front-Cover Text may 93 | be at most 5 words, and a Back-Cover Text may be at most 25 words. 94 | 95 | A ``Transparent'' copy of the Document means a machine-readable copy, 96 | represented in a format whose specification is available to the 97 | general public, that is suitable for revising the document 98 | straightforwardly with generic text editors or (for images composed of 99 | pixels) generic paint programs or (for drawings) some widely available 100 | drawing editor, and that is suitable for input to text formatters or 101 | for automatic translation to a variety of formats suitable for input 102 | to text formatters. A copy made in an otherwise Transparent file 103 | format whose markup, or absence of markup, has been arranged to thwart 104 | or discourage subsequent modification by readers is not Transparent. 105 | An image format is not Transparent if used for any substantial amount 106 | of text. A copy that is not ``Transparent'' is called ``Opaque''. 107 | 108 | Examples of suitable formats for Transparent copies include plain 109 | ASCII without markup, Texinfo input format, \LaTeX\ input format, SGML 110 | or XML using a publicly available DTD, and standard-conforming simple 111 | HTML, PostScript or PDF designed for human modification. Examples of 112 | transparent image formats include PNG, XCF and JPG. Opaque formats 113 | include proprietary formats that can be read and edited only by 114 | proprietary word processors, SGML or XML for which the DTD and/or 115 | processing tools are not generally available, and the 116 | machine-generated HTML, PostScript or PDF produced by some word 117 | processors for output purposes only. 118 | 119 | The ``Title Page'' means, for a printed book, the title page itself, 120 | plus such following pages as are needed to hold, legibly, the material 121 | this License requires to appear in the title page. For works in 122 | formats which do not have any title page as such, ``Title Page'' means 123 | the text near the most prominent appearance of the work's title, 124 | preceding the beginning of the body of the text. 125 | 126 | The "publisher" means any person or entity that distributes copies of 127 | the Document to the public. 128 | 129 | A section ``Entitled XYZ'' means a named subunit of the Document whose 130 | title either is precisely XYZ or contains XYZ in parentheses following 131 | text that translates XYZ in another language. (Here XYZ stands for a 132 | specific section name mentioned below, such as ``Acknowledgements'', 133 | ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' 134 | of such a section when you modify the Document means that it remains a 135 | section ``Entitled XYZ'' according to this definition. 136 | 137 | The Document may include Warranty Disclaimers next to the notice which 138 | states that this License applies to the Document. These Warranty 139 | Disclaimers are considered to be included by reference in this 140 | License, but only as regards disclaiming warranties: any other 141 | implication that these Warranty Disclaimers may have is void and has 142 | no effect on the meaning of this License. 143 | 144 | \section{VERBATIM COPYING} 145 | 146 | \label{verbatim} 147 | 148 | You may copy and distribute the Document in any medium, either 149 | commercially or noncommercially, provided that this License, the 150 | copyright notices, and the license notice saying this License applies 151 | to the Document are reproduced in all copies, and that you add no 152 | other conditions whatsoever to those of this License. You may not use 153 | technical measures to obstruct or control the reading or further 154 | copying of the copies you make or distribute. However, you may accept 155 | compensation in exchange for copies. If you distribute a large enough 156 | number of copies you must also follow the conditions in 157 | section~\ref{copying}. 158 | 159 | You may also lend copies, under the same conditions stated above, and 160 | you may publicly display copies. 161 | 162 | 163 | \section{COPYING IN QUANTITY} 164 | 165 | \label{copying} 166 | 167 | If you publish printed copies (or copies in media that commonly have 168 | printed covers) of the Document, numbering more than 100, and the 169 | Document's license notice requires Cover Texts, you must enclose the 170 | copies in covers that carry, clearly and legibly, all these Cover 171 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on 172 | the back cover. Both covers must also clearly and legibly identify 173 | you as the publisher of these copies. The front cover must present 174 | the full title with all words of the title equally prominent and 175 | visible. You may add other material on the covers in addition. 176 | Copying with changes limited to the covers, as long as they preserve 177 | the title of the Document and satisfy these conditions, can be treated 178 | as verbatim copying in other respects. 179 | 180 | If the required texts for either cover are too voluminous to fit 181 | legibly, you should put the first ones listed (as many as fit 182 | reasonably) on the actual cover, and continue the rest onto adjacent 183 | pages. 184 | 185 | If you publish or distribute Opaque copies of the Document numbering 186 | more than 100, you must either include a machine-readable Transparent 187 | copy along with each Opaque copy, or state in or with each Opaque copy 188 | a computer-network location from which the general network-using 189 | public has access to download using public-standard network protocols 190 | a complete Transparent copy of the Document, free of added material. 191 | If you use the latter option, you must take reasonably prudent steps, 192 | when you begin distribution of Opaque copies in quantity, to ensure 193 | that this Transparent copy will remain thus accessible at the stated 194 | location until at least one year after the last time you distribute an 195 | Opaque copy (directly or through your agents or retailers) of that 196 | edition to the public. 197 | 198 | It is requested, but not required, that you contact the authors of the 199 | Document well before redistributing any large number of copies, to 200 | give them a chance to provide you with an updated version of the 201 | Document. 202 | 203 | 204 | \section{MODIFICATIONS} 205 | 206 | \label{modifications} 207 | 208 | You may copy and distribute a Modified Version of the Document under 209 | the conditions of sections~\ref{verbatim} and \ref{copying} above, 210 | provided that you release 211 | the Modified Version under precisely this License, with the Modified 212 | Version filling the role of the Document, thus licensing distribution 213 | and modification of the Modified Version to whoever possesses a copy 214 | of it. In addition, you must do these things in the Modified Version: 215 | 216 | %\begin{enumerate} 217 | \smallskip 218 | \itemletter = `A 219 | \def\item{\vskip\interitemskipamount \char\itemletter. \advance\itemletter by 1} 220 | \item Use in the Title Page (and on the covers, if any) a title distinct 221 | from that of the Document, and from those of previous versions 222 | (which should, if there were any, be listed in the History section 223 | of the Document). You may use the same title as a previous version 224 | if the original publisher of that version gives permission. 225 | \item List on the Title Page, as authors, one or more persons or entities 226 | responsible for authorship of the modifications in the Modified 227 | Version, together with at least five of the principal authors of the 228 | Document (all of its principal authors, if it has fewer than five), 229 | unless they release you from this requirement. 230 | \item State on the Title page the name of the publisher of the 231 | Modified Version, as the publisher. 232 | \item Preserve all the copyright notices of the Document. 233 | \item Add an appropriate copyright notice for your modifications 234 | adjacent to the other copyright notices. 235 | \item Include, immediately after the copyright notices, a license notice 236 | giving the public permission to use the Modified Version under the 237 | terms of this License, in the form shown in the Addendum below. 238 | \item Preserve in that license notice the full lists of Invariant Sections 239 | and required Cover Texts given in the Document's license notice. 240 | \item Include an unaltered copy of this License. 241 | \item Preserve the section Entitled ``History'', Preserve its Title, and add 242 | to it an item stating at least the title, year, new authors, and 243 | publisher of the Modified Version as given on the Title Page. If 244 | there is no section Entitled ``History'' in the Document, create one 245 | stating the title, year, authors, and publisher of the Document as 246 | given on its Title Page, then add an item describing the Modified 247 | Version as stated in the previous sentence. 248 | \item Preserve the network location, if any, given in the Document for 249 | public access to a Transparent copy of the Document, and likewise 250 | the network locations given in the Document for previous versions 251 | it was based on. These may be placed in the ``History'' section. 252 | You may omit a network location for a work that was published at 253 | least four years before the Document itself, or if the original 254 | publisher of the version it refers to gives permission. 255 | \item For any section Entitled ``Acknowledgements'' or ``Dedications'', 256 | Preserve the Title of the section, and preserve in the section all 257 | the substance and tone of each of the contributor acknowledgements 258 | and/or dedications given therein. 259 | \item Preserve all the Invariant Sections of the Document, 260 | unaltered in their text and in their titles. Section numbers 261 | or the equivalent are not considered part of the section titles. 262 | \item Delete any section Entitled ``Endorsements''. Such a section 263 | may not be included in the Modified Version. 264 | \item Do not retitle any existing section to be Entitled ``Endorsements'' 265 | or to conflict in title with any Invariant Section. 266 | \item Preserve any Warranty Disclaimers. 267 | 268 | \smallskip 269 | %\end{enumerate} 270 | 271 | If the Modified Version includes new front-matter sections or 272 | appendices that qualify as Secondary Sections and contain no material 273 | copied from the Document, you may at your option designate some or all 274 | of these sections as invariant. To do this, add their titles to the 275 | list of Invariant Sections in the Modified Version's license notice. 276 | These titles must be distinct from any other section titles. 277 | 278 | You may add a section Entitled ``Endorsements'', provided it contains 279 | nothing but endorsements of your Modified Version by various 280 | parties--for example, statements of peer review or that the text has 281 | been approved by an organization as the authoritative definition of a 282 | standard. 283 | 284 | You may add a passage of up to five words as a Front-Cover Text, and a 285 | passage of up to 25 words as a Back-Cover Text, to the end of the list 286 | of Cover Texts in the Modified Version. Only one passage of 287 | Front-Cover Text and one of Back-Cover Text may be added by (or 288 | through arrangements made by) any one entity. If the Document already 289 | includes a cover text for the same cover, previously added by you or 290 | by arrangement made by the same entity you are acting on behalf of, 291 | you may not add another; but you may replace the old one, on explicit 292 | permission from the previous publisher that added the old one. 293 | 294 | The author(s) and publisher(s) of the Document do not by this License 295 | give permission to use their names for publicity for or to assert or 296 | imply endorsement of any Modified Version. 297 | 298 | 299 | \section{COMBINING DOCUMENTS} 300 | 301 | \label{combining} 302 | 303 | You may combine the Document with other documents released under this 304 | License, under the terms defined in section~\ref{modifications} 305 | above for modified 306 | versions, provided that you include in the combination all of the 307 | Invariant Sections of all of the original documents, unmodified, and 308 | list them all as Invariant Sections of your combined work in its 309 | license notice, and that you preserve all their Warranty Disclaimers. 310 | 311 | The combined work need only contain one copy of this License, and 312 | multiple identical Invariant Sections may be replaced with a single 313 | copy. If there are multiple Invariant Sections with the same name but 314 | different contents, make the title of each such section unique by 315 | adding at the end of it, in parentheses, the name of the original 316 | author or publisher of that section if known, or else a unique number. 317 | Make the same adjustment to the section titles in the list of 318 | Invariant Sections in the license notice of the combined work. 319 | 320 | In the combination, you must combine any sections Entitled ``History'' 321 | in the various original documents, forming one section Entitled 322 | ``History''; likewise combine any sections Entitled ``Acknowledgements'', 323 | and any sections Entitled ``Dedications''. You must delete all sections 324 | Entitled ``Endorsements''. 325 | 326 | 327 | \section{COLLECTIONS OF DOCUMENTS} 328 | 329 | \label{collections} 330 | 331 | You may make a collection consisting of the Document and other 332 | documents released under this License, and replace the individual 333 | copies of this License in the various documents with a single copy 334 | that is included in the collection, provided that you follow the rules 335 | of this License for verbatim copying of each of the documents in all 336 | other respects. 337 | 338 | You may extract a single document from such a collection, and 339 | distribute it individually under this License, provided you insert a 340 | copy of this License into the extracted document, and follow this 341 | License in all other respects regarding verbatim copying of that 342 | document. 343 | 344 | 345 | \section{AGGREGATION WITH INDEPENDENT WORKS} 346 | 347 | \label{aggregation} 348 | 349 | A compilation of the Document or its derivatives with other separate 350 | and independent documents or works, in or on a volume of a storage or 351 | distribution medium, is called an ``aggregate'' if the copyright 352 | resulting from the compilation is not used to limit the legal rights 353 | of the compilation's users beyond what the individual works permit. 354 | When the Document is included in an aggregate, this License does not 355 | apply to the other works in the aggregate which are not themselves 356 | derivative works of the Document. 357 | 358 | If the Cover Text requirement of section~\ref{copying} is applicable to 359 | these copies of the Document, then if the Document is less than one half 360 | of the entire aggregate, the Document's Cover Texts may be placed on 361 | covers that bracket the Document within the aggregate, or the 362 | electronic equivalent of covers if the Document is in electronic form. 363 | Otherwise they must appear on printed covers that bracket the whole 364 | aggregate. 365 | 366 | \section{TRANSLATION} 367 | 368 | \label{translation} 369 | 370 | Translation is considered a kind of modification, so you may 371 | distribute translations of the Document under the terms of 372 | section~\ref{modifications}. 373 | Replacing Invariant Sections with translations requires special 374 | permission from their copyright holders, but you may include 375 | translations of some or all Invariant Sections in addition to the 376 | original versions of these Invariant Sections. You may include a 377 | translation of this License, and all the license notices in the 378 | Document, and any Warranty Disclaimers, provided that you also include 379 | the original English version of this License and the original versions 380 | of those notices and disclaimers. In case of a disagreement between 381 | the translation and the original version of this License or a notice 382 | or disclaimer, the original version will prevail. 383 | 384 | If a section in the Document is Entitled ``Acknowledgements'', 385 | ``Dedications'', or ``History'', the requirement 386 | (section~\ref{modifications}) to Preserve 387 | its Title (section~\ref{applicability}) will typically require 388 | changing the actual title. 389 | 390 | 391 | \section{TERMINATION} 392 | 393 | \label{termination} 394 | 395 | You may not copy, modify, sublicense, or distribute the Document 396 | except as expressly provided under this License. Any attempt 397 | otherwise to copy, modify, sublicense, or distribute it is void, and 398 | will automatically terminate your rights under this License. 399 | 400 | However, if you cease all violation of this License, then your license 401 | from a particular copyright holder is reinstated (a) provisionally, 402 | unless and until the copyright holder explicitly and finally 403 | terminates your license, and (b) permanently, if the copyright holder 404 | fails to notify you of the violation by some reasonable means prior to 405 | 60 days after the cessation. 406 | 407 | Moreover, your license from a particular copyright holder is 408 | reinstated permanently if the copyright holder notifies you of the 409 | violation by some reasonable means, this is the first time you have 410 | received notice of violation of this License (for any work) from that 411 | copyright holder, and you cure the violation prior to 30 days after 412 | your receipt of the notice. 413 | 414 | Termination of your rights under this section does not terminate the 415 | licenses of parties who have received copies or rights from you under 416 | this License. If your rights have been terminated and not permanently 417 | reinstated, receipt of a copy of some or all of the same material does 418 | not give you any rights to use it. 419 | 420 | 421 | \section{FUTURE REVISIONS OF THIS LICENSE} 422 | 423 | \label{future} 424 | 425 | The Free Software Foundation may publish new, revised versions of the 426 | GNU Free Documentation License from time to time. Such new versions 427 | will be similar in spirit to the present version, but may differ in 428 | detail to address new problems or concerns. See 429 | http://www.gnu.org/copyleft/. 430 | 431 | Each version of the License is given a distinguishing version number. 432 | If the Document specifies that a particular numbered version of this 433 | License ``or any later version'' applies to it, you have the option of 434 | following the terms and conditions either of that specified version or 435 | of any later version that has been published (not as a draft) by the 436 | Free Software Foundation. If the Document does not specify a version 437 | number of this License, you may choose any version ever published (not 438 | as a draft) by the Free Software Foundation. If the Document 439 | specifies that a proxy can decide which future versions of this 440 | License can be used, that proxy's public statement of acceptance of a 441 | version permanently authorizes you to choose that version for the 442 | Document. 443 | 444 | 11. RELICENSING 445 | 446 | "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 447 | World Wide Web server that publishes copyrightable works and also 448 | provides prominent facilities for anybody to edit those works. A 449 | public wiki that anybody can edit is an example of such a server. A 450 | "Massive Multiauthor Collaboration" (or "MMC") contained in the site 451 | means any set of copyrightable works thus published on the MMC site. 452 | 453 | "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 454 | license published by Creative Commons Corporation, a not-for-profit 455 | corporation with a principal place of business in San Francisco, 456 | California, as well as future copyleft versions of that license 457 | published by that same organization. 458 | 459 | "Incorporate" means to publish or republish a Document, in whole or in 460 | part, as part of another Document. 461 | 462 | An MMC is "eligible for relicensing" if it is licensed under this 463 | License, and if all works that were first published under this License 464 | somewhere other than this MMC, and subsequently incorporated in whole or 465 | in part into the MMC, (1) had no cover texts or invariant sections, and 466 | (2) were thus incorporated prior to November 1, 2008. 467 | 468 | The operator of an MMC Site may republish an MMC contained in the site 469 | under CC-BY-SA on the same site at any time before August 1, 2009, 470 | provided the MMC is eligible for relicensing. 471 | 472 | 473 | % this section title is so long, it messes up everything. 474 | % don't put it in the headline and don't write it to the toc 475 | \let\markinfo=\gobble 476 | \let\writetocentry=\gobbletwo 477 | \section{\vtop{\noindent ADDENDUM: How to use this License 478 | \\for your documents\hfil}} 479 | 480 | To use this License in a document you have written, include a copy of 481 | the License in the document and put the following copyright and 482 | license notices just after the title page: 483 | 484 | %\begin{quote} 485 | \smallskip 486 | {\narrower\obeylines\eightrm\baselineskip=10pt 487 | Copyright \copyright\ YEAR YOUR NAME. 488 | Permission is granted to copy, distribute and/or modify this document 489 | under the terms of the GNU Free Documentation License, Version 1.3 490 | or any later version published by the Free Software Foundation; 491 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 492 | A copy of the license is included in the section entitled ``GNU 493 | Free Documentation License''. 494 | \par} 495 | %\end{quote} 496 | \smallskip 497 | 498 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 499 | replace the ``with...Texts.'' line with this: 500 | 501 | \smallskip 502 | {\narrower\obeylines\eightrm\baselineskip=10pt 503 | with the Invariant Sections being LIST THEIR TITLES, with the 504 | Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 505 | \par} 506 | \smallskip 507 | 508 | If you have Invariant Sections without Cover Texts, or some other 509 | combination of the three, merge those two alternatives to suit the 510 | situation. 511 | 512 | If your document contains nontrivial examples of program code, we 513 | recommend releasing these examples in parallel under your choice of 514 | free software license, such as the GNU General Public License, 515 | to permit their use in free software. 516 | 517 | \endgroup 518 | 519 | \endchapter\byebye 520 | -------------------------------------------------------------------------------- /fonts.tex: -------------------------------------------------------------------------------- 1 | % This is part of the book TeX for the Impatient. 2 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 3 | % See file fdl.tex for copying conditions. 4 | 5 | % Fonts for TeX for the Impatient. 6 | 7 | % This file is being distributed with the macros because the macro file 8 | % refers to it. We used a combination of Bitstream and standard TeX 9 | % fonts for the original printed book, but for the free edition, we 10 | % stick to Computer Modern. 11 | % ----------------------------------------------------------------------- 12 | % 13 | % We used Computer Modern for the main text and math, and Zapf Humanist 14 | % (i.e., Optima) for heads. (bs00015 is Optima Roman, 16 italic, 17 15 | % bold, 18 bold italic.) 16 | % 17 | % First we define all of the fonts we use for any purpose, in terms of the 18 | % font files. Later we define fonts functionally, using \let or \def. 19 | 20 | % Computer Modern fonts. 21 | % 22 | \chardef\chinesefont = 2 23 | \ifcase\chinesefont 24 | \def\song{Adobe Song Std} 25 | \def\hei{Adobe Heiti Std} 26 | \def\kai{Adobe Kaiti Std} 27 | \def\fang{Adobe Fangsong Std} 28 | \or 29 | \def\song{SimSun} 30 | \def\hei{SimHei} 31 | \def\kai{KaiTi} 32 | \def\fang{FangSong} 33 | \or 34 | \def\song{FandolSong} 35 | \def\hei{FandolHei} 36 | \def\kai{FandolKai} 37 | \def\fang{FandolFang} 38 | \fi 39 | % 40 | \newif\ifxecjk \xecjktrue 41 | \ifxecjk 42 | \font\CJKfont="\song" at 10pt 43 | \input xeCJK-base 44 | \def\letfont{\let\CJKfont} 45 | \xeCJKenablechecksingle 46 | \normalspacedchars{-} 47 | \else 48 | \font\zhfont="\song" at 10pt 49 | \def\zhpunctfont{\zhfont} 50 | \input zhspacing.sty 51 | \zhspacing 52 | \def\letfont{\let\zhfont} 53 | \fi 54 | % 55 | \font\enfiverm = cmr5 56 | \font\zhfiverm = "\song" at 5pt 57 | \def\fiverm{\enfiverm\letfont\zhfiverm} 58 | \font\ensevenrm = cmr7 59 | \font\zhsevenrm = "\song" at 7pt 60 | \def\sevenrm{\ensevenrm\letfont\zhsevenrm} 61 | \font\eneightrm = cmr8 62 | \font\zheightrm = "\song" at 8pt 63 | \def\eightrm{\eneightrm\letfont\zheightrm} 64 | \font\enninerm = cmr9 % Glue pictures, small caps for ASCII. 65 | \font\zhninerm = "\song" at 9pt 66 | \def\ninerm{\enninerm\letfont\zhninerm} 67 | %\font\tenrm = xcmr10 % with our kerning 68 | \font\entenrm = cmr10 % don't have the xcmr10 source any more 69 | \font\zhtenrm = "\song" at 10pt 70 | \def\tenrm{\entenrm\letfont\zhtenrm} 71 | \font\enoldtenrm = cmr10 % straight CM 72 | \font\zholdtenrm = "\song" at 10pt 73 | \def\oldtenrm{\enoldtenrm\letfont\zholdtenrm} 74 | \font\entwelverm = cmr12 75 | \font\zhtwelverm = "\song" at 12pt 76 | \def\twelverm{\entwelverm\letfont\zhtwelverm} 77 | \font\entwentysixrm = cmr10 at 26pt 78 | \font\zhtwentysixrm = "\hei" at 26pt 79 | \def\twentysixrm{\entwentysixrm\letfont\zhtwentysixrm} 80 | % 81 | \font\eneightit = cmti8 82 | \font\zheightit = "\kai" at 8pt 83 | \def\eightit{\eneightit\letfont\zheightit} 84 | \font\ennineit = cmti9 85 | \font\zheightit = "\kai" at 9pt 86 | \def\nineit{\ennineit\letfont\zhnineit} 87 | \font\entenit = cmti10 88 | \font\zhtenit = "\kai" at 10pt 89 | \def\tenit{\entenit\letfont\zhtenit} 90 | % 91 | \font\eneighttt = cmtt8 92 | \font\zheighttt = "\fang" at 8pt 93 | \def\eighttt{\eneighttt\letfont\zheighttt} 94 | \font\ententt = cmtt10 95 | \font\zhtentt = "\fang" at 10pt 96 | \def\tentt{\ententt\letfont\zhtentt} 97 | \font\eneleventt = cmtt10 at 11pt 98 | \font\zheleventt = "\fang" at 11pt 99 | \def\elventt{\enelventt\letfont\zhelventt} 100 | \font\entwelvett = cmtt10 scaled \magstep2 101 | \font\zhtwelvett = "\fang" at 12pt 102 | \def\twelvett{\entwelvett\letfont\zhtwelvett} 103 | % 104 | \font\entenbt = cmtt10 105 | \font\zhtenbt = "\fang" at 10pt 106 | \def\tenbt{\entenbt\letfont\zhtenbt} 107 | % 108 | \font\enelevensf = cmss10 scaled\magstephalf 109 | \font\zhelevensf = "\hei" at 11pt 110 | \def\elevensf{\enelevensf\letfont\zhelevensf} 111 | \font\enfourteensf = cmss10 scaled\magstep2 112 | \font\zhfourteensf = "\hei" at 14pt 113 | \def\fourteensf{\enfourteensf\letfont\zhfourteensf} 114 | % 115 | \font\eneightbf = cmbx8 116 | \font\zheightbf = "\hei" at 8pt 117 | \def\eightbf{\eneightbf\letfont\zheightbf} 118 | \font\entenbf = cmbx10 119 | \font\zhtenbf = "\hei" at 10pt 120 | \def\tenbf{\entenbf\letfont\zhtenbf} 121 | \font\enelevenbf = cmbx10 scaled \magstephalf 122 | \font\zhelevenbf = "\hei" at 11pt 123 | \def\elevenbf{\enelevenbf\letfont\zhelevenbf} 124 | \font\entwelvebf = cmbx12 125 | \font\zhtwelvebf = "\hei" at 12pt 126 | \def\twelvebf{\entwelvebf\letfont\zhtwelvebf} 127 | \font\enthirtysixbf = cmbx10 at 36pt 128 | \font\zhthirtysixbf = "\hei" at 36pt 129 | \def\thirtysixbf{\enthirtysixbf\letfont\zhthirtysixbf} 130 | % 131 | \font\entenbi = cmbxti10 132 | \font\zhtenbi = "\hei" at 10pt 133 | \def\tenbi{\entenbi\letfont\zhtenbi} 134 | \font\enelevenbi= cmbxti10 scaled \magstephalf 135 | \font\zhelevenbi = "\hei" at 11pt 136 | \def\elevenbi{\enelevenbi\letfont\zhelevenbi} 137 | \font\enfourteenbi= cmbxti10 scaled \magstep2 138 | \font\zhfourteenbi = "\hei" at 14pt 139 | \def\fourteenbi{\enfourteenbi\letfont\zhfourteenbi} 140 | % 141 | \font\entensc = cmcsc10 142 | \font\zhtensc = "\fang" at 10pt 143 | \def\tensc{\entensc\letfont\zhtensc} 144 | \font\eneightsl = cmsl8 145 | \font\zheightsl = "\fang" at 8pt 146 | \def\eightsl{\eneightsl\letfont\zheightsl} 147 | \font\eneighti = cmmi8 148 | \font\zheighti = "\kai" at 8pt 149 | \def\eighti{\eneighti\letfont\zheighti} 150 | \font\eneightsy = cmsy8 151 | \font\zheightsy = "\song" at 8pt 152 | \def\eightsy{\eneightsy\letfont\zheightsy} 153 | 154 | % % Optima fonts. 155 | % % 156 | % \font\eightopt = bs0015 at 8pt 157 | % \font\nineopt = bs0015 at 9pt 158 | % \font\twelveopt = bs0015 at 12pt 159 | % \font\twentysixopt = bs0015 at 26pt 160 | % \font\nineoptit = bs0016 at 9pt 161 | % \font\tenoptit = bs0016 at 10pt 162 | % \font\tenoptbf = bs0017 at 10pt 163 | % \font\thirtysixoptbf = bs0017 at 36pt 164 | % \font\tenbt = bs00175 at 10pt 165 | % \font\tenoptbi = bs0018 at 10pt 166 | % \font\elevenoptbi = bs0018 at 11pt 167 | % \font\fourteenoptbi = bs0018 at 14pt 168 | 169 | % Palatino fonts. 170 | % 171 | \font\tenpal = pplr 172 | %\font\tenpal = bs0023 173 | %\font\tenpalit = bs0024 174 | %\font\tenpalbf = bs0025 175 | %\font\tenpalbi = bs0026 176 | 177 | % Logo and picture fonts. 178 | % 179 | \font\eightlogo = logo8 180 | \font\logosl = logosl10 181 | \font\handfont = pzdr 182 | 183 | % The following changes are to avoid driver overflow 184 | \ifmsdos 185 | \font\cnum = cnum % 36-pt bold Optima, numbers only (just for MS-DOS) 186 | \let\chapternumeralfont = \cnum 187 | %\let\thirtysixoptbf = \twentysixopt 188 | %\font\sevensy = cmsy8 189 | %\font\seveni = cmmi8 190 | \fi 191 | 192 | \def\undefinedfont{\errmessage{Undefined font}} 193 | 194 | % This should only be called when \rm et al. are going to be defined 195 | % directly. 196 | % 197 | \def\clearfonts{\let\rm = \undefinedfont \let\bf = \undefinedfont 198 | \let\it = \undefinedfont \let\bi = \undefinedfont 199 | \let\tt = \undefinedfont \let\bt = \undefinedfont 200 | \let\sc = \undefinedfont 201 | \let\ss = \undefinedfont 202 | } 203 | 204 | % We only need to assign to \fam if the font is going to be used in math 205 | % mode, which isn't the case with any of these. \rm, \it, \sl, \bf, and 206 | % \tt are defined in plain. 207 | % 208 | \def\bi{\tenbi} 209 | 210 | \def\mapquotes{\catcode`` = \active \catcode`' = \active} 211 | {\mapquotes 212 | \gdef\bt{% The font change also draws \ ` ' from a different font. 213 | \tenbt 214 | \def\\{{\tentt \char92}}% 215 | \def`{{\tentt \char96}}\def'{{\tentt \char39}}% 216 | } 217 | } 218 | 219 | \def\bti{\tenbi} 220 | \def\sc{\tensc} 221 | 222 | % Text fonts. 223 | % 224 | \def\textfonts{% 225 | \def\rm{\fam0\tenrm}% 226 | \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm 227 | \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei 228 | \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy 229 | \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex 230 | \def\it{\fam\itfam\tenit}\textfont\itfam=\tenit 231 | \def\sl{\fam\slfam\tensl}\textfont\slfam=\tensl 232 | \def\bf{\fam\bffam\tenbf}\textfont\bffam=\tenbf 233 | \scriptfont\bffam=\sevenbf \scriptscriptfont\bffam=\fivebf 234 | \def\tt{\fam\ttfam\tentt}\textfont\ttfam=\tentt 235 | \let\sc = \tensc 236 | \setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}% 237 | \normalbaselineskip=12pt 238 | \normalbaselines \rm 239 | } 240 | 241 | 242 | % Footnote fonts. We generally use eight point. 243 | % 244 | \def\footnotefonts{% 245 | \def\rm{\fam0\eightrm}% 246 | \textfont0=\eightrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm 247 | \textfont1=\eighti \scriptfont1=\seveni \scriptscriptfont1=\fivei 248 | \textfont2=\eightsy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy 249 | \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex 250 | \def\it{\fam\itfam\eightit}\textfont\itfam=\eightit 251 | \def\sl{\fam\slfam\eightsl}\textfont\slfam=\eightsl 252 | \def\bf{\fam\bffam\eightbf}\textfont\bffam=\eightbf 253 | \scriptfont\bffam=\sevenbf \scriptscriptfont\bffam=\fivebf 254 | \def\tt{\fam\ttfam\eighttt}\textfont\ttfam=\eighttt 255 | \let\sc = \eightsc 256 | \setbox\strutbox=\hbox{\vrule height7pt depth2pt width\z@}% 257 | \normalbaselineskip=9pt 258 | \normalbaselines \rm 259 | } 260 | 261 | % Fonts for the example titles. They are defined in the first example, 262 | % also. 263 | % 264 | 265 | \def\exampletitlefonts{\clearfonts 266 | \let\bf = \elevenbf 267 | \let\bi = \elevenbi 268 | \baselineskip = 13pt \bf 269 | } 270 | 271 | % Fonts for the subsection titles. 272 | % 273 | \def\subsectionfonts{\clearfonts \let\sf = \elevensf 274 | \baselineskip = 12pt \sf 275 | } 276 | 277 | 278 | % Fonts for the section titles. 279 | % 280 | \def\sectionfonts{\clearfonts \let\sf = \fourteensf 281 | \baselineskip = 16pt \sf 282 | } 283 | 284 | % Fonts for the chapter titles. 285 | % 286 | \let\chapternumeralfont = \thirtysixbf 287 | 288 | \def\chapterfonts{\clearfonts \let\bf = \twentysixrm 289 | \baselineskip = 32pt \bf 290 | } 291 | 292 | % Fonts for the table of contents. 293 | % 294 | \def\shorttocfonts{\clearfonts \let\rm = \twelverm 295 | \baselineskip = 20pt \rm 296 | } 297 | 298 | \def\tocfonts{\clearfonts \let\rm = \ninerm 299 | \let\it = \tenit \let\bf = \tenbf 300 | \baselineskip = 12pt \rm 301 | } 302 | 303 | % Fonts for the index. 304 | % 305 | 306 | \def\indexfonts{\clearfonts 307 | \let\rm = \eightrm 308 | \let\it = \eightit 309 | \let\tt = \eighttt 310 | \let\sc = \tensc 311 | \let\sl = \eightsl 312 | \textfont2 = \eightsy % For \AMSTeX. 313 | \let\mflogo = \eightlogo % For \Metafont. 314 | \normalbaselineskip = 10pt \normallineskip = 1.5pt \normalbaselines 315 | \setbox\strutbox=\hbox{\vrule height 7.5pt depth2.5pt width0pt}% 316 | \rm 317 | } 318 | 319 | % Fonts for the inside back cover. 320 | % 321 | \def\conceptpagefonts{\clearfonts 322 | \let\rm = \ninerm 323 | \let\sc = \eightrm 324 | \let\sl = \nineit 325 | \baselineskip = 12pt 326 | \rm 327 | } 328 | 329 | % We don't want any automatic hyphenation within the code font 330 | 331 | \hyphenchar\zhtentt = -1 332 | \hyphenchar\ententt = -1 333 | \hyphenchar\zheighttt = -1 334 | \hyphenchar\eneighttt = -1 335 | 336 | 337 | 338 | \textfonts 339 | -------------------------------------------------------------------------------- /frontm.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | % This is part of the book TeX for the Impatient. 3 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 4 | % See file fdl.tex for copying conditions. 5 | % 6 | % Front matter. 7 | 8 | \input macros 9 | 10 | 11 | % Frontmatter is numbered i, ii, ... 12 | \pageno = -1 13 | 14 | 15 | % Bastard title. 16 | % 17 | % \sinkage 18 | \indent\vskip8em 19 | \centerline{\chapterfonts \TeX\ 急就帖} 20 | \vskip4em 21 | \centerline{\sectionfonts \number\year 年\number\month 月\number\day 日} 22 | 23 | \noheadlinetrue\pagebreak 24 | 25 | 26 | % Title spread. 27 | % 28 | %(title page, lhs) 29 | %\noheadlinetrue\pagebreak 30 | \blankpage 31 | 32 | %(title page, rhs) 33 | %\noheadlinetrue\pagebreak 34 | \blankpage 35 | 36 | 37 | {\input copyrght } 38 | \noheadlinetrue 39 | 40 | 41 | % Dedication. 42 | % 43 | \sinkage 44 | {\it \flushright 45 | 致 Jodi. 46 | ---{\sc p.w.a.} 47 | 48 | 忆信任我的父亲. 49 | ---{\sc k.a.h.} 50 | 51 | 致 Dan. 52 | ---{\sc k.b.} 53 | } 54 | \pagebreak 55 | 56 | % From here on, the convention is that every frontchapter does its own 57 | % ending pagebreak and encloses its fonts in a group if necessary. 58 | 59 | % The preface should start on a right-hand page. 60 | 61 | \blankpage 62 | {\input preface } 63 | 64 | % Contents. 65 | % 66 | % We never want to empty the file after doing the brief contents. 67 | % 68 | \rewritetocfilefalse 69 | % 70 | \blankpage 71 | \frontchapter{简要} 72 | 73 | \shortcontents 74 | 75 | 76 | \ifcompletebook \global\rewritetocfiletrue \fi 77 | 78 | \frontchapter{目录} 79 | 80 | \contents 81 | 82 | \blankpage 83 | {\input read1st } 84 | 85 | \byebye 86 | -------------------------------------------------------------------------------- /index.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | % This is part of the book TeX for the Impatient. 3 | % Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 4 | % See file fdl.tex for copying conditions. 5 | 6 | \input macros 7 | %\chapter{Index} 8 | \chapter{索引} 9 | 10 | \par 11 | \kern-\baselineskip 12 | 13 | %\noindent In the entries of this index, a page number in italics 14 | %indicates a principal or defining entry. 15 | \noindent 在这个索引的各项中,意大利体页码表示一个主要项或定义项。 16 | 17 | \par 18 | % Let's try to collect indexing cross-references here. 19 | % 20 | %\idxsee{diacritical marks}{accents} 21 | %\idxsee{drawing lines}{rules} 22 | %\idxsee{drivers}{device drivers} 23 | %\idxsee{eyes}{\anatomy} 24 | %\idxsee{foreign languages}{European languages} 25 | %\idxsee{intestines}{\anatomy} 26 | %\idxsee{mouth}{\anatomy} 27 | %\idxsee{page footers}{footers} 28 | %\idxsee{page headers}{headers} 29 | %\idxsee{paragraphs//indenting}{indentation} 30 | %\idxsee{recursive macros}{macros, recursive} 31 | %\idxsee{stomach}{\anatomy} 32 | %\idxsee{tables}{alignments} 33 | \idxsee{变音符}{重音} 34 | \idxsee{画线}{标线} 35 | \idxsee{驱动}{设备驱动} 36 | \idxsee{眼睛}{\texpouxi} 37 | \idxsee{外语}{欧洲语言} 38 | \idxsee{肠道}{\texpouxi} 39 | \idxsee{嘴巴}{\texpouxi} 40 | %\idxsee{page footers}{footers} 41 | %\idxsee{page headers}{headers} 42 | \idxsee{段落!缩进}{缩进} 43 | %\idxsee{recursive macros}{macros, recursive} 44 | \idxsee{胃}{\texpouxi} 45 | \idxsee{表格}{阵列} 46 | \beginindex 47 | 48 | \let\+ = 0 % This can't occur in a macro... 49 | 50 | \readindexfile{i} 51 | 52 | \endindex 53 | 54 | \endchapter 55 | \byebye 56 | -------------------------------------------------------------------------------- /index1.icn: -------------------------------------------------------------------------------- 1 | # This Icon program carries out the first phase of preparing the index for 2 | # TeX for the Impatient. The input is the .idx file produced by TeX using 3 | # our macros. The output should be piped through a sort and then to the 4 | # index2 program. 5 | # 6 | # This program was written by Paul Abrahams and is public domain. 7 | # 8 | # An index entry has the form: 9 | # term::type::page suffix 10 | # where `term' is the index term, `type' is T, N, or C, 11 | # `page' is either a folio number or *s, where s is a see-string, 12 | # and `suffix' is either empty or P, E, B, PE, or PB. 13 | # P indicates a principal entry, B and E begin and end a page range. 14 | 15 | 16 | global printable, specials 17 | record index_item(term, type, pages) 18 | record pgrec(number, pflag) 19 | 20 | procedure main(a) 21 | local idx, fn, entry 22 | fn := a[1] 23 | printable := &ascii[33:-1] 24 | specials := string(printable -- (&ucase ++ &lcase ++ &digits)) 25 | every entry := !&input do 26 | write(key(entry), "@@@", entry) 27 | write(&errout, "First indexing pass is complete.") 28 | return 29 | end 30 | 31 | procedure key(entry) 32 | local symb, symb1, type, page 33 | static collate, hi, sortsequence 34 | initial { 35 | collate := specials || &ucase || &digits 36 | sortsequence := printable -- &lcase 37 | hi := repl(char(128), 26) 38 | } 39 | entry ? (symb := tab(find("::")), move(2), type := move(1), 40 | move(2), page := tab(many('-0123456789*'))) 41 | symb := remove_leading_specials(symb) 42 | symb1 := map(symb, &lcase, &ucase) 43 | return map(map_term(symb1, type), collate, sortsequence) || 44 | map(symb, &ucase, hi) || char(1) || page_key(page) 45 | end 46 | 47 | procedure remove_leading_specials(s) 48 | # remove leading period, backslash, or less-than 49 | local a, b, c, k 50 | static kills 51 | initial {kills := '\\.<'} 52 | 53 | # a one-character special is left unchanged 54 | c := s[1:upto("//", s) | 0] 55 | if *c = 1 & any(kills, c) then 56 | return s 57 | 58 | k := 1 59 | while s ? (a := tab(k), b:= tab(upto(kills)), 60 | tab(many(kills)), c := tab(0)) do 61 | {s := a || b || c; k +:= *b} 62 | return s 63 | end 64 | 65 | procedure map_term(t, c) 66 | # t is an index term, c is "N", "T", or "C" 67 | # Encode NTC as char(1), char(2), char(3) 68 | # Replace each // by the NTC code, then follow t by the NTC code and 1 69 | local code 70 | 71 | code := char(find(c, "NTC") | 4) 72 | while t[find("//", t)+:2] := code 73 | return t || code || char(1) 74 | end 75 | 76 | procedure page_key(p) 77 | # convert p, which may be negative, to a character string key 78 | # Negative numbers must sort with the smallest closest to 0. 79 | # A see-string always starts with *; we replace the * with ~ 80 | # so that see references always come last. (They are usually unique.) 81 | if p == "*" then 82 | return "~" 83 | p := integer(p) 84 | return ( 85 | if p < 0 then 86 | "-" || right(-p, 4, "0") 87 | else 88 | right(p, 5, 0) 89 | ) 90 | end 91 | -------------------------------------------------------------------------------- /index2.icn: -------------------------------------------------------------------------------- 1 | # This Icon program is the second pass of the indexing process for TeX for the 2 | # Impatient. It must be preceded by index1 and by a sort of the intermediate 3 | # file. 4 | 5 | # This program was written by Paul Abrahams and is public domain. 6 | 7 | record topic_entry(term, type, groupchar, pages, level) 8 | record pgrec(number, flags) 9 | record term_list_record(term_list, start) 10 | procedure main(a) 11 | local gen, pages, term, topic 12 | local groupchar 13 | 14 | write(&errout, "Second indexing pass has started.") 15 | 16 | # Each pass through this loop produces the entry for a single topic 17 | # or subtopic, including both the text of the topic and its pages. 18 | 19 | every topic := get_topic_info() do { 20 | 21 | # If we're starting a new group (initial character), produce the macro 22 | # for it. 23 | if topic.level = 1 then { # only primary topics affect the group 24 | if not(\groupchar == topic.groupchar) then 25 | write("\\indexgroup ", groupchar := topic.groupchar) 26 | } 27 | else 28 | topic.type := "N" # subtopics are always printed normally 29 | 30 | # Write the index term 31 | writes("\\indexentry {", topic.level - 1, "}{", 32 | edit_term(topic.term), "}{", topic.type, "}{") 33 | 34 | # Write the list of pages 35 | write(edit_pages(topic.pages, topic.term), "}") 36 | } 37 | end 38 | 39 | procedure get_topic_info() 40 | local page, type, full_term, flags # info in an index item 41 | local term # the index term to be printed (part of full_term) 42 | local item_text # holds an input item to be parsed 43 | local topic # the topic we're now working on 44 | local term_list_info # returned term_list_record from get_term_list 45 | local term_list # list of index terms extracted from the input item 46 | local first # position of first thing in term_list to print 47 | local t # loop variable 48 | local term1 # first term in full_term, usually the only one 49 | 50 | term_list := [] 51 | 52 | # At the start of each pass through this loop, `topic' contains the text of 53 | # the index topic most recently seen together with the pages seen so far for 54 | # that index topic. 55 | 56 | every !&input ? (tab(find("@@@")\1), move(3), item_text := tab(0)) do { 57 | 58 | # Dissect the original index item, discarding the key 59 | 60 | item_text ? (full_term := tab(find("::")), move(2), 61 | type := tab(find("::")), move(2), 62 | page := tab(many('-0123456789*')), flags := tab(0)) 63 | # a page of * indicates a see-also 64 | 65 | term_list_info := get_term_list(full_term, term_list) 66 | term_list := term_list_info.term_list 67 | if type == (\topic).type then # no change of type 68 | first := term_list_info.start 69 | else 70 | first := 1 # change of type, so all terms are different 71 | term1 := term_list[\first] 72 | 73 | # If we've finished the current topic, produce it and start the next one 74 | 75 | if \first then { 76 | suspend \topic 77 | topic := topic_entry(term1, type, find_groupchar(term1), [], first) 78 | every t := !term_list[first + 1:0] do { 79 | suspend topic 80 | topic.term := t; topic.type := "N"; topic.level +:= 1 81 | } } 82 | put(topic.pages, 83 | if page == "*" then 84 | flags # flags here is the see-also 85 | else 86 | pgrec(page, cset(flags))) 87 | } 88 | suspend topic 89 | fail 90 | end 91 | 92 | procedure edit_term(term) 93 | # This procedure edits `term' into a proper argument for \indexterm 94 | 95 | if term == " " then 96 | term := "\\visiblespace" 97 | else if *term = 1 then 98 | term := "\\char `\\" || term 99 | else if match("^^", term) then 100 | term := "\\twocarets " || term[3:0] 101 | else if term == "$$" then 102 | term := "\\$\\$" 103 | # $$ is the only other 2-character sequence that has to be protected. 104 | return term 105 | end 106 | 107 | procedure edit_pages(l, term) 108 | # edit_pages removes duplicate pages from the page list, produces the 109 | # macro call for a principal entry, and coalesces page ranges. 110 | # It also converts negative numbers to roman numerals. 111 | # Each element of l is a pgrec, except that the last (and possibly only) 112 | # element may be a see-also string starting with *. 113 | # The result is a list of strings 114 | local pg, n, m, pf, see_also, pagelist 115 | local l1, k 116 | 117 | # If the last element of l is a string, remove it and set it aside. 118 | # It's a see-also. 119 | if type(l[-1]) == "string" then 120 | {see_also := l[-1]; l := l[1:-1]} 121 | 122 | 123 | # First pass through the page list, coalescing duplicates and combining 124 | # their flags. 125 | 126 | l1 := [] 127 | while *l > 0 do { 128 | pg := pop(l); n := pg.number; pf := pg.flags 129 | 130 | # Loop over pages 2..k within a group 131 | 132 | while n = l[1].number do 133 | pf ++:= pop(l).flags 134 | 135 | if *(pf ** 'BE') = 2 then # delete B and E if they both occur 136 | pf --:= 'BE' 137 | put(l1, pgrec(n, pf)) 138 | } 139 | 140 | # Now l1 has no duplicates and no trivial page ranges. Replace each 141 | # page range by a single entry, inverting the order for negative page 142 | # numbers since those indicate roman numerals. 143 | # When we're done, l1 has a list of strings rather than a list of pgrecs. 144 | 145 | l := l1; l1 := [] 146 | while *l > 0 do { 147 | pg := pop(l); n := pg.number; pf := pg.flags 148 | if *(pf ** 'E') > 0 then { 149 | every write(errfiles(), "Unmatched end of page range, page ", 150 | integer(n), ", index term `", term, "'!") 151 | pf --:= 'E' 152 | } 153 | if *(pf ** 'B') > 0 then { # beginning a page range 154 | every k := 1 to *l do { 155 | pf ++:= l[k].flags 156 | if *(pf ** 'E') > 0 then break 157 | } 158 | if *(pf ** 'E') = 0 then { 159 | every write(errfiles(), "Unmatched beginning of page range, page ", 160 | integer(n), ", index term `", term, "'!") 161 | pf := pg.flags 162 | } 163 | else { 164 | m := l[k].number 165 | if m < 0 then { # roman numerals 166 | m := "\\r" || -m 167 | n := "\\r" || -n 168 | } 169 | n := string(n || "--" || m) 170 | l := l[k+ 1:0] 171 | } } 172 | else if n < 0 then 173 | n := "\\r" || -n 174 | if *(pf ** 'P') > 0 then 175 | n := "\\pp{" || n || "}" 176 | put(l1, n) 177 | } 178 | 179 | # Now l1 is a list of page numbers and page ranges. 180 | # If it's empty and we have a see-also, make it a \see and return it. 181 | 182 | if *l1 = 0 then 183 | return "\\see{" || \see_also || "}" | "" 184 | 185 | # Turn l1 into a string and insert the comma commands \ic and \c 186 | # \ic goes at the beginning, \c between the remaining elements. 187 | 188 | pagelist := "\\ic " || pop(l1) | "" 189 | every pagelist ||:= "\\c " || !l1 190 | 191 | # Now attach the see-also to pagelist if we had one and return the result 192 | 193 | return pagelist || ("\\seealso{" || \see_also || "}" | "") 194 | end 195 | 196 | procedure find_groupchar(t) 197 | # This procedure finds the character that heads the group containing 198 | # the index term `t'. We want all special characters in a single group 199 | # and all digits in a single group. 200 | # A term that begins with `\\quad&#\hfil\cr 335 | %argument&a single token or some text enclosed in braces\cr 336 | %charcode&a character code, i.e., an integer between $0$ and $255$\cr 337 | %dimen&a dimension, i.e., a length\cr 338 | %glue&glue (with optional stretch and shrink)\cr 339 | %number&an optionally signed integer (whole number)\cr 340 | %register&a register number between $0$ and $255$\cr 341 | %}} 342 | %^^{\} 343 | %^^{\} 344 | %^^{\} 345 | %^^{\} 346 | %^^{\} 347 | %^^{\} 348 | \display{% 349 | \halign{\<#>\quad&#\hfil\cr 350 | argument&单个记号或者放在花括号中的一些文本\cr 351 | charcode&字符码,即在$0$到$255$之间的整数\cr 352 | dimen&尺寸,即长度\cr 353 | glue&粘连(有可选的伸展值和收缩值)\cr 354 | number&可带符号的整型值(整数)\cr 355 | register&寄存器编号,在$0$到$255$之间\cr 356 | }} 357 | \aridxref{dimen} 358 | \aridxref{argument} 359 | \aridxref{charcode} 360 | \aridxref{glue} 361 | \aridxref{number} 362 | \aridxref{register} 363 | 364 | % \noindent 365 | % All of these terms are explained in more detail in \chapterref{concepts}. 366 | % In addition, we sometimes use terms such as \ that are either 367 | % self-explanatory or explained in the description of the command. 368 | % Some commands have special formats that require either braces or 369 | % particular words. 370 | % These are set in the same bold font that we use 371 | % for the command headings. 372 | 373 | \noindent 374 | 所有这些术语会在\chapterref{concepts}中进行详述。 375 | 除了这些以外,我们会使用一些不言自明的或者在后文进行讲述的术语,比如 \. 376 | 有些命令有自己独特的格式,比如需要括孤或者特定的字词。 377 | 它们会使用和命令标题相同的黑体标出。 378 | 379 | % Some commands are parameters (\xref{introparms}) or table entries. 380 | % ^^{parameters//as commands} 381 | % This is indicated in the command's listing. 382 | % You can either use a parameter as an argument or assign a value to it. 383 | % The same holds for table entries. 384 | % We use the term ``parameter'' to refer to entities such as |\pageno| 385 | % that are actually registers but behave just like parameters. 386 | % ^^{registers//parameters as} 387 | 388 | 有些命令是参数 (\xref{introparms}) 或表格项。 389 | ^^{参数//作为命令} 390 | 这会在命令的列表中指示出来。 391 | 你可以将这个参数作为一个命令的参量,也可以给它赋值。 392 | 表格项也是如此。 393 | 我们使用``参数''这个术语来指代这些条目,比如本是寄存器但可当参数使用的 |\pageno|. 394 | ^^{寄存器//作为参数} 395 | 396 | \ifcompletebook\else 397 | \vskip4em{\sectionfonts\leftline{本章索引}} 398 | \readindexfile{i} 399 | \fi 400 | 401 | \endchapter 402 | \byebye 403 | -------------------------------------------------------------------------------- /xeCJK-base.tex: -------------------------------------------------------------------------------- 1 | \input miniltx 2 | \def\settowidth#1#2{% 3 | \setbox\@tempboxa\hbox{{#2}}#1\wd\@tempboxa 4 | \setbox\@tempboxa\box\voidb@x} 5 | 6 | \endlinechar \m@ne 7 | 8 | \newif\ifxeCJK@checksingle 9 | \newif\ifxeCJK@space@ 10 | 11 | \def\xeCJK@patch#1#2#3{ 12 | \edef#1{\unexpanded{#2}\unexpanded\expandafter{#1}\unexpanded{#3}}} 13 | \def\makexeCJKactive{\XeTeXinterchartokenstate=1\relax} 14 | \def\makexeCJKinactive{\XeTeXinterchartokenstate=0\relax} 15 | \makexeCJKactive 16 | \def\xeCJKsetcharclass#1#2#3{ 17 | \@tempcnta=#1 18 | \loop 19 | \XeTeXcharclass \@tempcnta #3\relax 20 | \advance\@tempcnta 1\relax 21 | \unless\ifnum\the\@tempcnta>#2 \repeat 22 | \xeCJK@setpunctcharclass} 23 | \def\xeCJK@prePunct#1#2{\xeCJK@setPunct{2}{#1}{#2}} 24 | \def\xeCJK@postPunct#1#2{\xeCJK@setPunct{3}{#1}{#2}} 25 | \def\xeCJK@setPunct#1#2#3{ 26 | \def\xeCJK@class{#1} 27 | \@tempcnta "#2\relax 28 | \multiply\@tempcnta 256\relax 29 | \xeCJK@setPunct@#3,,} 30 | \def\xeCJK@setPunct@#1,{ 31 | \edef\xeCJK@temp{#1}% 32 | \unless\ifx\xeCJK@temp\@empty 33 | \@tempcntb "#1\relax 34 | \advance\@tempcntb\@tempcnta\relax 35 | \XeTeXcharclass \@tempcntb=\xeCJK@class\relax 36 | \def\xeCJK@temp{\xeCJK@setPunct@} 37 | \fi 38 | \xeCJK@temp} 39 | \def\xeCJK@setpunctcharclass{ 40 | \xeCJK@prePunct{20}{18,1C} 41 | \xeCJK@postPunct{20}{19,1D,14,26} 42 | \xeCJK@postPunct{25}{00} 43 | \xeCJK@prePunct{30}{08,0A,0C,0E,10,12,14,16,18,1A,1D,1F,36} 44 | \xeCJK@postPunct{30}{01,02,05,06,09,0B,0D,0F,11,15,17,19,1B,1E, 45 | 41,43,45,47,49,63,83,85,87,8E, 46 | 9B,9C,9D,9E,A1,A3,A5,A7,A9,C3,E3,E5,E7,EE,F5,F6,FB,FC,FD,FE} 47 | \xeCJK@prePunct {FE}{59,5B,5D,5F,60,69,6B} 48 | \xeCJK@postPunct{FE}{50,51,52,54,55,56,57,5A,5C,5E,6A} 49 | \xeCJK@prePunct {FF}{03,04,08,20,3B,5B,E0,E1,E5,E6} 50 | \xeCJK@postPunct{FF}{01,05,09,0C,0E,1A,1B,1F,3D,5D, 51 | 61,63,64,65,67,68,69,6A,6B,6C,6D,6E,6F,70,9E,9F} 52 | \xeCJK@setPunct{1}{0}{B7} 53 | \xeCJK@setPunct{4}{0}{28,2D,5B,60,7B} 54 | \xeCJK@setPunct{5}{0}{21,22,25,27,29,2C,2E,3A,3B,3F,5D,7D}} 55 | \xeCJKsetcharclass{"1100}{"11FF}{1} 56 | \xeCJKsetcharclass{"2E80}{"2EFF}{1} 57 | \xeCJKsetcharclass{"2F00}{"2FDF}{1} 58 | \xeCJKsetcharclass{"2FF0}{"2FFF}{1} 59 | \xeCJKsetcharclass{"3000}{"303F}{1} 60 | \xeCJKsetcharclass{"3040}{"309F}{1} 61 | \xeCJKsetcharclass{"30A0}{"30FF}{1} 62 | \xeCJKsetcharclass{"3100}{"312F}{1} 63 | \xeCJKsetcharclass{"3130}{"318F}{1} 64 | \xeCJKsetcharclass{"3190}{"319F}{1} 65 | \xeCJKsetcharclass{"31A0}{"31BF}{1} 66 | \xeCJKsetcharclass{"31C0}{"31EF}{1} 67 | \xeCJKsetcharclass{"31F0}{"31FF}{1} 68 | \xeCJKsetcharclass{"3200}{"32FF}{1} 69 | \xeCJKsetcharclass{"3300}{"33FF}{1} 70 | \xeCJKsetcharclass{"3400}{"4DBF}{1} 71 | \xeCJKsetcharclass{"4E00}{"9FFF}{1} 72 | \xeCJKsetcharclass{"A000}{"A4CF}{1} 73 | \xeCJKsetcharclass{"AC00}{"D7AF}{1} 74 | \xeCJKsetcharclass{"F900}{"FAFF}{1} 75 | \xeCJKsetcharclass{"FE30}{"FE4F}{1} 76 | \xeCJKsetcharclass{"FF00}{"FFEF}{1} 77 | \xeCJKsetcharclass{"20000}{"2A6DF}{1} 78 | \xeCJKsetcharclass{"2A700}{"2B73F}{1} 79 | \xeCJKsetcharclass{"2B740}{"2B81F}{1} 80 | \xeCJKsetcharclass{"2F800}{"2FA1F}{1} 81 | \def\CJK@stop{\CJK@stop} 82 | \def\normalspacedchars#1{ 83 | \xeCJK@setnormalspacedchar#1\CJK@stop} 84 | \def\xeCJK@setnormalspacedchar#1{ 85 | \unless\ifx#1\CJK@stop 86 | \XeTeXcharclass`#1=6 87 | \expandafter\xeCJK@setnormalspacedchar 88 | \fi} 89 | \normalspacedchars{/} 90 | \XeTeXinterchartoks 1 0{\egroup\CJKecglue} 91 | \XeTeXinterchartoks 1 1{\xeCJK@i@i} 92 | \XeTeXinterchartoks 1 2{\xeCJK@i@ii} 93 | \XeTeXinterchartoks 1 3{\xeCJK@i@iii} 94 | \XeTeXinterchartoks 1 4{\egroup\CJKecglue} 95 | \XeTeXinterchartoks 1 5{\egroup} 96 | \XeTeXinterchartoks 1 255{\xeCJK@i@cclv} 97 | \XeTeXinterchartoks 2 0{\xeCJK@ii@} 98 | \XeTeXinterchartoks 2 1{\xeCJK@ii@i} 99 | \XeTeXinterchartoks 2 2{\xeCJK@ii@ii} 100 | \XeTeXinterchartoks 2 3{\xeCJK@ii@iii} 101 | \XeTeXinterchartoks 2 4{\xeCJK@ii@iv} 102 | \XeTeXinterchartoks 2 5{\xeCJK@ii@v} 103 | \XeTeXinterchartoks 2 255{\xeCJK@ii@cclv} 104 | \XeTeXinterchartoks 3 0{\xeCJK@iii@} 105 | \XeTeXinterchartoks 3 1{\xeCJK@iii@i} 106 | \XeTeXinterchartoks 3 2{\xeCJK@iii@ii} 107 | \XeTeXinterchartoks 3 3{\xeCJK@iii@iii} 108 | \XeTeXinterchartoks 3 4{\xeCJK@iii@iv} 109 | \XeTeXinterchartoks 3 5{\xeCJK@iii@v} 110 | \XeTeXinterchartoks 3 255{\xeCJK@iii@cclv} 111 | \XeTeXinterchartoks 0 1{\xeCJK@@i} 112 | \XeTeXinterchartoks 0 2{\xeCJK@@ii} 113 | \XeTeXinterchartoks 0 3{\xeCJK@@iii} 114 | \XeTeXinterchartoks 0 255{\xeCJK@@cclv} 115 | \XeTeXinterchartoks 4 1{\xeCJK@iv@i} 116 | \XeTeXinterchartoks 4 2{\xeCJK@iv@ii} 117 | \XeTeXinterchartoks 4 3{\xeCJK@iv@iii} 118 | \XeTeXinterchartoks 5 1{\xeCJK@v@i} 119 | \XeTeXinterchartoks 5 2{\xeCJK@v@ii} 120 | \XeTeXinterchartoks 5 3{\xeCJK@v@iii} 121 | \XeTeXinterchartoks 5 255{\xeCJK@v@cclv} 122 | \XeTeXinterchartoks 255 0{\xeCJK@cclv@} 123 | \XeTeXinterchartoks 255 1{\xeCJK@cclv@i} 124 | \XeTeXinterchartoks 255 2{\xeCJK@cclv@ii} 125 | \XeTeXinterchartoks 255 3{\xeCJK@cclv@iii} 126 | \XeTeXinterchartoks 255 4{\xeCJK@cclv@iv} 127 | \XeTeXinterchartoks 255 6{\xeCJK@cclv@vi} 128 | \XeTeXinterchartoks 1 6{\xeCJK@i@vi} 129 | \XeTeXinterchartoks 2 6{\xeCJK@ii@vi} 130 | \XeTeXinterchartoks 3 6{\xeCJK@iii@vi} 131 | \XeTeXinterchartoks 6 1{\xeCJK@vi@i} 132 | \XeTeXinterchartoks 6 2{\xeCJK@vi@ii} 133 | \XeTeXinterchartoks 6 3{\xeCJK@vi@iii} 134 | \XeTeXinterchartoks 6 255{\xeCJK@vi@cclv} 135 | \def\xeCJK@vi@i{ 136 | \bgroup 137 | \xeCJK@emptyCJKtoks 138 | \xeCJK@setfont 139 | \CJKsymbol} 140 | \def\xeCJK@i@vi{ 141 | \egroup} 142 | \let\xeCJK@ii@vi \xeCJK@i@vi 143 | \let\xeCJK@iii@vi\xeCJK@i@vi 144 | \let\xeCJK@vi@ii \xeCJK@vi@i 145 | \let\xeCJK@vi@iii\xeCJK@vi@i 146 | \def\xeCJK@i@i{ 147 | \CJKglue 148 | \CJKsymbol} 149 | \let\xeCJK@i@i@save\xeCJK@i@i 150 | \def\xeCJK@i@ii#1{ 151 | \xeCJK@punctrule{#1}{l} 152 | \hskip \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @lglue@#1\endcsname 153 | plus 0.1em minus 0.1 em 154 | \xeCJK@setprepunct{#1}} 155 | \def\xeCJK@i@iii#1{ 156 | \xeCJK@punctrule{#1}{r} 157 | \ifcsname xeCJK@specialpunct#1\endcsname 158 | \CJKglue % breakable 159 | \else 160 | \nobreak 161 | \fi 162 | \xdef\xeCJK@lastpunct{#1} 163 | \CJKpunctsymbol{#1}} 164 | \def\xeCJK@setprepunct#1{ 165 | \edef\xeCJK@lastpunct{#1} 166 | \vrule width \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname 167 | @lrule@#1\endcsname depth \z@ height \z@ 168 | \CJKpunctsymbol{#1}} 169 | \def\xeCJK@i@cclv{ 170 | \egroup 171 | {\xeCJK@CJKkern} 172 | \xeCJK@ignorespaces} 173 | \def\xeCJK@ii@i{ 174 | \nobreak 175 | \CJKsymbol} 176 | \def\xeCJK@ii@ii#1{ 177 | \nobreak 178 | \xeCJK@punctrule{#1}{l} 179 | \xeCJK@setkern{\xeCJK@lastpunct}{#1} 180 | \kern \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern\xeCJK@lastpunct#1\endcsname 181 | \xeCJK@setprepunct{#1}} 182 | \def\xeCJK@ii@iii#1{ 183 | \nobreak 184 | \xeCJK@punctrule{#1}{r} 185 | \xeCJK@setkern{\xeCJK@lastpunct}{#1} 186 | \kern \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern\xeCJK@lastpunct#1\endcsname 187 | \nobreak 188 | \edef\xeCJK@lastpunct{#1} 189 | \CJKpunctsymbol{#1}} 190 | \def\xeCJK@ii@{ 191 | \nobreak 192 | \egroup} 193 | \let\xeCJK@ii@iv\xeCJK@ii@ 194 | \let\xeCJK@ii@v\xeCJK@ii@ 195 | \def\xeCJK@ii@cclv{ 196 | \nobreak 197 | \egroup 198 | \ignorespaces} 199 | \def\xeCJK@iii@{ 200 | \xeCJK@afterpostpunct 201 | \egroup} 202 | \def\xeCJK@iii@i{ 203 | \xeCJK@afterpostpunct 204 | \CJKsymbol} 205 | \def\xeCJK@iii@ii#1{ 206 | \vrule width \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname 207 | @rrule@\xeCJK@lastpunct\endcsname depth \z@ height \z@ 208 | \xeCJK@punctrule{#1}{l} 209 | \xeCJK@setkern{\xeCJK@lastpunct}{#1} 210 | \kern \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern\xeCJK@lastpunct#1\endcsname 211 | \xeCJKpunctnobreak 212 | \xeCJK@setprepunct{#1}} 213 | \def\xeCJK@iii@iii#1{ 214 | \vrule width \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname 215 | @rrule@\xeCJK@lastpunct\endcsname depth \z@ height \z@ 216 | \xeCJK@punctrule{#1}{r} 217 | \xeCJK@setkern{\xeCJK@lastpunct}{#1} 218 | \kern \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern\xeCJK@lastpunct#1\endcsname 219 | \nobreak 220 | \edef\xeCJK@lastpunct{#1} 221 | \CJKpunctsymbol{#1}} 222 | \def\xeCJK@iii@iv{ 223 | \xeCJK@afterpostpunct 224 | \egroup} 225 | \def\xeCJK@afterpostpunct{ 226 | \vrule width \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname 227 | @rrule@\xeCJK@lastpunct\endcsname depth \z@ height \z@ 228 | \hskip \csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @rglue@\xeCJK@lastpunct\endcsname 229 | plus 0.1em minus 0.1 em} 230 | \let\xeCJK@iii@v\xeCJK@iii@iv 231 | \def\xeCJK@iii@cclv{ 232 | \xeCJK@afterpostpunct 233 | \egroup 234 | \ignorespaces} 235 | \def\xeCJK@@i{ 236 | \CJKecglue 237 | \bgroup 238 | \xeCJK@setfont 239 | \xeCJK@emptyCJKtoks 240 | \CJKsymbol} 241 | \def\xeCJK@@ii{ 242 | \bgroup 243 | \xeCJK@setfont 244 | \XeTeXinterchartoks 0 2{\relax} 245 | \xeCJK@emptyCJKtoks 246 | \xeCJK@i@ii} 247 | \def\xeCJK@@iii{ 248 | \bgroup 249 | \xeCJK@setfont 250 | \XeTeXinterchartoks 0 3{\relax} 251 | \xeCJK@emptyCJKtoks 252 | \xeCJK@i@iii} 253 | \def\xeCJK@iv@i{ 254 | \bgroup 255 | \xeCJK@setfont 256 | \XeTeXinterchartoks 4 1{\relax} 257 | \xeCJK@emptyCJKtoks 258 | \CJKsymbol} 259 | \def\xeCJK@iv@ii{ 260 | \bgroup 261 | \xeCJK@setfont 262 | \XeTeXinterchartoks 4 2{\relax} 263 | \xeCJK@emptyCJKtoks 264 | \xeCJK@i@ii} 265 | \def\xeCJK@iv@iii{ 266 | \bgroup 267 | \xeCJK@setfont 268 | \XeTeXinterchartoks 4 3{\relax} 269 | \xeCJK@emptyCJKtoks 270 | \xeCJK@i@iii} 271 | \def\xeCJK@v@i{ 272 | \CJKecglue 273 | \bgroup 274 | \xeCJK@setfont 275 | \xeCJK@emptyCJKtoks 276 | \CJKsymbol} 277 | \def\xeCJK@v@ii{ 278 | \bgroup 279 | \xeCJK@setfont 280 | \XeTeXinterchartoks 5 2{\relax} 281 | \xeCJK@emptyCJKtoks 282 | \xeCJK@i@ii} 283 | \def\xeCJK@v@iii{ 284 | \bgroup 285 | \xeCJK@setfont 286 | \XeTeXinterchartoks 5 3{\relax} 287 | \xeCJK@emptyCJKtoks 288 | \xeCJK@i@iii} 289 | \def\xeCJK@emptyCJKtoks{ 290 | \XeTeXinterchartoks 255 1{\relax} 291 | \XeTeXinterchartoks 255 2{\relax} 292 | \XeTeXinterchartoks 255 3{\relax}} 293 | \def\xeCJK@@cclv{ 294 | \futurelet\xeCJK@nexttoken\xeCJK@zz@cclv} 295 | \def\xeCJK@zz@cclv{ 296 | \ifx\xeCJK@nexttoken\@sptoken 297 | {\xeCJK@spkern} 298 | \else 299 | {\xeCJK@zerokern} 300 | \fi} 301 | \let\xeCJK@v@cclv\xeCJK@@cclv 302 | \let\xeCJK@vi@cclv\xeCJK@@cclv 303 | \def\xeCJK@cclv@{ 304 | \ifnum\lastkern=\@ne 305 | \CJKecglue 306 | \fi} 307 | \let\xeCJK@cclv@iv\xeCJK@cclv@ 308 | \let\xeCJK@cclv@vi\xeCJK@cclv@ 309 | \def\xeCJK@cclv@i{{ 310 | \ifnum\lastkern=\@ne 311 | \CJKglue 312 | \else 313 | \ifnum\lastkern=\xeCJK@four 314 | \CJKecglue 315 | \else 316 | \ifnum\lastnodetype=\xeCJK@ten 317 | \CJKecglue 318 | \else 319 | \ifnum\lastnodetype=\xeCJK@eleven 320 | \settowidth\@tempdima\@sptoken 321 | \ifdim\lastskip=\@tempdima 322 | \@tempskipa=\lastskip 323 | \unskip 324 | \ifnum\lastkern=\tw@ 325 | \CJKecglue 326 | \else 327 | \ifnum\lastnodetype=\xeCJK@ten 328 | \CJKecglue 329 | \else 330 | \ifnum\lastkern=\xeCJK@four 331 | \CJKecglue 332 | \else 333 | \hskip\@tempskipa 334 | \fi\fi\fi\fi\fi\fi\fi\fi} 335 | \bgroup 336 | \xeCJK@emptyCJKtoks 337 | \xeCJK@setfont 338 | \CJKsymbol} 339 | \def\xeCJK@cclv@ii{ 340 | \bgroup 341 | \xeCJK@emptyCJKtoks 342 | \xeCJK@setfont 343 | \xeCJK@i@ii} 344 | \def\xeCJK@cclv@iii{ 345 | \bgroup 346 | \xeCJK@emptyCJKtoks 347 | \xeCJK@setfont 348 | \xeCJK@i@iii} 349 | \def\CJKglue{\hskip \z@ \@plus .08\baselineskip} 350 | \def\CJK@nobreakglue{\nobreak\CJKglue\nobreak} 351 | \edef\xeCJK@CJKkern{\kern -1sp\kern 1sp} 352 | \edef\xeCJK@spkern{\kern -2sp\kern 2sp} 353 | \edef\xeCJK@zerokern{\kern -4sp\kern 4sp} 354 | \chardef\xeCJK@four=4 355 | \chardef\xeCJK@ten=10 356 | \chardef\xeCJK@eleven=11 357 | \def\CJKspace{\let\xeCJK@ignorespaces\@empty} 358 | \def\CJKnospace{\def\xeCJK@ignorespaces{\xeCJK@@ignorespaces}} 359 | \ifxeCJK@space@ 360 | \CJKspace 361 | \else 362 | \CJKnospace 363 | \fi 364 | \def\xeCJK@@ignorespaces{ 365 | \futurelet\xeCJK@nexttoken\xeCJK@checknext} 366 | \def\xeCJK@checknext{ 367 | \ifx\xeCJK@nexttoken\@sptoken 368 | \expandafter\xeCJK@@checknext 369 | \else 370 | \ifx $\xeCJK@nexttoken 371 | \CJKecglue 372 | \fi 373 | \fi} 374 | { 375 | \def\:{\xeCJK@@checknext} 376 | \global\expandafter\def\: {\futurelet\@let@token\xeCJK@@@checknext} 377 | } 378 | \def\xeCJK@@@checknext{ 379 | \ifx $\@let@token 380 | \CJKecglue 381 | \else 382 | \if\relax\noexpand\@let@token 383 | \unless\ifx\@let@token\xeCJK@par 384 | \CJKecglue 385 | \fi 386 | \fi 387 | \fi 388 | \let\xeCJK@nexttoken\relax} 389 | \def\xeCJKenablechecksingle{\def\xeCJK@i@i{\xeCJK@checksingle}} 390 | \def\xeCJKdisablechecksingle{\let\xeCJK@i@i\xeCJK@i@i@save} 391 | \ifxeCJK@checksingle 392 | \AtEndOfPackage{\xeCJKenablechecksingle} 393 | \fi 394 | \def\xeCJK@checksingle#1{ 395 | \def\xeCJK@setcurrentchar@i{ 396 | \CJKglue 397 | \CJKsymbol{#1}} 398 | \def\xeCJK@setcurrentnobreakchar@i{ 399 | \CJKsymbol{#1}} 400 | \futurelet\@let@token\xeCJK@@checksingle} 401 | \def\xeCJK@@checksingle{ 402 | \ifcat 。\noexpand\@let@token 403 | \expandafter\xeCJK@@@checksingle 404 | \else 405 | \expandafter\xeCJK@setcurrentchar@i 406 | \fi} 407 | \def\xeCJK@@@checksingle#1{ 408 | \def\xeCJK@setcurrentchar@ii{ 409 | \xeCJK@setcurrentchar@i #1} 410 | \def\xeCJK@setcurrentchar@ii@s{ 411 | \xeCJK@setcurrentchar@i #1 } 412 | \def\xeCJK@setcurrentnobreakchar@ii{ 413 | \xeCJK@setcurrentnobreakchar@i #1} 414 | \futurelet\@let@token\xeCJK@@@@checksingle} 415 | \def\xeCJK@@@@checksingle{ 416 | \ifx\@let@token\@sptoken 417 | \expandafter\xeCJK@checkpar 418 | \else 419 | \expandafter\xeCJK@setcurrentchar@ii 420 | \fi} 421 | \let\xeCJK@par\par 422 | \def\xeCJK@checkpar{ 423 | \@ifnextchar\xeCJK@par{\xeCJK@setcurrentnobreakchar@ii}{\xeCJK@setcurrentchar@ii@s}} 424 | \def\xeCJKsetecglue#1{ 425 | \def\CJK@ecglue{#1} 426 | \let\CJKecglue\CJK@ecglue} 427 | \let\CJKsetecglue\xeCJKsetecglue 428 | \CJKsetecglue{ } 429 | \def\xeCJKallowbreakbetweenpuncts{ 430 | \def\xeCJKpunctnobreak{ 431 | \hskip \z@\relax}} 432 | \def\xeCJKnobreakbetweenpuncts{ 433 | \let\xeCJKpunctnobreak\nobreak} 434 | \xeCJKnobreakbetweenpuncts 435 | \let\xeCJK@itcorr\/ 436 | \def\/{% 437 | \relax 438 | \ifnum\lastkern=4 % 439 | \unkern\unkern 440 | \fi 441 | \xeCJK@itcorr} 442 | \let\@@italiccorr=\/ 443 | \newcount\xeCJK@cnta 444 | \newcount\xeCJK@cntb 445 | \newcount\xeCJK@cntc 446 | \newcount\xeCJK@cntd 447 | \newcount\xeCJK@cnte 448 | \newdimen\xeCJK@dima 449 | \newif\ifxeCJK@dokerning 450 | \def\xeCJK@punctrule#1#2{ 451 | \xdef\xeCJK@bboxname{\xeCJK@fontname} 452 | \unless\ifcsname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @#2rule@#1\endcsname 453 | \unless\ifcsname xeCJK@\xeCJK@bboxname @lspace@#1\endcsname 454 | {\xeCJK@setfont\xeCJK@setpunctbounds{#1}} 455 | \fi 456 | \xeCJK@dokerningtrue 457 | \ifnum\xeCJK@punctstyle=\xeCJK@ps@plain\relax 458 | \xeCJK@dokerningfalse 459 | \else 460 | \ifcsname xeCJK@specialpunct#1\endcsname 461 | \xeCJK@dokerningfalse 462 | \fi 463 | \fi 464 | \ifxeCJK@dokerning 465 | \xeCJK@cnta=\csname xeCJK@\xeCJK@bboxname @#2space@#1\endcsname\relax 466 | \xeCJK@cntc=\xeCJK@cnta 467 | \ifcase\xeCJK@punctstyle 468 | % hangmobanjiao 469 | \or % quanjiao 470 | \or % banjiao 471 | \advance\xeCJK@cntc -50\relax 472 | \or % kaiming 473 | \ifcsname xeCJK@kaiming#1\endcsname 474 | \advance\xeCJK@cntc -20\relax 475 | \else 476 | \advance\xeCJK@cntc -50\relax 477 | \fi 478 | \or % CCT 479 | \ifcsname xeCJK@kaiming#1\endcsname 480 | \advance\xeCJK@cntc -20\relax 481 | \else 482 | \advance\xeCJK@cntc -30\relax 483 | \fi 484 | \fi 485 | \xeCJK@cntd=\xeCJK@cntc 486 | \ifnum\xeCJK@cntc<0\relax 487 | \xeCJK@cntc=0\relax 488 | \fi 489 | \else 490 | \xeCJK@cnta=0\relax 491 | \xeCJK@cntc=0\relax 492 | \xeCJK@cntd=0\relax 493 | \fi 494 | \xeCJK@numtodim{\xeCJK@cnta} 495 | \expandafter\xdef\csname 496 | xeCJK\xeCJK@punctstyle\xeCJK@bboxname @#2rule@#1\endcsname{ 497 | -\xeCJK@temp em} 498 | \xeCJK@numtodim{\xeCJK@cntc} 499 | \expandafter\xdef\csname 500 | xeCJK\xeCJK@punctstyle\xeCJK@bboxname @#2glue@#1\endcsname{ 501 | \xeCJK@temp em} 502 | \expandafter\xdef\csname 503 | xeCJK\xeCJK@punctstyle\xeCJK@bboxname @#2oglue@#1\endcsname{ 504 | \the\xeCJK@cntd} 505 | \fi} 506 | \def\xeCJK@numtodim#1{ 507 | \xeCJK@cnte=#1\relax 508 | \ifnum\the\xeCJK@cnte<100\relax 509 | \def\xeCJK@temp{0} 510 | \else 511 | \advance\xeCJK@cnte -100\relax 512 | \def\xeCJK@temp{1} 513 | \fi 514 | \ifnum\the\xeCJK@cnte<10 515 | \edef\xeCJK@temp{\xeCJK@temp.0\the\xeCJK@cnte} 516 | \else 517 | \edef\xeCJK@temp{\xeCJK@temp.\the\xeCJK@cnte} 518 | \fi} 519 | \expandafter\def\csname xeCJK@kaiming.\endcsname{} 520 | \expandafter\def\csname xeCJK@kaiming。\endcsname{} 521 | \expandafter\def\csname xeCJK@kaiming?\endcsname{} 522 | \expandafter\def\csname xeCJK@kaiming!\endcsname{} 523 | \expandafter\def\csname xeCJK@specialpunct—\endcsname{}% U+2014 524 | \expandafter\def\csname xeCJK@specialpunct─\endcsname{}% U+2500 525 | \expandafter\def\csname xeCJK@specialpunct…\endcsname{} 526 | \def\xeCJK@setkern#1#2{ 527 | \unless\ifcsname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern#1#2\endcsname 528 | \xeCJK@cnta=0\relax 529 | \ifcsname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @roglue@#1\endcsname 530 | \advance\xeCJK@cnta\csname 531 | xeCJK\xeCJK@punctstyle\xeCJK@bboxname @roglue@#1\endcsname 532 | \fi 533 | \ifcsname xeCJK\xeCJK@punctstyle\xeCJK@bboxname @loglue@#2\endcsname 534 | \advance\xeCJK@cnta\csname xeCJK\xeCJK@punctstyle\xeCJK@bboxname 535 | @loglue@#2\endcsname 536 | \fi 537 | \relax 538 | \ifcase\xeCJK@punctstyle 539 | % hangmobanjiao 540 | \or % quanjiao 541 | \advance\xeCJK@cnta -50\relax 542 | \or % banjiao 543 | \advance\xeCJK@cnta -50\relax 544 | \or % kaiming 545 | \advance\xeCJK@cnta -50\relax 546 | \or % CCT 547 | \advance\xeCJK@cnta -50\relax 548 | \fi 549 | \ifnum\xeCJK@cnta<0\relax 550 | \xeCJK@cnta=0\relax 551 | \fi 552 | \xeCJK@numtodim{\xeCJK@cnta} 553 | \expandafter\xdef\csname 554 | xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern#1#2\endcsname{ 555 | \xeCJK@temp em} 556 | \fi} 557 | \def\xeCJKsetkern#1#2#3{ 558 | \xdef\xeCJK@bboxname{\xeCJK@fontname} 559 | \expandafter\xdef\csname 560 | xeCJK\xeCJK@punctstyle\xeCJK@bboxname @kern#1#2\endcsname{#3}} 561 | \def\punctstyle#1{ 562 | \ifcsname xeCJK@ps@#1\endcsname 563 | \edef\xeCJK@punctstyle{\csname xeCJK@ps@#1\endcsname} 564 | \ifnum\xeCJK@punctstyle=\xeCJK@ps@plain\relax 565 | \xeCJKallowbreakbetweenpuncts 566 | \fi 567 | \else 568 | \PackageWarning{xeCJK}{Punctstyle #1\space is not defined.} 569 | \fi} 570 | \def\xeCJK@ps@hangmobanjiao{0} 571 | \def\xeCJK@ps@marginkerning{0} 572 | \def\xeCJK@ps@quanjiao{1} 573 | \def\xeCJK@ps@fullwidth{1} 574 | \def\xeCJK@ps@banjiao{2} 575 | \def\xeCJK@ps@halfwidth{2} 576 | \def\xeCJK@ps@kaiming{3} 577 | \def\xeCJK@ps@mixedwidth{3} 578 | \def\xeCJK@ps@CCT{4} 579 | \def\xeCJK@ps@plain{5} 580 | \punctstyle{quanjiao} 581 | \def\xeCJKplainchr{\punctstyle{plain}} 582 | \def\xeCJK@sidespace{10} 583 | \def\xeCJK@getglyphbounds#1{ 584 | \xeCJK@cnta=\number\XeTeXglyphbounds #1 \xeCJK@gid 585 | \xeCJK@dima 1em\relax 586 | \xeCJK@cntb=\number\xeCJK@dima 587 | \multiply\xeCJK@cnta 100\relax 588 | \divide\xeCJK@cnta\xeCJK@cntb 589 | \advance\xeCJK@cnta -15\relax 590 | \edef\xeCJK@temp{\the\xeCJK@cnta} 591 | \ifnum\xeCJK@temp<0\relax 592 | \def\xeCJK@temp{0} 593 | \fi} 594 | \def\xeCJK@setpunctbounds#1{ 595 | \edef\xeCJK@gid{\the\XeTeXcharglyph`#1} 596 | \xeCJK@getglyphbounds{1} 597 | \expandafter\xdef\csname xeCJK@\xeCJK@bboxname @lspace@#1\endcsname{ 598 | \xeCJK@temp} 599 | \xeCJK@getglyphbounds{3} 600 | \expandafter\xdef\csname xeCJK@\xeCJK@bboxname @rspace@#1\endcsname{ 601 | \xeCJK@temp} 602 | \ifcsname xeCJK@specialpunct#1\endcsname 603 | \unless\ifx#1… 604 | \xeCJK@cnta=\number\XeTeXglyphbounds 1 \xeCJK@gid 605 | \advance\xeCJK@cnta\number\XeTeXglyphbounds 3 \xeCJK@gid 606 | \xeCJK@dima 1em\relax 607 | \xeCJK@cntb=\number\xeCJK@dima 608 | \multiply\xeCJK@cnta 100\relax 609 | \divide\xeCJK@cnta\xeCJK@cntb 610 | \advance\xeCJK@cnta 1\relax 611 | \ifnum\xeCJK@cnta>9 612 | \edef\xeCJK@temp{-0.\the\xeCJK@cnta em} 613 | \else 614 | \ifnum\xeCJK@cnta>1 615 | \edef\xeCJK@temp{-0.0\the\xeCJK@cnta em} 616 | \else 617 | \edef\xeCJK@temp{-0.01 em} 618 | \fi 619 | \fi 620 | \xeCJK@cnta=0 621 | \loop 622 | \global\expandafter\edef\csname xeCJK\the\xeCJK@cnta\xeCJK@bboxname 623 | @kern#1#1\endcsname{\xeCJK@temp} 624 | \advance \xeCJK@cnta 1\relax 625 | \ifnum\xeCJK@cnta<6\repeat 626 | \fi 627 | \fi} 628 | \unless\ifcsname XeTeXglyphbounds\endcsname 629 | \PackageError{xeCJK}{\string\XeTeXglyphbounds \space not defined.^^J 630 | You have to update XeTeX to the version 0.9995.0 or later}{} 631 | \fi 632 | 633 | \def\CJKsymbol#1{#1} 634 | \def\CJKpunctsymbol#1{#1} 635 | 636 | % For pure plain TeX 637 | \def\xeCJK@setfont{\CJKfont} 638 | \def\xeCJK@fontname{\fontname\CJKfont} 639 | 640 | \def\CJKfont{\errmessage{xeCJK Error: You must define \noexpand\CJKfont first}} 641 | 642 | \endlinechar=`\^^M 643 | \resetatcatcode 644 | \endinput 645 | % vim:ft=plaintex 646 | -------------------------------------------------------------------------------- /xmptext.tex: -------------------------------------------------------------------------------- 1 | ~% -*- coding: utf-8 -*- 2 | ~% This is part of the book TeX for the Impatient. 3 | ~% Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. 4 | ~% See file fdl.tex for copying conditions. 5 | ~% TeX ignores anything on a line after a % 6 | ~% The next two lines define fonts for the title 7 | % TeX 忽略一行中 % 之后的任何内容 8 | % 下面两行定义标题所用的字体 9 | \font\xmplbx = cmbx10 scaled \magstephalf 10 | \font\xmplbxti = cmbxti10 scaled \magstephalf 11 | ~% Now here's the title. 12 | % 现在是标题行 13 | ~%\leftline{\xmplbx Example !xmpnum:\quad\xmplbxti Entering simple text} 14 | ~\bookmark{2}{例!xmpnum:输入简单文本}% 15 | \leftline{\xmplbx 例!xmpnum:\quad\xmplbxti 输入简单文本} 16 | \vglue .5\baselineskip % skip an extra half line 17 | ~\count255 = \pageno 18 | ~\xdef\examplepage{\number\count255} 19 | ~\markinfo{Example 1: Entering simple text} 20 | ~\ifrewritetocfile 21 | ~\write\tocfile{\string\tocsectionentry{输入简单文本}{\examplepage}}% 22 | ~\fi 23 | ~^^{脚注} ^^{注释} ^^{标点} ^^{引号} 24 | ~^^{空格符} ^^{横线号} ^^{段落//结束段落} 25 | ~\edef\examplepageno{\number\count255}% 26 | ~%It's easy to prepare ordinary text for \TeX\ since 27 | ~%\TeX\ usually doesn't care about how you break up your input into 28 | ~%lines. It treats the end of a line of text like a space.% 29 | ~%\footnote \dag{\TeX\ treats a tab like a space too, as we point 30 | ~%out in this {\it footnote}.} If you don't want a space there, 31 | ~%put a per% 32 | ~%cent sign (the comment character) at the end of the line. 33 | ~% \TeX\ ignores spaces at the start of a line, and treats more 34 | ~%than one space as equivalent to a single space, 35 | ~%even after a period. You indicate a new paragraph by 36 | ~%skipping a line (or more than one line). 37 | 38 | 由于 \TeX\ 并不关心原始的输入文本中的换行,因此,我们无须关心 39 | 应该给其提供何种格式化的文本。在 \TeX\ 看来,输入文本中的换行符 40 | 和空格等价。% 41 | \footnote \dag{\TeX\ 将 Tab 也当作空格处理,就如你在这个 42 | {\it 脚注}所见到的一样。} 如果你不想在行尾处看到空格, 43 | 可以在行尾处写一个百分号(注释符号)。\TeX\ 忽略行首的空格, 44 | 对多于一个的空格当做一个单独的空格看待 --- 哪怕这些空格位于 45 | 句号后面。你可以用一个或者多个空白行表示一个新的段落的开始。 46 | 47 | ~%When \TeX\ sees a period followed by a space (or the end of the 48 | ~%line, which is equivalent), it ordinarily assumes you've ended a 49 | ~%sentence and inserts a little extra space after the period. It 50 | ~%treats question marks and exclamation points the same way. 51 | 当 \TeX\ 看见一个句号后面紧接着一个空格(或者是一个行结束符,这 52 | 两者等价)时,它通常会认为此句号代表一句话的结束,并在句号的后面 53 | 加上一点小小的空格。同样的处理还适用于问号和惊叹号。 54 | 55 | ~% But \TeX's rules for handling periods sometimes need fine 56 | ~%tuning. \TeX\ assumes that a capital letter before a period 57 | ~%doesn't end the sentence, so you have to do something a little 58 | ~%different if, say, you're writing about DNA\null. 59 | 有时需要微调 \TeX\ 处理句号的方式。当句号前面紧跟着标题字 60 | 母(大写字母)时,\TeX\ 会认为这个句号并不做为句子的结束符, 61 | 因此在这种情况下,你需要作一些小改动。例如:我们这样写 DNA\null. 62 | ~% The \null prevents TeX from perceiving the capital `A' 63 | ~% as being next to the period. 64 | % \null 可以阻止 \TeX\ 感知句号前面的标题字母 `A'。 65 | ~%It's a good idea to tie words together in references such as 66 | ~%``see Fig.~8'' and in names such as V.~I\null. Lenin and in 67 | ~%$\ldots$ so that \TeX\ will never split them in an awkward place 68 | ~%between two lines. (The three dots indicate an ellipsis.) 69 | 在引用(如``Fig.~8'')、姓名(如``V.~I\null. Lenin'') 70 | 以及三个点$\ldots$中,最好把单词绑定在一起, 71 | 这样 \TeX\ 不会在它们的内部断行(三个点表示省略号)。 72 | 73 | ~%You should put quotations in pairs of left and right 74 | ~%single ``quotes'' so that you get the correct left and right 75 | ~%double quotation marks. ``For adjacent single and double 76 | ~%quotation marks, insert a `thinspace'\thinspace''. You can 77 | ~%get en-dashes--like so, and em-dashes---like so. 78 | 为得到正确的左右双引号,你需要用两个左右单``引号''。 79 | ``在相邻的单引号和双引号之间,要插入一个`小间隔'\thinspace''。 80 | 连接号--可以这样写,而破折号---可以这样写。 81 | 82 | ~%\bye % end the document 83 | \bye % 结束此文档 84 | ::: 85 | ~%\xmpheader !xmpnum/{Indentation}% !xmpheaddef 86 | \xmpheader !xmpnum/{缩进}% !xmpheaddef 87 | ~^^{缩进} ^^{边距} ^^{段落//窄段落} 88 | ~%\noindent Now let's see how to control indentation. If an 89 | ~%ordinary word processor can do it, so surely can \TeX. Note 90 | ~%that this paragraph isn't indented. 91 | \noindent 现在让我们来看看如何控制缩进。如果一个普通的文字处理 92 | 程序都能处理缩进的话,那 \TeX\ 一定也能。请注意,本段并未缩进。 93 | 94 | ~%Usually you'll either want to indent paragraphs or to leave 95 | ~%extra space between them. Since we haven't changed anything 96 | ~%yet, this paragraph is indented. 97 | 通常来说,你会想在段落的起始处安排缩进,在段落之间安排一些额外 98 | 的空白。由于我们在此尚未做任何特殊处理,因此本段是缩进的。 99 | 100 | {\parindent = 0pt \parskip = 6pt 101 | ~% The left brace starts a group containing the unindented text. 102 | % 这里的左括弧包裹了一组不缩进的文本 103 | 104 | ~%Let's do these two paragraphs a different way, 105 | ~%with no indentation and six printer's points of extra space 106 | ~%between paragraphs. 107 | 让我们对这两个段落作一些特殊处理,这两段将不缩进,并且两段 108 | 之间有 6pt 宽的空白。 109 | 110 | ~%So here's another paragraph that we're typesetting without 111 | ~%indentation. If we didn't put space between these paragraphs, 112 | ~%you would have a hard time knowing where one ends 113 | ~%and the next begins. 114 | 这是第二段不缩进的文字。如果不在这两段之间插入空白的话,将很难 115 | 分辨段与段之间的结束和起始。 116 | 117 | \par % The paragraph *must* be ended within the group. 118 | }% The right brace ends the group containing unindented text. 119 | 120 | ~%It's also possible to indent both sides of entire paragraphs. 121 | ~%The next three paragraphs illustrate this: 122 | 你也能在段落的两边同时缩进,下面的 3 段文字演示了双边缩进的效果: 123 | 124 | \smallskip % Provide a little extra space here. 125 | % Skips like this and \vskip below end a paragraph. 126 | {\narrower 127 | ~% ``We've indented this paragraph on both sides by the paragraph 128 | ~% indentation. This is often a good way to set long quotations.'' 129 | ``我们对这一段作了双边缩进的处理。在长段引用时,通常都会这么做。'' 130 | 131 | ~%``You can do multiple paragraphs this way if you choose. This 132 | ~%is the second paragraph that's singly indented.''\par} 133 | ``如果你愿意的话,可以同时对多个段落作如此处理。 134 | 这是第二个轻微缩进的段落。''\par} 135 | 136 | ~%{\narrower \narrower You can even make paragraphs doubly narrow 137 | ~%if that's what you need. This is an example of a doubly 138 | ~%narrowed paragraph.\par} 139 | {\narrower \narrower 如果需要,你也可以让段落缩进双倍长度。 140 | 这就是一个双倍缩进段落的例子。\par} 141 | \vskip 1pc % Skip down one pica for visual separation. 142 | ~%In this paragraph we're back to the normal margins, as you can 143 | ~%see for yourself. We'll let it run on a little longer so that 144 | ~%the margins are clearly visible. 145 | 在这一段,如你所见,我们返回到正常的边距状态。我们尽量让这一段 146 | 稍微长一点,这样你可以更清楚地看到边距的效果。 147 | 148 | ~%{\leftskip .5in Now we'll indent the left margin by half 149 | ~%an inch and leave the right margin at its usual position.\par} 150 | {\leftskip .5in 现在这一段,我们将其调整为左边距为半英尺,而 151 | 右边距保持原样。\par} 152 | 153 | ~%{\rightskip .5in Finally, we'll indent the right margin by half 154 | ~%an inch and leave the left margin at its usual position.\par} 155 | {\rightskip .5in 最后,我们将本段调整为右边距半英尺,而左边距保持 156 | 原样。\par} 157 | ~%\bye % end the document 158 | \bye % 结束此文档 159 | ::: 160 | ~%\xmpheader !xmpnum/{Fonts and special characters}% !xmpheaddef 161 | \xmpheader !xmpnum/{字体和特殊字符}% !xmpheaddef 162 | \chardef \\ = `\\ % Let \\ denote a backslash. 163 | ~^^{字体} ^^{字符//特殊字符} ^^{重音} 164 | ~^^{音符} ^^{花色} 165 | ~\chidxref{\$} \chidxref{\&} \chidxref{\#} \chidxref{\_} \chidxref{\%} 166 | ~\chidxref{\^} \chidxref{\~} \chidxref{\{} \chidxref{\}} 167 | ~%{\it Here are a few words in an italic font}, {\bf a 168 | ~%few words in a boldface font}, {\it and a\/ {\bf mixture} 169 | ~%of the two, with two\/ {\rm roman words} inserted}. 170 | ~%Where an italic font is followed by a nonitalic font, we've 171 | ~%inserted an ``italic correction'' ({\tt \\/}) to make the 172 | ~%spacing look right. 173 | 这是意大利体单词{\it italic words},粗体单词{\bf bold words}, 174 | 而这里是意大利体、粗体和罗马体这几种字体混用的效果: 175 | {\it put {\bf bold} and {\rm roman} inside italic}。 176 | 当倾斜字体后面紧跟非倾斜字体时,我们在其间插入一个``倾斜校正'' 177 | ({\tt \\/}),使得中间的空白看起来较舒适。 178 | ~%Here's a {\sevenrm smaller} word---but the standard \TeX\ 179 | ~%fonts won't give you anything smaller than {\fiverm this}. 180 | 这是一些{\sevenrm 更小的}字词---可是标准的 \TeX\ 181 | 字体并不会给出小于 {\fiverm 如此大小}的字体。 182 | 183 | ~%If you need any of the ten characters: 184 | 如果你需要以下十个字符任意之一: 185 | \medskip 186 | \centerline{\$ \quad \& \quad \# \quad \_ \quad \% \quad 187 | \char `\^ \quad \char `\~ \quad $\{$ \quad 188 | $\}$ \quad $\backslash$} 189 | % The \quad inserts an em space between characters. 190 | \medskip 191 | ~%\noindent you'll need to write them a special way. Look at 192 | ~%the facing page to see how to do it. 193 | \noindent 你需要通过特殊的方式来写他们。参照对开页, 194 | 学习正确的记录这些特殊字符的方法。 195 | 196 | ~%\TeX\ has the accents and letters that you'll need 197 | ~%for French words such as {\it r\^ ole\/} and {\it \' 198 | ~%el\` eve\/}, for German words such as {\it Schu\ss\/}, 199 | ~%and for words in several other languages as well. 200 | ~%You'll find a complete list of \TeX's accents and letters 201 | ~%of European languages on !xrefdelim[accents] and !xrefdelim[fornlets]. 202 | \TeX\ 拥有一些语音和字母,可以用于某些法语词, 203 | 例如:{\it r\^ ole\/} 以及\ {\it \'el\` eve\/}, 204 | 或者德语词,例如 {\it Schu\ss\/},或者某些别的什么语言。 205 | 你可以在 !xrefdelim[accents] 和 !xrefdelim[fornlets] 206 | 找到 \TeX\ 的 欧洲语音和字母表。 207 | 208 | ~%You can also get Greek letters such as ``$\alpha$'' and 209 | ~%``$\Omega$'' for use in math, card suits such as 210 | ~%``$\spadesuit$'' and ``$\diamondsuit$'', music symbols 211 | ~%such as ``$\sharp$'' and ``$\flat$'', and many other special 212 | ~%symbols that you'll find listed on !xrefdelim[specsyms]. 213 | ~%\TeX\ will only accept these sorts of special symbols in its 214 | ~%``math mode'', so you'll need to enclose them 215 | ~%within `{\tt \$}' characters. 216 | 你也可以写一些希腊字母,例如数学中的 ``$\alpha$'' 以及 217 | ``$\Omega$'' , 扑克牌中的 218 | ``$\spadesuit$'' 以及 ``$\diamondsuit$'', 一些音乐符号,例如: 219 | ``$\sharp$'' 和 ``$\flat$'', 以及一些你可以在 !xrefdelim[specsyms] 220 | 找到的各种符号。\TeX\ 仅在 ``数学模式'' 下接受这些符号,因此, 221 | 你需要将它们放在两个 `{\tt \$}' 字符中间。 222 | ~%\bye % end the document 223 | \bye % 结束此文档 224 | ::: 225 | ~%\xmpheader !xmpnum/{Interline spacing}% !xmpheaddef 226 | \xmpheader !xmpnum/{行间距}% !xmpheaddef 227 | ~^^{间隔//行间距} ^^{基线} 228 | \baselineskip = 2\baselineskip % double spacing 229 | \parskip = \baselineskip % Skip a line between paragraphs. 230 | \parindent = 3em % Increase indentation of paragraphs. 231 | 232 | % The following macro definition gives us nice inline 233 | % fractions. You'll find it in our eplain macros. 234 | \def\frac#1/#2{\leavevmode 235 | \kern.1em \raise .5ex \hbox{\the\scriptfont0 #1}% 236 | \kern-.1em $/$% 237 | \kern-.15em \lower .25ex \hbox{\the\scriptfont0 #2}% 238 | }% 239 | 240 | ~%Once in a while you may want to print a document with extra 241 | ~%space between the lines. For instance, bills before Congress 242 | ~%are printed this way so that the legislators can mark them up. 243 | ~%For the same reason, book publishers usually insist that 244 | ~%manuscripts be double-spaced. Double spacing is rarely 245 | ~%appropriate for finished documents, however. 246 | 有的时候,你会想在文档的文字行之间增加一些空白。例如:议会的 247 | 某些讨论稿需要这样做,使得议员们能够在其上作一些标记。书商们 248 | 也基于同样的理由,要求作者提交的手稿具有双倍的行间距。当然, 249 | 对最终的出版物来说,双倍行间距的情形极其少见。 250 | 251 | ~%A baseline is an imaginary line that acts like the lines 252 | ~%on a pad of ruled paper. You can control the interline 253 | ~%spacing---what printers call ``leading''---% 254 | ~%by setting the amount of space between baselines. Take a 255 | ~%look at the input to see how to do it. You could use 256 | ~%the same method for $1\;1/2$ spacing as well, using {\tt 1.5} 257 | ~%instead of {\tt 2}. (You can also write $1\frac 1/2$ 258 | ~%a nicer way.) 259 | 基线是一条想象出来的线,其作用类似于带横格标记的纸张上 260 | 横格线的作用。你可以通过控制基线间的距离来控制两行文字 261 | 之间的距离 --- 打印机管这个距离叫做 ``起始空白''。具体 262 | 的做法可以参看这段的源文件。你可以用{\tt 1.5}取代{\tt 2} 263 | 获得 $1\;1/2$空白的效果。(或者可以写成更好看的 $1\frac 1/2$ 264 | 形式。) 265 | 266 | % Here we've used the macro definition given above. 267 | 268 | ~%For this example we've also increased the paragraph indentation 269 | ~%and skipped an extra line between paragraphs. 270 | 做为举例,我们这里增加了段落的缩进,并且在两段之间增加了一个空行。 271 | 272 | ~%\bye % end the document 273 | \bye % 结束此文档 274 | ::: 275 | ~%\xmpheader !xmpnum/{Spacing, rules, and boxes}% !xmpheaddef 276 | \xmpheader !xmpnum/{间隔、标线和盒子}% !xmpheaddef 277 | ~^^{描述列表} ^^{盒子//绘制盒子} ^^{修订线} 278 | ~%Here's an example of a ``description list''. In practice you'd 279 | ~%be better off using a macro to avoid the repetitive constructs 280 | ~%and to make sure that the subhead widths are wide enough: 281 | 这里展示的是 ``描述列表''的实例。实际使用时,最好将这些重复结构 282 | 定义成宏,并且保证子标题的宽度足够宽。 283 | 284 | \bigskip 285 | ~% Call the indentation for descriptions \descindent 286 | ~% and set it to 8 picas. 287 | % 用 \descindent 表示描述列表的缩进量,并设定它的值为 8 派卡。 288 | \newdimen\descindent \descindent = 8pc 289 | ~% Indent paragraphs by \descindent. 290 | ~% Skip an additional half line between paragraphs. 291 | % 整个段落缩进 \descindent。段落间增加半个行距的间距。 292 | {\noindent \leftskip = \descindent \parskip = .5\baselineskip 293 | ~% Move the description to the left of the paragraph. 294 | % 将描述放在段落的左边。 295 | \llap{\hbox to \descindent{\bf Queen of Hearts\hfil}}% 296 | An ill-tempered woman, prone to saying ``Off with his 297 | head!!''\ at the slightest provocation.\par 298 | \noindent\llap{\hbox to \descindent{\bf Cheshire Cat\hfil}}% 299 | A cat with an enormous smile that Alice found 300 | in a tree.\par 301 | \noindent\llap{\hbox to \descindent{\bf Mock Turtle\hfil}}% 302 | A lachrymose creature, quite a storyteller, who was a 303 | companion to the Gryphon. Reputedly the prin\-cipal ingredient 304 | of Mock Turtle Soup. 305 | \par} 306 | \bigskip\hrule\bigskip % A line with vertical space around it. 307 | ~%Here's an example of some words in a ruled box, just as 308 | ~%Lewis Carroll wrote them: 309 | 这个例子在一个标线盒子中放入一些词句,它们是路易斯·卡罗所写的: 310 | \bigskip 311 | ~% Put 8pt of space between the text and the surrounding rules. 312 | % 在文本和四周标线之间留有 8pt 宽的间隔。 313 | \hbox{\vrule\vbox{\hrule 314 | \hbox spread 8pt{\hfil\vbox spread 8pt{\vfil 315 | ~% \hbox{Who would not give all else for twop}% 316 | ~% \hbox{ennyworth only of Beautiful Soup?}% 317 | \hbox{谁不是最想尝一尝,}% 318 | \hbox{两便士一碗的好汤?}% 319 | \vfil}\hfil} 320 | \hrule}\vrule}% 321 | 322 | \bigskip\line{\hfil\hbox to 3in{\leaders\hbox{ * }\hfil}\hfil} 323 | \bigskip 324 | 325 | \line{\hskip -4pt\vrule\hfil\vbox{ 326 | ~%Here we've gotten the effect of a revision bar on the material 327 | ~%in this paragraph. The revision bar might indicate a change.}} 328 | 我们给此段落内容添加了修订线效果。修订线用于表示内容改动。}} 329 | ~%\bye % end the document 330 | \bye % 结束此文档 331 | ::: 332 | ~%\xmpheader !xmpnum/{Odds and ends}% !xmpheaddef 333 | \xmpheader !xmpnum/{杂项}% !xmpheaddef 334 | ~^^{连字} ^^{定理} ^^{引理} ^^{有序列表} 335 | ~^^{居左对齐} ^^{居右对齐} ^^{居中对齐} 336 | ~%\chardef \\ = `\\ % Let \\ denote a backslash. 337 | \chardef \\ = `\\ % 用 \\ 表示反斜杠。 338 | \footline{\hfil{\tenit - \folio -}\hfil} 339 | ~\global\footline{\hfil{\tenit - \folio\ -}\hfil} 340 | ~% \footline provides a footer line. 341 | ~% Here it's a centered, italicized page number. 342 | % \footline 给出页脚行;此处为居中的意大利体页码。 343 | ~%\TeX\ knows how to hyphenate words, but it isn't infallible. 344 | ~%If you are discussing the chemical 345 | ~%${\it 5}$-[p-(Flouro\-sul\-fonyl)ben\-zoyl]-l,% 346 | ~%$N^6$-ethe\-no\-adeno\-sine 347 | ~%and \TeX\ complains to you about an ``overfull hbox'', try 348 | ~%inserting some ``discretionary hyphens''. The notation 349 | ~%`{\tt \\-}' tells \TeX\ about a dis\-cre\-tion\-ary hyphen, 350 | ~%that is, one that it might not have inserted otherwise. 351 | \TeX\ 懂得如何将单词连字化,但它并非绝对可靠的。若你在讨论化学 352 | ${\it 5}$-[p-(Flouro\-sul\-fonyl)ben\-zoyl]-l,% 353 | $N^6$-ethe\-no\-adeno\-sine 时, 354 | \TeX\ 给出关于``水平盒子溢出''的警告, 355 | 你可以尝试插入某些``自定连字符''。 356 | `{\tt \\-}'记号告诉 \TeX\ 一个自定连字符位置; 357 | 在此位置 \TeX\ 本来是不会插入连字符的。 358 | \medskip 359 | ~%{\raggedright You can typeset text unjustified, i.e., with 360 | ~%an uneven right margin. In the old days, before word 361 | ~%processors were common, typewritten documents were 362 | ~%unjustified because there was no convenient alternative. 363 | ~%Some people prefer text to be unjustified so that the 364 | ~%spacing between words can be uniform. Most books are set 365 | ~%with justified margins, but not all. \par} 366 | {\raggedright 你可以不对齐地排版文字,即让右页边不对齐。 367 | 在过去,文字处理软件还未普及, 368 | 因为没有其他方便的选择,排版的文档都是不对齐的。 369 | 有些人更喜欢不对齐地排版文字,因为此时单词间距是一致的。 370 | 大部分书籍都设置为页边对齐,但并非都是。\par} 371 | 372 | ~%\proclaim Assertion 27. There is an easy way to typeset 373 | ~%the headings of assertions, lemmas, theorems, etc. 374 | \proclaim 断言 27. 有很简单的方法排版断言、引理、定理等的标题。 375 | 376 | ~%Here's an example of how to typeset an itemized list two 377 | ~%levels deep. If you need more levels, you'll have to 378 | ~%program it yourself, alas. 379 | ~%\smallskip 380 | ~%\item {1.} This is the first item. 381 | ~%\item {2.} This is the second item. It consists of two 382 | ~%paragraphs. We've indented the second paragraph so that 383 | ~%you can easily see where it starts. 384 | 这个例子显示如何排版两层的有序列表。 385 | 如果需要更多层级,唉,你得自己编程。 386 | \smallskip 387 | \item {1.} 这是第一个列表项。 388 | \item {2.} 这是第二个列表项。它由两个段落组成。 389 | 为让你看清楚第二个段落从哪里开始,我们缩进了该段落。 390 | 391 | ~%\item{} \indent The second paragraph has three subitems 392 | ~%underneath it. 393 | ~%\itemitem {(a)} This is the first subitem. 394 | ~%\itemitem {(b)} This is the second subitem. 395 | ~%\itemitem {(c)} This is the third subitem. 396 | ~%\item {$\bullet$} This is a strange-looking item because it's 397 | ~%completely different from the others. 398 | \item{} \indent 第二个段落下边有三个子列表项。 399 | \itemitem {(a)} 这是第一个子列表项。 400 | \itemitem {(b)} 这是第二个子列表项。 401 | \itemitem {(c)} 这是第三个子列表项。 402 | \item {$\bullet$} 这是一个看起来很奇怪的列表项, 403 | 因为它和其他列表项不同。 404 | \smallskip 405 | ~%\leftline{Here's a left-justified line.$\Leftarrow$} 406 | ~%\rightline{$\Rightarrow$Here's a right-justified line.} 407 | ~%\centerline{$\Rightarrow$Here's a centered line.$\Leftarrow$} 408 | \leftline{这是一个左对齐的行。$\Leftarrow$} 409 | \rightline{$\Rightarrow$这是一个右对齐的行。} 410 | \centerline{$\Rightarrow$这是一个居中的行。$\Leftarrow$} 411 | ~% Don't try to use these commands within a paragraph. 412 | % 不要在段落内部使用这些命令。 413 | ~%\bye % end the document 414 | \bye % 结束此文档 415 | ::: 416 | ~%\xmpheader !xmpnum/{Using fonts from other sources}% !xmpheaddef 417 | \xmpheader !xmpnum/{使用其他来源的字体}% !xmpheaddef 418 | ~\xrdef{palatino} 419 | ~\idxref{Palatino 字体} 420 | ~\idxref{Zapf, Hermann} 421 | ~\idxref{计算机现代字体} \mcidxref{Metafont} 422 | \font\tenrm = pplr % Palatino 423 | % Define a macro for invoking Palatino. 424 | \def\pal{\let\rm = \tenrm \baselineskip=12.5pt \rm} 425 | \pal % Use Palatino from now on. 426 | 427 | ~%You aren't restricted to using the Computer Modern fonts that 428 | ~%come with \TeX. Other fonts are available from many sources, 429 | ~%and you may prefer them. For instance, we've set this page 430 | ~%in 10-point Palatino Roman. Palatino was designed by 431 | ~%Hermann Zapf, considered to be one of the greatest type 432 | ~%designers of the twentieth century. This page will 433 | ~%give you some idea of what it looks like. 434 | 你并不局限于只能使用随 \TeX 发行的 Computer Modern 系列字体。 435 | 从其他很多渠道你都可以得到一些你可能会更喜欢的字体。例如我们 436 | 当前页面就被设置为 10p 大小的 Palatino Roman 字体。Palatino 437 | 是一种由 Hermann Zapf 所设计的字体,它被认为是二十世纪最伟大的 438 | 字体设计之一。从本页的输出可以获得关于这个字体的一些直观印 439 | 象(由于译本的缘故,本页的字体并未被设为 Palatino 字体)。 440 | 441 | ~%Fonts can be provided either as outlines or as bitmaps. An 442 | ~%outline font describes the shapes of the characters, while a 443 | ~%bitmap font specifies each pixel (dot) that makes up each 444 | ~%character. A font outline can be used to generate many 445 | ~%different sizes of the same font. The Metafont program 446 | ~%that's associated with \TeX\ provides a particularly 447 | ~%powerful way of generating bitmap fonts, but it's not the 448 | ~%only way. 449 | 字体既可以是轮廓字体,也可以是位图字体。轮廓字体的意思是它 450 | 描述的是各个字符的形状,而位图字体则是标识了每个字符形状所 451 | 占据的像素点。轮廓字体可用来产生同一种字体的多种不同大小。 452 | 随 \TeX\ 而发行的 metafont 程序是一个产生位图字体的强大工具, 453 | 而且它并不是唯一的工具。 454 | 455 | ~%The fact that a single outline can generate a great range of 456 | ~%point sizes for a font tempts many vendors of digital 457 | ~%typefaces to provide just one set of outlines for a typeface 458 | ~%such as Palatino Roman. This may be a sensible economic 459 | ~%decision, but it is an aesthetic sacrifice. Fonts cannot be 460 | ~%scaled up and down linearly without loss of quality. 461 | ~%Larger sizes of letters should not, in general, have the 462 | ~%same proportions as smaller sizes; they just don't look 463 | ~%right. For example, a font that's linearly scaled down will 464 | ~%tend to have too little space between strokes, and its 465 | ~%x-height will be too~small. % tie added to avoid widow word 466 | 由于单一的轮廓字体文件既可生成多种不同大小的字体,因此很多 467 | 数字字体提供商倾向于仅提供字体的单一文件 ——例如 Palatino 468 | Roman 即是如此。这也许是个经济的决定,可它却同时是个美学上 469 | 的重大牺牲。字体无法做到在不损害其显示质量的前提下,线性地 470 | 放大或者缩小。一个字符的大字体版本,通常来说,与小字体的版 471 | 本应该有不同的比例 —— 而如果我们坚持这么做的话,其结果看 472 | 起来将不会那么好看。例如:如果将一个字体线性缩小的话,其各 473 | 笔画间的间距将会显得过窄,而它的 x-height 值也会显得过小。 474 | 475 | ~%A type designer can compensate for these changes by 476 | ~%providing different outlines for different point sizes, but 477 | ~%it's necessary to go to the expense of designing these 478 | ~%different outlines. One of the great advantages of Metafont 479 | ~%is that it's possible to parameterize the descriptions of 480 | ~%characters in a font. Metafont can then maintain the 481 | ~%typographical quality of characters over a range of point 482 | ~%sizes by adjusting the character shapes accordingly. 483 | 字体的设计者可以为不同大小的字体设计不同的轮廓形状,从而 484 | 对这个问题进行弥补,可这同时需要付出额外的代价。使用 Metafont 485 | 程序的一个巨大的好处就是可以将字符符号形状的描述参数化。 486 | 这样在改变字体大小的时候,Metafont 可以视情况做一些自动处理, 487 | 从而得到较好的效果。 488 | ~%\bye % end the document 489 | \bye % 结束此文档 490 | ::: 491 | ~\idxref{蘑菇} 492 | ~%\xmpheader !xmpnum/{A ruled table}% !xmpheaddef 493 | \xmpheader !xmpnum/{标线表格}% !xmpheaddef 494 | \bigskip 495 | ~%\offinterlineskip % So the vertical rules are connected. 496 | \offinterlineskip % 让竖直标线连接起来 497 | ~% \tablerule constructs a thin rule across the table. 498 | % \tablerule 构造横穿表格的细标线 499 | \def\tablerule{\noalign{\hrule}} 500 | ~% \tableskip creates 9pt of space between entries. 501 | % \tableskip 在单元格之间生成 9pt 的空隙 502 | \def\tableskip{\omit&height 9pt&&&\omit\cr} 503 | ~% & separates templates for each column. TeX substitutes 504 | ~% the text of the entries for #. We must have a strut 505 | ~% present in every row of the table; otherwise, the boxes 506 | ~% won't butt together properly, and the rules won't join. 507 | % 用 & 分开模版各列。TeX 将把 # 替换为单元格的文本。 508 | % 在表格每行都要有一个支架(strut); 509 | % 否则盒子将不能良好接合,标线也不能连接起来。 510 | ~%\halign{\tabskip = .7em plus 1em % glue between columns 511 | ~% Use \vtop for short multiline entries in the first column. 512 | ~% Typeset the lines ragged right, without hyphenation. 513 | ~% \vtop{\hsize=6pc\pretolerance = 10000\hbadness = 10000 514 | ~% \normalbaselines\noindent\it#\strut}% 515 | ~% &\vrule #&#\hfil &\vrule #% the rules and middle column 516 | \halign{\tabskip = .7em plus 1em % 各列之间的粘连 517 | % 用 \vtop 得到表格第一列中的多行单元格。 518 | % 让多行文本右边不对齐,且不连字化。 519 | \vtop{\hsize=6pc\pretolerance = 10000\hbadness = 10000 520 | \normalbaselines\noindent\it#\strut}% 521 | &\vrule #&#\hfil &\vrule #% 标线和中间各列 522 | ~%% Use \vtop to get whole paragraphs in the last column. 523 | ~% &\vtop{\hsize=11pc \parindent=0pt \normalbaselineskip=12pt 524 | ~% \normalbaselines \rightskip=3pt plus2em #}\cr 525 | % 用 \vtop 得到表格最后一列中的段落。 526 | &\vtop{\hsize=11pc \parindent=0pt \normalbaselineskip=12pt 527 | \normalbaselines \rightskip=3pt plus2em #}\cr 528 | ~% The table rows begin here. 529 | % 表格各行从这里开始。 530 | ~%\noalign{\hrule height2pt depth2pt \vskip3pt} 531 | ~% % The header row spans all the columns. 532 | ~% \multispan5\bf Some Choice Edible Mushrooms\hfil\strut\cr 533 | \noalign{\hrule height2pt depth2pt \vskip3pt} 534 | % 表头行横跨各列。 535 | \multispan5\bf 一些上等的食用蘑菇\hfil\strut\cr 536 | ~%\noalign{\vskip3pt} \tablerule 537 | ~% \omit&height 3pt&\omit&&\omit\cr 538 | ~% \bf Botanical&&\bf Common&&\omit \bf Identifying \hfil\cr 539 | ~%\noalign{\vskip -2pt}% close up lines of heading 540 | ~% \bf Name&&\bf Name &&\omit \bf Characteristics \hfil\cr 541 | \noalign{\vskip3pt} \tablerule 542 | \omit&height 3pt&\omit&&\omit\cr 543 | \bf 学名&&\bf 常用名&&\omit \bf 识别特征 \hfil\cr 544 | ~%\tableskip Pleurotus ostreatus&&Oyster mushroom&& 545 | ~% Grows in shelf\kern 1pt like clusters on stumps or logs, 546 | ~% % without the kern, the `f' and `l' would be too close 547 | ~% pink-gray oyster-shaped caps, stem short or absent.\cr 548 | \tableskip Pleurotus ostreatus&&平菇&& 549 | Grows in shelf\kern 1pt like clusters on stumps or logs, 550 | % 若不加上 \kern ,`f' 和 `l' 将挨得太近 551 | pink-gray oyster-shaped caps, stem short or absent.\cr 552 | ~%\tableskip Lactarius hygrophoroides&&Milky hygroph&& 553 | ~% Butterscotch-brown cap and stem, copious white latex, 554 | ~% often on ground in woods near streams.\cr 555 | \tableskip Lactarius hygrophoroides&&稀褶乳菇&& 556 | Butterscotch-brown cap and stem, copious white latex, 557 | often on ground in woods near streams.\cr 558 | ~%\tableskip Morchella esculenta&&White morel&&Conical cap 559 | ~% with black pits and white ridges; no gills. Often found 560 | ~% near old apple trees and dying elms in the spring.\cr 561 | \tableskip Morchella esculenta&&羊肚菌&&Conical cap 562 | with black pits and white ridges; no gills. Often found 563 | near old apple trees and dying elms in the spring.\cr 564 | ~%\tableskip Boletus edulus&&King bolete&&Reddish-brown to 565 | ~% tan cap with yellow pores (white when young), 566 | ~% bulbous stem, often near conifers, birch, or~aspen.\cr 567 | \tableskip Boletus edulus&&美味牛肝菌&&Reddish-brown to 568 | tan cap with yellow pores (white when young), 569 | bulbous stem, often near conifers, birch, or~aspen.\cr 570 | \tableskip \tablerule \noalign{\vskip 2pt} \tablerule 571 | }\bye 572 | ::: 573 | ~%\xmpheader !xmpnum/{Typesetting mathematics}% !xmpheaddef 574 | \xmpheader !xmpnum/{排版数学公式}% !xmpheaddef 575 | ~^^{数学} 576 | ~%For a spherical triangle with sides $a$, $b$, and $c$, and 577 | ~%opposite angles $\alpha$, $\beta$, and $\gamma$, we have: 578 | 设球面三角形的三条边长度分别为$a$,$b$ 和 $c$, 579 | 它们的对角分别为 $\alpha$,$\beta$ 和 $\gamma$,我们有: 580 | ~%$$\cos \alpha = -\cos \beta \cos \gamma + 581 | ~% \sin \beta \sin \gamma \cos \alpha \quad 582 | ~% \hbox{(Law of Cosines)}$$ 583 | $$\cos \alpha = -\cos \beta \cos \gamma + 584 | \sin \beta \sin \gamma \cos \alpha \quad 585 | \hbox{(余弦定理)}$$ 586 | ~%and: 587 | 且有: 588 | ~%$$\tan {\alpha \over 2} = \sqrt{ 589 | ~% {- \cos \sigma \cdot \cos(\sigma - \alpha)} \over 590 | ~% {\cos (\sigma - \beta) \cdot \cos (\sigma - \gamma)}},\quad 591 | ~% \hbox{where $\sigma = {1 \over 2}(a+b+c)$}$$ 592 | $$\tan {\alpha \over 2} = \sqrt{ 593 | {- \cos \sigma \cdot \cos(\sigma - \alpha)} \over 594 | {\cos(\sigma - \beta) \cdot \cos(\sigma - \gamma)}},\quad 595 | \hbox{其中 $\sigma = {1 \over 2}(a+b+c)$}$$ 596 | ~%We also have:$$\sin x = {{e^{ix}-e^{-ix}}\over 2i}$$ 597 | ~%and: 598 | ~%$$\int _0 ^\infty {{\sin ax \sin bx}\over{x^2}}\,dx 599 | ~%% The \, above produces a thin space 600 | ~% = {\pi a\over 2}, \quad \hbox{if $a < b$}$$ 601 | 我们还有:$$\sin x = {{e^{ix}-e^{-ix}}\over 2i}$$ 602 | 且有: 603 | $$\int _0 ^\infty {{\sin ax \sin bx}\over{x^2}}\,dx 604 | % 上面的 \, 生成一个小间隔 605 | = {\pi a\over 2}, \quad \hbox{如果 $a < b$}$$ 606 | 607 | ~%\noindent The number of combinations ${}_nC_r$ of $n$ 608 | ~%things taken $r$ at a time is: 609 | \noindent 从 $n$ 个物品中任取 $r$ 个的组合数 ${}_nC_r$ 为: 610 | $$C(n,r) = {}_nC_r = {n \choose r} = 611 | {{n(n-1) \cdots (n-r+1)} \over {r(r-1) \cdots (1)}} = 612 | {{n!!}\over {r!!(n-r)!!}}$$ 613 | 614 | \noindent 615 | ~%The value of the determinant $D$ of order $n$: 616 | $n$ 阶行列式 $D$ 的值: 617 | $$D = \left|\matrix{a_{11}&a_{12}&\ldots&a_{1n}\cr 618 | a_{21}&a_{22}&\ldots&a_{2n}\cr 619 | \vdots&\vdots&\ddots&\vdots\cr 620 | a_{n1}&a_{n2}&\ldots&a_{nn}\cr}\right| $$ 621 | ~%is defined as the sum of $n!!$ terms: 622 | 定义为下面$n!!$项的和: 623 | $$\sum\>(\pm)\>a_{1i}a_{2j} \ldots a_{nk}$$ 624 | ~% The \> above produces a medium space. 625 | ~%where $i$, $j$, \dots,~$k$\/ take on all possible values 626 | ~%between $1$ and $n$, and the sign of the product is 627 | ~%$+$ if the sequence $i$, $j$, \dots,~$k$\/ is an 628 | ~%even permutation and $-$ otherwise. Moreover: 629 | 其中 $i$, $j$, \dots,~$k$\/ 取遍 $1$ 到 $n$ 的所有可能值, 630 | 且当排列 $i$, $j$, \dots,~$k$\/ 为偶置换时乘积取 $+$ 号, 631 | 否则取 $-$ 号。此外: 632 | $$Q(\xi) = \lambda_1 y_1^2 \sum_{i=2}^n \sum_{j=2}^n y_i 633 | b_{ij} y_j,\qquad B = \Vert b_{ij} \Vert = B'$$ 634 | \bye 635 | ::: 636 | ~%\xmpheader !xmpnum/{More mathematics}% !xmpheaddef 637 | \xmpheader !xmpnum/{更多数学内容}% !xmpheaddef 638 | %^^{math} 639 | ^^{数学} 640 | ~%The absolute value of $X$, $|x|$, is defined by: 641 | ~%$$|x| = \cases{x, &if $x\ge 0$;\cr 642 | ~%-x,&otherwise.\cr}$$ 643 | ~%Now for some numbered equations. 644 | ~%It is the case that for $k \ge 0$: 645 | ~%$$x^{k^2}=\overbrace{x\>x\>\cdots\> x}^{2k\ \rm times} 646 | ~%\eqno (1)$$ 647 | $X$ 的绝对值 $|x|$ 定义为: 648 | $$|x| = \cases{x, &if $x\ge 0$;\cr 649 | -x,&otherwise.\cr}$$ 650 | 现在写一些标号了的公式。 651 | 在 $k \ge 0$ 时,我们有: 652 | $$x^{k^2}=\overbrace{x\>x\>\cdots\> x}^{2k\ \rm times} 653 | \eqno (1)$$ 654 | 655 | ~%Here's an example that shows some spacing controls, with 656 | ~%a number on the left: 657 | 这是一个展示空格间距调整和公式左编号的例子: 658 | ~%$$[u]!negthin[v][w]\,[x]\>[y]\;[z]\leqno(2a)$$ 659 | $$[u]!negthin[v][w]\,[x]\>[y]\;[z]\leqno(2a)$$ 660 | ~%The amount of space between the items in brackets 661 | ~%gradually increases from left to right. (We've made 662 | ~%the space between the first two items be {\it less\/} 663 | ~%than the natural space.) 664 | 从做到右公式中的项和括号的距离逐步增大。 665 | (我们把前两项的距离设定得比正常距离 {\it 少\/}。 666 | ~%It is sometimes the case that $$\leqalignno{ 667 | ~%u'_1 + tu''_2 &= u'_2 + tu''_1&(2b)\cr 668 | ~%\hat\imath &\ne \hat \jmath&(2c)\cr 669 | ~%\vec {\vphantom{b}a}&\approx \vec b\cr}$$ 670 | ~%% The \vphantom is an invisible rule as tall as a `b'. 671 | 有时候, $$\leqalignno{ 672 | u'_1 + tu''_2 &= u'_2 + tu''_1&(2b)\cr 673 | \hat\imath &\ne \hat \jmath&(2c)\cr 674 | \vec {\vphantom{b}a}&\approx \vec b\cr}$$ 675 | % \vphantom 是一个不可见的和“b”一样高的盒子。 676 | ~%The result is of order $O(n \log\log n)$. Thus 677 | ~%$$\sum_{i=1}^n x_i = x_1+x_2+\cdots+x_n 678 | ~%= {\rm Sum}(x_1,x_2,\ldots,x_n). \eqno(3)$$ 679 | 结果为 $O(n \log\log n)$. 因此 680 | $$\sum_{i=1}^n x_i = x_1+x_2+\cdots+x_n 681 | = {\rm Sum}(x_1,x_2,\ldots,x_n). \eqno(3)$$ 682 | ~%and 683 | ~%$$dx\,dy = r\,dr\,d\theta!negthin.\eqno(4)$$ 684 | ~%The set of all $q$ such that $q\le0$ is written as: 685 | ~%$$\{\,q\mid q\le0\, \}$$ 686 | 且 687 | $$dx\,dy = r\,dr\,d\theta!negthin.\eqno(4)$$ 688 | 满足 $q\le0$ 的所有的 $q$ 可以被写作: 689 | $$\{\,q\mid q\le0\, \}$$ 690 | ~%Thus 691 | ~%$$\forall x\exists y\;P(x,y)\Rightarrow 692 | ~%\exists x\exists y\;P(x,y)$$ 693 | ~%where 694 | ~%$$P(x,y) \buildrel \rm def \over \equiv 695 | ~%\hbox{\rm any predicate in $x$ and $y$} . $$ 696 | 因此 697 | $$\forall x\exists y\;P(x,y)\Rightarrow 698 | \exists x\exists y\;P(x,y)$$ 699 | 其中 700 | $$P(x,y) \buildrel \rm def \over \equiv 701 | \hbox{\rm 任何一个能够得出 $x$ 和 $y$} . $$ 702 | \bye 703 | ::: 704 | --------------------------------------------------------------------------------