📄 texinfo.tex
字号:
% @? is an end-of-sentence query.\gdef\?{?\spacefactor=3000 }% @w prevents a word break. Without the \leavevmode, @w at the% beginning of a paragraph, when TeX is still in vertical mode, would% produce a whole line of output instead of starting the paragraph.\def\w#1{\leavevmode\hbox{#1}}% @group ... @end group forces ... to be all on one page, by enclosing% it in a TeX vbox. We use \vtop instead of \vbox to construct the box% to keep its height that of a normal line. According to the rules for% \topskip (p.114 of the TeXbook), the glue inserted is% max (\topskip - \ht (first item), 0). If that height is large,% therefore, no glue is inserted, and the space between the headline and% the text is small, which looks bad.%\def\group{\begingroup \ifnum\catcode13=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi % % The \vtop we start below produces a box with normal height and large % depth; thus, TeX puts \baselineskip glue before it, and (when the % next line of text is done) \lineskip glue after it. (See p.82 of % the TeXbook.) Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% \egroup % End the \vtop. \endgroup % End the \group. }% % \vtop\bgroup % We have to put a strut on the last line in case the @group is in % the midst of an example, rather than completely enclosing it. % Otherwise, the interline space between the last line of the group % and the first line afterwards is too small. But we can't put the % strut in \Egroup, since there it would be on a line by itself. % Hence this just inserts a strut at the beginning of each line. \everypar = {\strut}% % % Since we have a strut on every line, we don't need any of TeX's % normal interline spacing. \offinterlineskip % % OK, but now we have to do something about blank % lines in the input in @example-like environments, which normally % just turn into \lisppar, which will insert no space now that we've % turned off the interline space. Simplest is to make them be an % empty paragraph. \ifx\par\lisppar \edef\par{\leavevmode \par}% % % Reset ^^M's definition to new definition of \par. \obeylines \fi % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment}%% TeX puts in an \escapechar (i.e., `@') at the beginning of the help% message, so this ends up printing `@group can only ...'.%\newhelp\groupinvalidhelp{%group can only be used in environments such as @example,^^J%where each line of input produces a line of output.}% @need space-in-mils% forces a page break if there is not space-in-mils remaining.\newdimen\mil \mil=0.001in\def\need{\parsearg\needx}% Old definition--didn't work.%\def\needx #1{\par %%% This method tries to make TeX break the page naturally%% if the depth of the box does not fit.%{\baselineskip=0pt%%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000%\prevdepth=-1000pt%}}\def\needx#1{% % Go into vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % Don't add any leading before our big empty box, but allow a page % break, since the best break might be right here. \allowbreak \nointerlineskip \vtop to #1\mil{\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak}% @br forces paragraph break\let\br = \par% @dots{} output some dots\def\dots{$\ldots$}% @page forces the start of a new page\def\page{\par\vfill\supereject}% @exdent text....% outputs text on separate line in roman font, starting at standard page margin% This records the amount of indent in the innermost environment.% That's how much \exdent should take out.\newskip\exdentamount% This defn is used inside fill environments such as @defun.\def\exdent{\parsearg\exdentyyy}\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}% This defn is used inside nofill environments such as @example.\def\nofillexdent{\parsearg\nofillexdentyyy}\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount\leftline{\hskip\leftskip{\rm#1}}}}% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.\def\inmargin#1{%\strut\vadjust{\nobreak\kern-\strutdepth \vtop to \strutdepth{\baselineskip\strutdepth\vss \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}\newskip\inmarginspacing \inmarginspacing=1cm\def\strutdepth{\dp\strutbox}%\hbox{{\rm#1}}\hfil\break}}% @include file insert text of that file as input.% Allow normal characters that we make active in the argument (a file name).\def\include{\begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\includezzz}% Restore active chars for included file.\def\includezzz#1{\endgroup\begingroup % Read the included file in a group so nested @include's work. \def\thisfile{#1}% \input\thisfile\endgroup}\def\thisfile{}% @center line outputs that line, centered\def\center{\parsearg\centerzzz}\def\centerzzz #1{{\advance\hsize by -\leftskip\advance\hsize by -\rightskip\centerline{#1}}}% @sp n outputs n lines of vertical space\def\sp{\parsearg\spxxx}\def\spxxx #1{\par \vskip #1\baselineskip}% @comment ...line which is ignored...% @c is the same as @comment% @ignore ... @end ignore is another way to write a comment\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%\parsearg \commentxxx}\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }\let\c=\comment% Prevent errors for section commands.% Used in @ignore and in failing conditionals.\def\ignoresections{%\let\chapter=\relax\let\unnumbered=\relax\let\top=\relax\let\unnumberedsec=\relax\let\unnumberedsection=\relax\let\unnumberedsubsec=\relax\let\unnumberedsubsection=\relax\let\unnumberedsubsubsec=\relax\let\unnumberedsubsubsection=\relax\let\section=\relax\let\subsec=\relax\let\subsubsec=\relax\let\subsection=\relax\let\subsubsection=\relax\let\appendix=\relax\let\appendixsec=\relax\let\appendixsection=\relax\let\appendixsubsec=\relax\let\appendixsubsection=\relax\let\appendixsubsubsec=\relax\let\appendixsubsubsection=\relax\let\contents=\relax\let\smallbook=\relax\let\titlepage=\relax}% Used in nested conditionals, where we have to parse the Texinfo source% and so want to turn off most commands, in case they are used% incorrectly.%\def\ignoremorecommands{% \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax \let\defindex = \relax \let\defivar = \relax \let\defmac = \relax \let\defmethod = \relax \let\defop = \relax \let\defopt = \relax \let\defspec = \relax \let\deftp = \relax \let\deftypefn = \relax \let\deftypefun = \relax \let\deftypevar = \relax \let\deftypevr = \relax \let\defun = \relax \let\defvar = \relax \let\defvr = \relax \let\ref = \relax \let\xref = \relax \let\printindex = \relax \let\pxref = \relax \let\settitle = \relax \let\setchapternewpage = \relax \let\setchapterstyle = \relax \let\everyheading = \relax \let\evenheading = \relax \let\oddheading = \relax \let\everyfooting = \relax \let\evenfooting = \relax \let\oddfooting = \relax \let\headings = \relax \let\include = \relax \let\lowersections = \relax \let\down = \relax \let\raisesections = \relax \let\up = \relax \let\set = \relax \let\clear = \relax \let\item = \relax}% Ignore @ignore ... @end ignore.%\def\ignore{\doignore{ignore}}% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.%\def\ifinfo{\doignore{ifinfo}}\def\ifhtml{\doignore{ifhtml}}\def\html{\doignore{html}}\def\menu{\doignore{menu}}\def\direntry{\doignore{direntry}}% @dircategory CATEGORY -- specify a category of the dir file% which this file should belong to. Ignore this in TeX.\def\dircategory{\comment}% Ignore text until a line `@end #1'.%\def\doignore#1{\begingroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define a command to swallow text until we reach `@end #1'. \long\def\doignoretext##1\end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 % % And now expand that command. \doignoretext}% What we do to finish off ignored text.%\def\enddoignore{\endgroup\ignorespaces}%\newif\ifwarnedobs\warnedobsfalse\def\obstexwarn{% \ifwarnedobs\relax\else % We need to warn folks that they may have trouble with TeX 3.0. % This uses \immediate\write16 rather than \message to get newlines. \immediate\write16{} \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} \immediate\write16{} \global\warnedobstrue \fi}% **In TeX 3.0, setting text in \nullfont hangs tex. For a% workaround (which requires the file ``dummy.tfm'' to be installed),% uncomment the following line:%%%%%\font\nullfont=dummy\let\obstexwarn=\relax% Ignore text, except that we keep track of conditional commands for% purposes of nesting, up to an `@end #1' command.%\def\nestedignore#1{% \obstexwarn % We must actually expand the ignored text to look for the @end % command, so that nested ignore constructs work. Thus, we put the % text into a \vbox and then do nothing with the result. To minimize % the change of memory overflow, we follow the approach outlined on % page 401 of the TeXbook: make the current font be a dummy font. % \setbox0 = \vbox\bgroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define `@end #1' to end the box, which will in turn undefine the % @end command again. \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% % % We are going to be parsing Texinfo commands. Most cause no % trouble when they are used incorrectly, but some commands do % complicated argument parsing or otherwise get confused, so we % undefine them. % % We can't do anything about stray @-signs, unfortunately; % they'll produce `undefined control sequence' errors. \ignoremorecommands % % Set the current font to be \nullfont, a TeX primitive, and define % all the font commands to also use \nullfont. We don't use % dummy.tfm, as suggested in the TeXbook, because not all sites % might have that installed. Therefore, math mode will still % produce output, but that should be an extremely small amount of % stuff compared to the main input. % \nullfont \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont \let\tensf = \nullfont % Similarly for index fonts (mostly for their use in % smallexample) \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont \let\indsf = \nullfont % % Don't complain when characters are missing from the fonts.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -