⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 texinfo.texinfo

📁 早期freebsd实现
💻 TEXINFO
📖 第 1 页 / 共 5 页
字号:
@menu* Info File::         Characteristics of the Info file.* Printed Manual::    Characteristics of the Printed Manual.* Conventions::       General Syntactic Conventions.* Short Sample::      A short sample Texinfo file.@end menu@node Info File, Printed Manual, , Overview@comment  node-name,  next,  previous,  up@section Characteristics of the Info file@cindex Characteristics of the Info file@cindex Info file characteristicsA Texinfo file can be transformed into a printed manual and an on-line Infofile.An on-line Info file is a file formatted so that the Info documentationreading program can operate on it.  Info files are divided into piecescalled @dfn{nodes}, each of which contains the discussion of one topic.Each node has a name, and contains both text for the user to read andpointers to other nodes, which are identified by their names.  The Infoprogram displays one node at a time, and provides commands with which theuser can move to the other nodes to which the current node points.@ifinfo@inforef{Info, info, info}, for more information about using Info.@end ifinfoNormally, most of the nodes are arranged in a tree which branches down.Each node may have any number of child nodes that describe subtopics of thenode's topic.  The names of these child nodes, if any, are listed in a@dfn{menu} within the parent node; this allows certain Info commands tobe used to move to one of the child nodes.  Each child node records theparent node name, as its `Up' pointer.  Thus, if a node were at the logicallevel of a `chapter', its child nodes would be `sections'; likewise,the child nodes of a section would be subsections.The root of the tree is the top node of the file, through which usersenter the file from the Info directory.  By convention, this node is alwayscalled @samp{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.Generally you enter the Info file from the top; then you can either traversethe file systematically by going from node to node or you can search largemenus that correspond to indices and go directly to the node that has theinformation you want.If you want to read through an Info file in sequence, as if it were aprinted manual, you can get the whole file with the advanced Info command@kbd{g *}.  (@inforef{Expert, info, info}.)@refillAll the children of any one parent are linked together in a bidirectionalchain of `Next' and `Previous' pointers.  This means that all the nodesthat are logically parallel to sections within a chapter are all linkedtogether.  Normally the order in this chain is the same as the order of thechildren in the parent's menu.  The last child has no `Next' pointer, andthe first child normally has the parent as its `Previous' pointer (as wellas its `Up' pointer, of course).Structuring the nodes in a tree is a matter of convention, not arequirement.  In fact, the `Up', `Previous' and `Next' pointers of a nodecan point to any other nodes, and the menu can contain any other nodes.The structure of nodes can be any directed graph.  But it is usually morecomprehensible to make it a tree.  Info provides another kind of pointerbetween nodes, called a reference, that can be sprinkled through the textof a node.  This is usually the best way to represent links that do not fitthe tree structure.Most often the nodes fall into a strict tree structure that corresponds tothe structure of chapters and sections in the printedmanual.  But there are times when this is not right for the material beingdiscussed.  Therefore, Texinfo uses separate commands to specify the nodestructure of the Info file and the section structure of the printed manual.Also, Texinfo requires that you specify menus explicitly, rather thangenerate them automatically based on an assumed tree structure.@node     Printed Manual, Conventions, Info File, Top@comment  node-name,  next,  previous,  up@section Characteristics of the Printed Manual@cindex Printed manual characteristics@cindex Characteristics, printed manual A Texinfo file can be formatted and typeset as a printed manual.  Theprinted manual will be the same as any other book; it will have a titlepage, copyright page, table of contents, and preface as you would expect,as well as chapters, numbered or unnumbered sections and subsections, notto mention page headers, cross references and indices.Texinfo can be used for writing a book without ever having the intention ofconverting it into on-line help.  Texinfo can be used for writing a novel;and it can even be used to write a memo, although this application is notrecommended since electronic mail is so much easier.Texinfo uses the formatting language called @TeX{} for typesetting.  A filecalled @file{texinfo.tex} contains information (definitions or@dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.  (Themacros tell @TeX{} how to convert the Texinfo @@-commands to @TeX{}commands which @TeX{} can then process to create the typeset document.)@file{texinfo.tex} contains the specifications for printing a document,either with 7 inch by 9.25 inch pages or with 8.5 inch by 11 inch pages.(This is 178 mm by 235 mm or else 216 mm by 280 mm.) Also, by changing theparameters in @file{texinfo.tex} you can easily change the size of theprinted document.  In addition, you can readily change the style in whichthe printed document is formatted; for example, you can change the sizes andfonts used, the amount of indentation for each paragraph, the degree towhich words are hyphenated, and the like.  By changing the specifications,you can make a book look dignified, old and serious, or light-hearted,young and cheery.@refill@TeX{} is very powerful and has a great many features.  Because a Texinfofile must be able to present information both on a character-only terminalin Info form and in a typeset book, the commands that Texinfo supports arenecessarily limited.@node   Conventions, Short Sample,  Printed Manual, Overview@comment  node-name,  next,  previous,  up@section General Syntactic Conventions@cindex  General syntactic conventions@cindex  Syntactic conventions@cindex  Conventions, syntacticTexinfo files contain a strictly limited set of constructs.  The strictlimits make it possible for Texinfo files to be understood both by @TeX{}and by the code which converts them into Info files.All ASCII printing characters except @samp{@@}, @samp{@{} and @samp{@}} canappear in body text in a Texinfo file and stand for themselves.  @samp{@@}is the escape character which introduces commands.  @samp{@{} and @samp{@}}should be used only to surround arguments to certain commands.  @samp{@{}and @samp{@}} appearing anywhere else will be treated by @TeX{} as agrouping but treated by the code that produces an Info file as themselves;this inconsistency is undesirable, so don't let it occur.  To put one ofthese special characters into the document, put an @samp{@@} character infront of it.  For example, you would insert @samp{@@@@}, @samp{@@@{}, and@samp{@@@}}.@refillIt is customary in @TeX{} to use doubled single-quote characters to beginand end quotations, @samp{``} like these @samp{''}.  This convention shouldbe followed in Texinfo files.  Also, three hyphens in a row, @samp{---},are used for a dash---like this.  In @TeX{}, a single or even a doublehyphen produces a dash that is shorter than you want.@refill@comment Remove for version 19@TeX{} ignores the line-breaks in the input text, except for blank lines,which separate paragraphs.  Info generally preserves the line breaks thatare present in the input file.  Therefore, break the lines in the Texinfofile the way you want them to appear in the output Info file, and let@TeX{} take care of itself.Since Info does not normally refill paragraphs when it processes them, aline with @@-commands in it will sometimes look bad after Info has run onit.  To cause Info to refill the paragraph after finishing with the otherprocessing, you need to put the command @code{@@refill} at the end of theparagraph. (@xref{Refilling & Noindent, , Refilling paragraphs andPreventing indentation}.)@refillTo prevent a paragraph from being indented in the printed manual, put thecommand @code{@@noindent} on a line by itself before the start of the textthat should not be indented.If you mark off a region of the Texinfo file with the @code{@@iftex} and@code{@@end iftex} commands so that the region will appear only in theprinted copy, you can use @TeX{} commands that cannot be used in the Infofile.In order to be made into a printed manual, a Texinfo file @strong{must}begin with lines that looks like@example\input texinfo   @@c -*-texinfo-*-@@setfilename @var{info-file-name}@@settitle @var{Name of Manual}@end example@noindentThe @samp{\input texinfo} line tells @TeX{} to use the @file{texinfo.tex}file.  This line is usually followed by a start-of-header line (not shownhere) and then by the @samp{@@setfilename @var{info-file-name}} and@samp{@@settitle @var{Name of Manual}} lines.  These two lines are neededto provide a name for the Info file and to specify the name used on theleft-hand page headers of the printed manual.@refillThe two lines that contain the @code{@@setfilename} and @code{@@settitle}commands usually are sandwiched between the start-of-header line and theend-of-header line. (@xref{Start-of-Header}, for more information.)  Thestart-of-header and end-of-header lines are needed if you are going to run@TeX{} or Info on just part of a file.@refill@node  Short Sample,      , Conventions, Overview@comment  node-name,  next,  previous,  up@section A Short Sample Texinfo File@cindex Sample texinfo fileA Texinfo file looks like the following, which is a complete but very shortTexinfo file.  The @code{@@comment} command introduces comments that willnot appear in either the Info file or the printed manual; they are for theperson who reads the Texinfo file.The first part of the file, from @samp{\input texinfo} through to@samp{@@end titlepage}, looks more intimidating than it is.  Most of thematerial is standard boilerplate; when you write a manual, you just put inthe name of your own manual in this section.@refillAll the commands that tell @TeX{} how to typeset the printed manual andtell @code{texinfo-format-buffer} how to create an Info file are precededby @samp{@@}; thus, @code{@@node} indicates a node and @code{@@chapter}indicates the start of a chapter.@example\input texinfo   @@c -*-texinfo-*-@@setfilename name-of-texinfo-file@@settitle Name of Manual@@setchapternewpage odd@@ifinfo@@comment The following line inserts the copyright notice @@comment into the Info file.Copyright @@copyright@{@} 1988 Free Software Foundation, Inc.@@end ifinfo@@comment The titlepage section does not appear in the Info file.@@titlepage@@sp 10@@comment The title is printed in a large font.@@center @@titlefont@{Sample Title@}@@comment  The following two commands start the copyright page@@comment  for the printed manual.  This will not appear in the Info file.@@page@@vskip 0pt plus 1filllCopyright @@copyright@{@} year copyright-owner@@end titlepage@@comment The Top node contains the master menu for the Info file.@@comment This appears only in the Info file, not the printed manual.@@node    Top,       First Chapter, (dir),    (dir)@@comment node-name, next,          previous, up@@menu* First Chapter::    The first chapter is the                      only chapter in this sample.@@end menu@@node     First Chapter,     , Top,      Top@@comment  node-name,     next, previous, up@@chapter First Chapter@@cindex Reference to First ChapterThis is the contents of the first chapter. Here is a numbered list.@@enumerate@@itemThis is the first item.@@itemThis is the second item.@@end enumerateThe @@kbd@{M-x texinfo-format-buffer@} command transforms a Texinfo filelike this into an Info file; and @@TeX@{@} typesets it for a printedmanual.@@node    Concept Index,    ,  Previous Node, Top@@comment node-name,    next,  previous,      up@@unnumbered Concept Index@@printindex cp@@contents@@bye@end exampleHere is what the contents of the first chapter of the sample look like:@quotationThis is the contents of the first chapter. Here is a numbered list.@enumerate@itemThis is the first item.@itemThis is the second item.@end enumerateThe @kbd{M-x texinfo-format-buffer} command transforms a Texinfo file likethis into an Info file; and @TeX{} typesets it for a printed manual.@end quotation@node  Texinfo Mode, Beginning a File,  Overview, Top@comment  node-name,  next,  previous,  up@chapter Using Texinfo Mode@cindex Texinfo mode@cindex Mode, using Texinfo@cindex GNU Emacs@cindex EmacsIn GNU Emacs, Texinfo mode is a major mode for editing Texinfo files.This means that Emacs has commands and features especially designed forworking with Texinfo files.  Like all other Emacs features, you cancustomize or enhance these as you wish.  In particular, the keybindings arevery easy to change.  The keybindings described here are the default orstandard ones.The major features of Texinfo mode are:@itemize @bullet@item Paragraph filling control.@item A command to show the structure of the file.@item Pre-defined keystroke commands to insert commonly used strings of text.@item Formatting a part of a file for Info, rather than the whole file.@end itemizeIn general, in Texinfo mode, the GNU Emacs editing commands are like thosein text-mode.  The major difference is that the paragraph separationvariable and syntax table are set up so expression commands skip Texinfobracket groups.  This means, for example, that the @kbd{M-q}(@code{fill-paragraph}) command will refill a paragraph but not the@@-command on a line adjacent to it.@refillBy convention, the Texinfo file name shall end with the extension@file{.texinfo} so that Emacs knows to use Texinfo mode for editing it.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -