3
3
% Load plain if necessary, i.e., if running under initex.
4
4
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6
\def\texinfoversion{2012-01-03.09}
6
\def\texinfoversion{2012-03-11.15}
8
8
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9
9
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10
% 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
10
% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
12
12
% This texinfo.tex file is free software: you can redistribute it and/or
13
13
% modify it under the terms of the GNU General Public License as
896
896
\parseargdef\center{%
898
\let\centersub\centerH
900
\let\centersub\centerV
902
\next{\hfil \ignorespaces#1\unskip \hfil}%
907
\advance\hsize by -\leftskip
908
\advance\hsize by -\rightskip
913
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
902
\centersub{\hfil \ignorespaces#1\unskip \hfil}%
903
\let\centersub\relax % don't let the definition persist, just in case
907
\advance\hsize by -\leftskip
908
\advance\hsize by -\rightskip
913
\newcount\centerpenalty
915
% The idea here is the same as in \startdefun, \cartouche, etc.: if
916
% @center is the first thing after a section heading, we need to wipe
917
% out the negative parskip inserted by \sectionheading, but still
918
% prevent a page break here.
919
\centerpenalty = \lastpenalty
920
\ifnum\centerpenalty>10000 \vskip\parskip \fi
921
\ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
922
\line{\kern\leftskip #1\kern\rightskip}%
915
925
% @sp n outputs n lines of vertical space
917
927
\parseargdef\sp{\vskip #1\baselineskip}
919
929
% @comment ...line which is ignored...
920
930
% @c is the same as @comment
921
931
% @ignore ... @end ignore is another way to write a comment
923
933
\def\comment{\begingroup \catcode`\^^M=\other%
924
934
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
926
936
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
930
940
% @paragraphindent NCHARS
1174
1184
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1175
1185
\def\dopdfimage#1#2#3{%
1176
\def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1177
\def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1186
\def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1187
\def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1179
1189
% pdftex (and the PDF format) support .pdf, .png, .jpg (among
1180
1190
% others). Let's try in that order, PDF first since if
2843
2859
\def\outfmtnametex{tex}
2845
\def\inlinefmt#1{\doinlinefmt #1,\finish}
2846
\def\doinlinefmt#1,#2,\finish{%
2861
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
2862
\long\def\doinlinefmt#1,#2,\finish{%
2847
2863
\def\inlinefmtname{#1}%
2848
2864
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
2855
2871
% well use a command to get a left brace too. We could re-use the
2856
2872
% delimiter character idea from \verb, but it seems like overkill.
2858
\def\inlineraw{\tex \doinlineraw}
2859
\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
2874
\long\def\inlineraw{\tex \doinlineraw}
2875
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
2860
2876
\def\doinlinerawtwo#1,#2,\finish{%
2861
2877
\def\inlinerawname{#1}%
2862
2878
\ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
5877
5890
% We'll almost certainly start a paragraph next, so don't let that
5878
5891
% glue accumulate. (Not a breakpoint because it's preceded by a
5879
% discardable item.)
5892
% discardable item.) However, when a paragraph is not started next
5893
% (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
5894
% or the negative glue will cause weirdly wrong output, typically
5895
% obscuring the section heading with something else.
5880
5896
\vskip-\parskip
5882
% This is purely so the last item on the list is a known \penalty >
5883
% 10000. This is so \startdefun can avoid allowing breakpoints after
5884
% section headings. Otherwise, it would insert a valid breakpoint between:
5885
% @section sec-whatever
5886
% @deffn def-whatever
5898
% This is so the last item on the main vertical list is a known
5899
% \penalty > 10000, so \startdefun, etc., can recognize the situation
5900
% and do the needful.
7802
7816
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
7803
7817
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
7804
7818
\def\ref#1{\xrefX[#1,,,,,,,]}
7821
\newbox\printedrefnamebox
7822
\newbox\printedmanualbox
7805
7824
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
7827
\def\printedrefname{\ignorespaces #3}%
7828
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
7807
7830
\def\printedmanual{\ignorespaces #5}%
7808
\def\printedrefname{\ignorespaces #3}%
7809
\setbox1=\hbox{\printedmanual\unskip}%
7810
\setbox0=\hbox{\printedrefname\unskip}%
7831
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
7833
% If the printed reference name (arg #3) was not explicitly given in
7834
% the @xref, figure out what we want to use.
7835
\ifdim \wd\printedrefnamebox = 0pt
7812
7836
% No printed node name was explicitly given.
7813
7837
\expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
7814
% Use the node name inside the square brackets.
7838
% Not auto section-title: use node name inside the square brackets.
7815
7839
\def\printedrefname{\ignorespaces #1}%
7817
% Use the actual chapter/section title appear inside
7818
% the square brackets. Use the real section title if we have it.
7820
% It is in another manual, so we don't have it.
7841
% Auto section-title: use chapter/section title inside
7842
% the square brackets if we have it.
7843
\ifdim \wd\printedmanualbox > 0pt
7844
% It is in another manual, so we don't have it; use node name.
7821
7845
\def\printedrefname{\ignorespaces #1}%
7824
% We know the real title if we have the xref values.
7848
% We (should) know the real title if we have the xref values.
7825
7849
\def\printedrefname{\refx{#1-title}{}}%
7827
7851
% Otherwise just copy the Info node name.
7876
7901
% if the user also gave the printed manual name (fifth arg), append
7877
7902
% "in MANUALNAME".
7903
\ifdim \wd\printedmanualbox > 0pt
7879
7904
\space \putwordin{} \cite{\printedmanual}%
7882
7907
% node/anchor (non-float) references.
7884
% If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
7885
% insert empty discretionaries after hyphens, which means that it will
7886
% not find a line break at a hyphen in a node names. Since some manuals
7887
% are best written with fairly long node names, containing hyphens, this
7888
% is a loss. Therefore, we give the text of the node name again, so it
7889
% is as if TeX is seeing it for the first time.
7891
\putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
7909
% If we use \unhbox to print the node names, TeX does not insert
7910
% empty discretionaries after hyphens, which means that it will not
7911
% find a line break at a hyphen in a node names. Since some manuals
7912
% are best written with fairly long node names, containing hyphens,
7913
% this is a loss. Therefore, we give the text of the node name
7914
% again, so it is as if TeX is seeing it for the first time.
7916
% Cross-manual reference. Only include the "Section ``foo'' in" if
7917
% the foo is neither missing or Top. Thus, @xref{,,,foo,The Foo Manual}
7918
% outputs simply "see The Foo Manual".
7919
\ifdim \wd\printedmanualbox > 0pt
7920
% What is the 7sp about? The idea is that we also want to omit
7921
% the Section part if we would be printing "Top", since they are
7922
% clearly trying to refer to the whole manual. But, this being
7923
% TeX, we can't easily compare strings while ignoring the possible
7924
% spaces before and after in the input. By adding the arbitrary
7925
% 7sp, we make it much less likely that a real node name would
7926
% happen to have the same width as "Top" (e.g., in a monospaced font).
7927
% I hope it will never happen in practice.
7929
% For the same basic reason, we retypeset the "Top" at every
7930
% reference, since the current font is indeterminate.
7932
\setbox\topbox = \hbox{Top\kern7sp}%
7933
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
7935
\ifdim \wd2 = \wd\topbox \else
7936
\putwordSection{} ``\printedrefname'' \putwordin{}\space
7939
\cite{\printedmanual}%
7941
% Reference in this manual.
7893
7943
% _ (for example) has to be the character _ for the purposes of the
7894
7944
% control sequence corresponding to the node, but it has to expand
7895
7945
% into the usual \leavevmode...\vrule stuff for purposes of
8305
8355
% If the image is by itself, center it.
8307
8357
\imagevmodetrue
8358
\else \ifx\centersub\centerV
8359
% for @center @image, we need a vbox so we can have our vertical space
8361
\vbox\bgroup % vbox has better behavior than vtop herev
8308
8365
\nobreak\medskip
8309
8366
% Usually we'll have text after the image which will insert
8310
8367
% \parskip glue, so insert it here too to equalize the space
8316
8373
% Leave vertical mode so that indentation from an enclosing
8317
% environment such as @quotation is respected. On the other hand, if
8318
% it's at the top level, we don't want the normal paragraph indentation.
8374
% environment such as @quotation is respected.
8375
% However, if we're at the top level, we don't want the
8376
% normal paragraph indentation.
8377
% On the other hand, if we are in the case of @center @image, we don't
8378
% want to start a paragraph, which will create a hsize-width box and
8379
% eradicate the centering.
8380
\ifx\centersub\centerV\else \noindent \fi
8321
8382
% Output the image.