📄 texinfo.texi
字号:
* Sample Include File:: A sample outer file with included files within it; and a sample included file.* Include Files Evolution:: How use of the @code{@@include} command has changed over time.Page Headings* Headings Introduced:: Conventions for using page headings.* Heading Format:: Standard page heading formats.* Heading Choice:: How to specify the type of page heading.* Custom Headings:: How to create your own headings and footings.Formatting Mistakes* makeinfo Preferred:: @code{makeinfo} finds errors.* Debugging with Info:: How to catch errors with Info formatting.* Debugging with TeX:: How to catch errors with @TeX{} formatting.* Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.* Using occur:: How to list all lines containing a pattern.* Running Info-Validate:: How to find badly referenced nodes.Finding Badly Referenced Nodes* Using Info-validate:: How to run @code{Info-validate}.* Unsplit:: How to create an unsplit file.* Tagifying:: How to tagify a file.* Splitting:: How to split a file manually.How to Obtain @TeX{}* New Texinfo Mode Commands:: The updating commands are especially useful.* New Commands:: Many newly described @@-commands.@end detailmenu@end menu@node Copying, Overview, Top, Top@comment node-name, next, previous, up@unnumbered Texinfo Copying Conditions@cindex Copying conditions@cindex Conditions for copying TexinfoThe programs currently being distributed that relate to Texinfo includeportions of GNU Emacs, plus other separate programs (including@code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}).These programs are @dfn{free}; this means that everyone is free to usethem and free to redistribute them on a free basis. The Texinfo-relatedprograms are not in the public domain; they are copyrighted and thereare restrictions on their distribution, but these restrictions aredesigned to permit everything that a good cooperating citizen would wantto do. What is not allowed is to try to prevent others from furthersharing any version of these programs that they might get fromyou.@refill Specifically, we want to make sure that you have the right to giveaway copies of the programs that relate to Texinfo, that you receivesource code or else can get it if you want it, that you can change theseprograms or use pieces of them in new free programs, and that you knowyou can do these things.@refill To make sure that everyone has such rights, we have to forbid you todeprive anyone else of these rights. For example, if you distributecopies of the Texinfo related programs, you must give the recipients allthe rights that you have. You must make sure that they, too, receive orcan get the source code. And you must tell them their rights.@refill Also, for our own protection, we must make certain that everyone findsout that there is no warranty for the programs that relate to Texinfo.If these programs are modified by someone else and passed on, we wanttheir recipients to know that what they have is not what we distributed,so that any problems introduced by others will not reflect on ourreputation.@refill The precise conditions of the licenses for the programs currentlybeing distributed that relate to Texinfo are found in the General PublicLicenses that accompany them.@refill@node Overview, Texinfo Mode, Copying, Top@comment node-name, next, previous, up@chapter Overview of Texinfo@cindex Overview of Texinfo@cindex Texinfo overview@dfn{Texinfo}@footnote{Note that the first syllable of ``Texinfo'' ispronounced like ``speck'', not ``hex''. This odd pronunciation isderived from, but is not the same as, the pronunciation of @TeX{}. Inthe word @TeX{}, the @samp{X} is actually the Greek letter ``chi''rather than the English letter ``ex''. Pronounce @TeX{} as if the@samp{X} were the last sound in the name `Bach'; but pronounce Texinfoas if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T''and write the other letters in lower case.}is a documentation system that uses a single source file to produce bothon-line information and printed output. This means that instead ofwriting two different documents, one for the on-line help or other on-lineinformation and the other for a typeset manual or other printed work, youneed write only one document. When the work is revised, you need reviseonly one document. (You can read the on-line information, known as an@dfn{Info file}, with an Info documentation-reading program.)@refill@menu* Using Texinfo:: Create a conventional printed book or an Info file.* Info Files:: What is an Info file?* Printed Books:: Characteristics of a printed book or manual.* Formatting Commands:: @@-commands are used for formatting.* Conventions:: General rules for writing a Texinfo file.* Comments:: How to write comments and mark regions that the formatting commands will ignore.* Minimum:: What a Texinfo file must have.* Six Parts:: Usually, a Texinfo file has six parts.* Short Sample:: A short sample Texinfo file.* Acknowledgements:: @end menu@node Using Texinfo, Info Files, Overview, Overview@ifinfo@heading Using Texinfo@end ifinfoUsing Texinfo, you can create a printed document with the normalfeatures of a book, including chapters, sections, cross references,and indices. From the same Texinfo source file, you can create amenu-driven, on-line Info file with nodes, menus, cross references,and indices. You can, if you wish, make the chapters and sections ofthe printed document correspond to the nodes of the on-lineinformation; and you use the same cross references and indices forboth the Info file and the printed work. @cite{The GNUEmacs Manual} is a good example of a Texinfo file, as is this manual.@refillTo make a printed document, you process a Texinfo source file with the@TeX{} typesetting program. This creates a DVI file that you cantypeset and print as a book or report. (Note that the Texinfo languageis completely different from @TeX{}'s usual language, plain @TeX{}.) Ifyou do not have @TeX{}, but do have @code{troff} or @code{nroff}, youcan use the @code{texi2roff} program instead.@refillTo make an Info file, you process a Texinfo source file with the@code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command;this creates an Info file that you can install on-line.@refill@TeX{} and @code{texi2roff} work with many types of printers; similarly,Info works with almost every type of computer terminal. This powermakes Texinfo a general purpose system, but brings with it a constraint,which is that a Texinfo file may contain only the customary``typewriter'' characters (letters, numbers, spaces, and punctuationmarks) but no special graphics.@refillA Texinfo file is a plain @sc{ascii} file containing text and@dfn{@@-commands} (words preceded by an @samp{@@}) that tell thetypesetting and formatting programs what to do. You may edit aTexinfo file with any text editor; but it is especially convenient touse GNU Emacs since that editor has a special mode, called Texinfomode, that provides various Texinfo-related features. (@xref{TexinfoMode}.)@refillBefore writing a Texinfo source file, you should become familiar withthe Info documentation reading program and learn about nodes,menus, cross references, and the rest. (@inforef{Top, info, info},for more information.)@refillYou can use Texinfo to create both on-line help and printed manuals;moreover, Texinfo is freely redistributable. For these reasons, Texinfois the format in which documentation for GNU utilities and libraries iswritten.@refill@node Info Files, Printed Books, Using Texinfo, Overview@comment node-name, next, previous, up@section Info files@cindex Info filesAn Info file is a Texinfo file formatted so that the Info documentationreading program can operate on it. (@code{makeinfo}and @code{texinfo-format-buffer} are two commands that convert a Texinfo fileinto an Info file.)@refillInfo files are divided into pieces called @dfn{nodes}, each of whichcontains the discussion of one topic. Each node has a name, andcontains both text for the user to read and pointers to other nodes,which are identified by their names. The Info program displays one nodeat a time, and provides commands with which the user can move to otherrelated nodes.@refill@ifinfo@inforef{Top, info, info}, for more information about using Info.@refill@end ifinfoEach node of an Info file may have any number of child nodes thatdescribe subtopics of the node's topic. The names of childnodes are listed in a @dfn{menu} within the parent node; thisallows you to use certain Info commands to move to one of the childnodes. Generally, an Info file is organized like a book. If a nodeis at the logical level of a chapter, its child nodes are at the levelof sections; likewise, the child nodes of sections are at the levelof subsections.@refillAll the children of any one parent are linked together in abidirectional chain of `Next' and `Previous' pointers. The `Next'pointer provides a link to the next section, and the `Previous' pointerprovides a link to the previous section. This means that all the nodesthat are at the level of sections within a chapter are linked together.Normally the order in this chain is the same as the order of thechildren in the parent's menu. Each child node records the parent nodename as its `Up' pointer. The last child has no `Next' pointer, and thefirst child has the parent both as its `Previous' and as its `Up'pointer.@footnote{In some documents, the first child has no `Previous'pointer. Occasionally, the last child has the node name of the nextfollowing higher level node as its `Next' pointer.}@refillThe book-like structuring of an Info file into nodes that correspondto chapters, sections, and the like is a matter of convention, not arequirement. The `Up', `Previous', and `Next' pointers of a node canpoint to any other nodes, and a menu can contain any other nodes.Thus, the node structure can be any directed graph. But it is usuallymore comprehensible to follow a structure that corresponds to thestructure of chapters and sections in a printed book or report.@refillIn addition to menus and to `Next', `Previous', and `Up' pointers, Infoprovides pointers of another kind, called references, that can besprinkled throughout the text. This is usually the best way torepresent links that do not fit a hierarchical structure.@refillUsually, you will design a document so that its nodes match thestructure of chapters and sections in the printed output. Butoccasionally there are times when this is not right for the materialbeing discussed. Therefore, Texinfo uses separate commands to specifythe node structure for the Info file and the section structure for theprinted output.@refillGenerally, you enter an Info file through a node that by convention isnamed `Top'. This node normally contains just a brief summary of thefile's purpose, and a large menu through which the rest of the file isreached. From this node, you can either traverse the filesystematically by going from node to node, or you can go to a specificnode listed in the main menu, or you can search the index menus and thengo directly to the node that has the information you want. Alternatively,with the standalone Info program, you can specify specific menu items onthe command line (@pxref{Top,,, info, Info}).If you want to read through an Info file in sequence, as if it were aprinted manual, you can hit @key{SPC} repeatedly, or you get the wholefile with the advanced Info command @kbd{g *}. (@inforef{Expert,Advanced Info commands, info}.)@refill@c !!! dir file may be located in one of many places:@c /usr/local/emacs/info mentioned in info.c DEFAULT_INFOPATH@c /usr/local/lib/emacs/info mentioned in info.c DEFAULT_INFOPATH@c /usr/gnu/info mentioned in info.c DEFAULT_INFOPATH@c /usr/local/info@c /usr/local/lib/infoThe @file{dir} file in the @file{info} directory serves as thedeparture point for the whole Info system. From it, you can reach the`Top' nodes of each of the documents in a complete Info system.@refill@node Printed Books, Formatting Commands, Info Files, Overview@comment node-name, next, previous, up@section Printed Books@cindex Printed book and manual characteristics@cindex Manual characteristics, printed@cindex Book characteristics, printed@cindex Texinfo printed book characteristics@cindex Characteristics, printed books or manuals@cindex Knuth, DonaldA Texinfo file can be formatted and typeset as a printed book or manual.To do this, you need @TeX{}, a powerful, sophisticated typesettingprogram written by Donald Knuth.@footnote{You can also use the@code{texi2roff} program if you do not have @TeX{}; since Texinfo isdesigned for use with @TeX{}, @code{texi2roff} is not described here.@code{texi2roff} is not part of the standard GNU distribution.}A Texinfo-based book is similar to any other typeset, printed work: itcan have a title page, copyright page, table of contents, and preface,as well as chapters, numbered or unnumbered sections and subsections,page headers, cross references, footnotes, and indices.@refillYou can use Texinfo to write a book without ever having the intentionof converting it into on-line information. You can use Texinfo forwriting a printed novel, and even to write a printed memo, althoughthis latter application is not recommended since electronic mail is somuch easier.@refill@TeX{} is a general purpose typesetting program. Texinfo provides afile called @file{texinfo.tex} that contains information (definitions or@dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.(@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commandsto @TeX{} commands, which @TeX{} can then process to create the typesetdocument.) @file{texinfo.tex} contains the specifications for printinga document.@refillMost often, documents are printed on 8.5 inch by 11 inchpages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but youcan also print for 7 inch by 9.25 inch pages (178@dmn{mm} by235@dmn{mm}; the @code{@@smallbook} size) or on European A4 size paper(@code{@@afourpaper}). (@xref{smallbook, , Printing ``Small'' Books}.Also, see @ref{A4 Paper, ,Printing on A4 Paper}.)@refillBy changing the parameters in @file{texinfo.tex}, you can change thesize of the printed document. In addition, you can change the style inwhich the printed document is formatted; for example, you can change thesizes and fonts used, the amount of indentation for each paragraph, thedegree to which words are hyphenated, and the like. By changing thespecifications, you can make a book look dignified, old and serious, orlight-hearted, young and cheery.@refill@TeX{} is freely distributable. It is written in a superset of Pascalcalled WEB and can be compiled either in Pascal or (by using aconversion program that comes with the @TeX{} distribution) in C.(@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for informationabout @TeX{}.)@refill@TeX{} is very powerful and has a great many features. Because aTexinfo file must be able to present information both on acharacter-only terminal in Info form and in a typeset book, theformatting commands that Texinfo supports are necessarily
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -