📄 texinfo.tex
字号:
% @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{\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.% We cannot 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}% @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.% % @math does not do math typesetting in section titles, index% entries, and other such contexts where the catcodes are set before% @math gets a chance to work. This could perhaps be fixed, but for now% at least we can have real math in the main text, where it's needed most.%\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.% {\catcode95 = \active % 95 = _\gdef\mathunderscore{% \catcode95=\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 \implicitmath\finishmath}\def\finishmath#1{#1\implicitmath\Etex}% @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 \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{{\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 by1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} \def\pdfmakeoutlines{{% \openin 1 \jobname.toc \ifeof 1\else\begingroup \closein 1 \indexnofonts \def\tt{} \let\_ = \normalunderscore % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % \def\chapentry ##1##2##3{} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{} \def\secentry ##1##2##3##4{\advancenumber{chap##2}} \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} \input \jobname.toc \def\chapentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{% \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \def\secentry ##1##2##3##4{% \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} \def\unnumbsecentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} \def\subsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} \def\unnumbsubsecentry ##1##2##3##4{% \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} \def\subsubsecentry ##1##2##3##4##5##6{% \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} \def\unnumbsubsubsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} \input \jobname.toc \endgroup\fi }} \def\makelinks #1,{% \def\params{#1}\def\E{END}% \ifx\params\E \let\nextmakelinks=\relax \else \let\nextmakelinks=\makelinks \ifnum\lnkcount>0,\fi \picknum{#1}% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{\the\pgn}}% \linkcolor #1% \advance\lnkcount by 1% \endlink \fi \nextmakelinks } \def\picknum#1{\expandafter\pn#1} \def\pn#1{% \def\p{#1}% \ifx\p\lbrace \let\nextpn=\ppn \else \let\nextpn=\ppnn \def\first{#1} \fi \nextpn } \def\ppn#1{\pgn=#1\gobble} \def\ppnn{\pgn=\first} \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \ifx\p\space\else\addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \fi \nextsp} \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi \def\pdfurl#1{% \begingroup \normalturnoffactive\def\@{@}% \let\value=\expandablevalue \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% % #1 \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS| \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}\fi % \ifx\pdfoutput\message{fonts,}% Font-change commands.% Texinfo sort of supports the sans serif font style, which plain TeX does not.% So we set up a \sf analogous to plain's \rm, etc.\newfam\sffam\def\sf{\fam=\sffam \tensf}\let\li = \sf % Sometimes we call it \li, not \sf.% We don't need math for this one.\def\ttsl{\tenttsl}% Default leading.\newdimen\textleading \textleading = 13.2pt% Set the baselineskip to #1, and the lineskip and strut size% correspondingly. There is no deep meaning behind these magic numbers% used as factors; they just match (closely enough) what Knuth defined.%\def\lineskipfactor{.08333}\def\strutheightpercent{.70833}\def\strutdepthpercent {.29167}%\def\setleading#1{% \normalbaselineskip = #1\relax \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }%}% Set the font macro #1 to the font named #2, adding on the% specified font prefix (normally `cm').% #3 is the font's design size, #4 is a scale factor\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}% Use cm as the default font prefix.% To specify the font prefix, you must define \fontprefix% before you read in texinfo.tex.\ifx\fontprefix\undefined\def\fontprefix{cm}\fi% Support font families that don't use the same naming scheme as CM.\def\rmshape{r}\def\rmbshape{bx} %where the normal face is bold\def\bfshape{b}\def\bxshape{bx}\def\ttshape{tt}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -