📄 texinfo.tex
字号:
@gdef@activebackslashdouble{% @catcode@backChar=@active @let\=@doublebackslash}}% To handle parens, we must adopt a different approach, since parens are% not active characters. hyperref.dtx (which has the same problem as% us) handles it with this amazing macro to replace tokens. I've% tinkered with it a little for texinfo, but it's definitely from there.% % #1 is the tokens to replace.% #2 is the replacement.% #3 is the control sequence with the string.% \def\HyPsdSubst#1#2#3{% \def\HyPsdReplace##1#1##2\END{% ##1% \ifx\\##2\\% \else #2% \HyReturnAfterFi{% \HyPsdReplace##2\END }% \fi }% \xdef#3{\expandafter\HyPsdReplace#3#1\END}%}\long\def\HyReturnAfterFi#1\fi{\fi#1}% #1 is a control sequence in which to do the replacements.\def\backslashparens#1{% \xdef#1{#1}% redefine it as its expansion; the definition is simply % \lastnode when called from \setref -> \pdfmkdest. \HyPsdSubst{(}{\backslashlparen}{#1}% \HyPsdSubst{)}{\backslashrparen}{#1}%}{\catcode\exclamChar = 0 \catcode\backChar = \other !gdef!backslashlparen{\(}% !gdef!backslashrparen{\)}%}\ifpdf \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, and characters % such as \, aren't expanded when present in a section title. \atdummies \activebackslashdouble \def\pdfdestname{#1}% \backslashparens\pdfdestname \pdfdest name{\pdfdestname} xyz% }}% % % used to mark target names; must be expandable. \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, which is what will be displayed in the % outline by the pdf viewer. #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 worth the trouble, since most documents are normally structured. \def\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else % Doubled backslashes in the name. {\activebackslashdouble \xdef\pdfoutlinedest{#3}% \backslashparens\pdfoutlinedest}% \fi % % Also double the backslashes in the display string. {\activebackslashdouble \xdef\pdfoutlinetext{#1}% \backslashparens\pdfoutlinetext}% % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % 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\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % 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}% \readdatafile{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}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % xx to do this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Right % now, I guess we'll just let the pdf reader have its way. \indexnofonts \setupdatafile \activebackslash \input \jobname.toc \endgroup } % \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\@{@}% \makevalueexpandable \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#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|\relax \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}\else \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\linkcolor = \relax \let\pdfmakeoutlines = \relax\fi % \ifx\pdfoutput\message{fonts,}% Change the current font style to #1, remembering it in \curfontstyle.% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in% italics, not bold italics.%\def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font}% Select #1 fonts with the current style.%\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}\def\rm{\fam=0 \setfontstyle{rm}}\def\it{\fam=\itfam \setfontstyle{it}}\def\sl{\fam=\slfam \setfontstyle{sl}}\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}\def\tt{\fam=\ttfam \setfontstyle{tt}}% Texinfo sort of supports the sans serif font style, which plain TeX does not.% So we set up a \sf.\newfam\sffam\def\sf{\fam=\sffam \setfontstyle{sf}}\let\li = \sf % Sometimes we call it \li, not \sf.% We don't need math for this font style.\def\ttsl{\setfontstyle{ttsl}}% 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}\def\ttbshape{tt}\def\ttslshape{sltt}\def\itshape{ti}\def\itbshape{bxti}\def\slshape{sl}\def\slbshape{bxsl}\def\sfshape{ss}\def\sfbshape{ss}\def\scshape{csc}\def\scbshape{csc}% Text fonts (11.2pt, magstep1).\def\textnominalsize{11pt}\edef\mainmagstep{\magstephalf}\setfont\textrm\rmshape{10}{\mainmagstep}\setfont\texttt\ttshape{10}{\mainmagstep}\setfont\textbf\bfshape{10}{\mainmagstep}\setfont\textit\itshape{10}{\mainmagstep}\setfont\textsl\slshape{10}{\mainmagstep}\setfont\textsf\sfshape{10}{\mainmagstep}\setfont\textsc\scshape{10}{\mainmagstep}\setfont\textttsl\ttslshape{10}{\mainmagstep}\font\texti=cmmi10 scaled \mainmagstep\font\textsy=cmsy10 scaled \mainmagstep% A few fonts for @defun names and args.\setfont\defbf\bfshape{10}{\magstep1}\setfont\deftt\ttshape{10}{\magstep1}\setfont\defttsl\ttslshape{10}{\magstep1}\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}% Fonts for indices, footnotes, small examples (9pt).\def\smallnominalsize{9pt}\setfont\smallrm\rmshape{9}{1000}\setfont\smalltt\ttshape{9}{1000}\setfont\smallbf\bfshape{10}{900}\setfont\smallit\itshape{9}{1000}\setfont\smallsl\slshape{9}{1000}\setfont\smallsf\sfshape{9}{1000}\setfont\smallsc\scshape{10}{900}\setfont\smallttsl\ttslshape{10}{900}\font\smalli=cmmi9\font\smallsy=cmsy9% Fonts for small examples (8pt).\def\smallernominalsize{8pt}\setfont\smallerrm\rmshape{8}{1000}\setfont\smallertt\ttshape{8}{1000}\setfont\smallerbf\bfshape{10}{800}\setfont\smallerit\itshape{8}{1000}\setfont\smallersl\slshape{8}{1000}\setfont\smallersf\sfshape{8}{1000}\setfont\smallersc\scshape{10}{800}\setfont\smallerttsl\ttslshape{10}{800}\font\smalleri=cmmi8\font\smallersy=cmsy8% Fonts for title page (20.4pt):\def\titlenominalsize{20pt}\setfont\titlerm\rmbshape{12}{\magstep3}\setfont\titleit\itbshape{10}{\magstep4}\setfont\titlesl\slbshape{10}{\magstep4}\setfont\titlett\ttbshape{12}{\magstep3}\setfont\titlettsl\ttslshape{10}{\magstep4}\setfont\titlesf\sfbshape{17}{\magstep1}\let\titlebf=\titlerm\setfont\titlesc\scbshape{10}{\magstep4}\font\titlei=cmmi12 scaled \magstep3\font\titlesy=cmsy10 scaled \magstep4\def\authorrm{\secrm}\def\authortt{\sectt}% Chapter (and unnumbered) fonts (17.28pt).\def\chapnominalsize{17pt}\setfont\chaprm\rmbshape{12}{\magstep2}\setfont\chapit\itbshape{10}{\magstep3}\setfont\chapsl\slbshape{10}{\magstep3}\setfont\chaptt\ttbshape{12}{\magstep2}\setfont\chapttsl\ttslshape{10}{\magstep3}\setfont\chapsf\sfbshape{17}{1000}\let\chapbf=\chaprm\setfont\chapsc\scbshape{10}{\magstep3}\font\chapi=cmmi12 scaled \magstep2\font\chapsy=cmsy10 scaled \magstep3% Section fonts (14.4pt).\def\secnominalsize{14pt}\setfont\secrm\rmbshape{12}{\magstep1}\setfont\secit\itbshape{10}{\magstep2}\setfont\secsl\slbshape{10}{\magstep2}\setfont\sectt\ttbshape{12}{\magstep1}\setfont\secttsl\ttslshape{10}{\magstep2}\setfont\secsf\sfbshape{12}{\magstep1}\let\secbf\secrm\setfont\secsc\scbshape{10}{\magstep2}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -