📄 texinfo.tex
字号:
\fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp}% @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`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \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}% \let\value=\expandablevalue \input\thisfile\endgroup}\def\thisfile{}% @center line% outputs that line, centered.%\def\center{\parsearg\docenter}\def\docenter#1{{% \ifhmode \hfil\break \fi \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{\hfil \ignorespaces#1\unskip \hfil}% \ifhmode \break \fi}}% @sp n outputs n lines of vertical space\def\sp{\parsearg\spxxx}\def\spxxx #1{\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{\begingroup \catcode`\^^M=\other%\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%\commentxxx}{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}\let\c=\comment% @paragraphindent NCHARS% We'll use ems for NCHARS, close enough.% NCHARS can also be the word `asis' or `none'.% We cannot feasibly implement @paragraphindent asis, though.%\def\asisword{asis} % no translation, these are keywords\def\noneword{none}%\def\paragraphindent{\parsearg\doparagraphindent}\def\doparagraphindent#1{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent}% @exampleindent NCHARS% We'll use ems for NCHARS like @paragraphindent.% It seems @exampleindent asis isn't necessary, but% I preserve it to make it similar to @paragraphindent.\def\exampleindent{\parsearg\doexampleindent}\def\doexampleindent#1{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi}% @firstparagraphindent WORD% If WORD is `none', then suppress indentation of the first paragraph% after a section heading. If WORD is `insert', then do indent at such% paragraphs.%% The paragraph indentation is suppressed or not by calling% \suppressfirstparagraphindent, which the sectioning commands do.% We switch the definition of this back and forth according to WORD.% By default, we suppress indentation.%\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}\newdimen\currentparindent%\def\insertword{insert}%\def\firstparagraphindent{\parsearg\dofirstparagraphindent}\def\dofirstparagraphindent#1{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi}% Here is how we actually suppress indentation. Redefine \everypar to% \kern backwards by \parindent, and then reset itself to empty.%% We also make \indent itself not actually do anything until the next% paragraph.%\gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }%}\gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}%}% @asis just yields its argument. Used with @table, for example.%\def\asis#1{#1}% @math outputs its argument in math mode.% We don't use $'s directly in the definition of \math because we need% to set catcodes according to plain TeX first, to allow for subscripts,% superscripts, special math chars, etc.%\let\implicitmath = $%$ font-lock fix%% One complication: _ usually means subscripts, but it could also mean% an actual _ character, as in @math{@var{some_variable} + 1}. So make% _ within @math be active (mathcode "8000), and distinguish by seeing% if the current family is \slfam, which is what @var uses.%{\catcode\underChar = \active\gdef\mathunderscore{% \catcode\underChar=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}%}}%% Another complication: we want \\ (and @\) to output a \ character.% FYI, plain.tex uses \\ as a temporary control sequence (why?), but% this is not advertised and we don't care. Texinfo does not% otherwise define @\.%% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}%\def\math{% \tex \mathcode`\_="8000 \mathunderscore \let\\ = \mathbackslash \mathactive \implicitmath\finishmath}\def\finishmath#1{#1\implicitmath\Etex}% Some active characters (such as <) are spaced differently in math.% We have to reset their definitions in case the @math was an% argument to a command which set the catcodes (such as @item or @section).%{ \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus }}% @bullet and @minus need the same treatment as @math, just above.\def\bullet{\implicitmath\ptexbullet\implicitmath}\def\minus{\implicitmath-\implicitmath}% @refill is a no-op.\let\refill=\relax% If working on a large document in chapters, it is convenient to% be able to disable indexing, cross-referencing, and contents, for test runs.% This is done with @novalidate (before @setfilename).%\newif\iflinks \linkstrue % by default we want the aux files.\let\novalidate = \linksfalse% @setfilename is done at the beginning of every texinfo file.% So open here the files we need to have open while reading the input.% This makes it possible to make a .fmt file for texinfo.\def\setfilename{% \iflinks \readauxfile \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi \closein1 \temp % \comment % Ignore the actual filename.}% Called from \setfilename.%\def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}%}% @bye.\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}\message{pdf,}% adobe `portable' document format\newcount\tempnum\newcount\lnkcount\newtoks\filename\newcount\filenamelength\newcount\pgn\newtoks\toksA\newtoks\toksB\newtoks\toksC\newtoks\toksD\newbox\boxA\newcount\countA\newif\ifpdf\newif\ifpdfmakepagedest\ifx\pdfoutput\undefined \pdffalse \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\linkcolor = \relax \let\pdfmakeoutlines = \relax\else \pdftrue \pdfoutput = 1 \input pdfcolor \pdfcatalog{/PageMode /UseOutlines}% \def\dopdfimage#1#2#3{% \def\imagewidth{#2}% \def\imageheight{#3}% % without \immediate, pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifx\empty\imagewidth\else width \imagewidth \fi \ifx\empty\imageheight\else height \imageheight \fi \ifnum\pdftexversion<13 #1.pdf% \else {#1.pdf}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code in a section title % aren't expanded. \atdummies \normalturnoffactive \pdfdest name{#1} xyz% }} \def\pdfmkpgn#1{#1} \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node % text, which might be empty if this toc entry had no % corresponding node. #4 is the page number. % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worthwhile, since most documents are normally structured. \def\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}% } % \def\pdfmakeoutlines{% \openin 1 \jobname.toc \ifeof 1\else\begingroup \closein 1 % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % % Read toc silently, to get counts of subentries for \pdfoutline. \def\numchapentry##1##2##3##4{\def\thischapnum{##2}}% \def\numsecentry##1##2##3##4{% \def\thissecnum{##2}% \advancenumber{chap\thischapnum}}% \def\numsubsecentry##1##2##3##4{% \def\thissubsecnum{##2}% \advancenumber{sec\thissecnum}}% \def\numsubsubsecentry##1##2##3##4{\advancenumber{subsec\thissubsecnum}}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \input \jobname.toc % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % Make special characters normal for writing to the pdf file. \indexnofonts \turnoffactive \input \jobname.toc \endgroup\fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -