* texinfo.tex (\smallformatx, \smalldisplayx): New macros.

(\smallbook): Arrange to use them.
	(\display, \flushleft, etc.): Rewrite to avoid duplication.
This commit is contained in:
Karl Berry 1998-06-12 19:10:27 +00:00
parent 511cb55530
commit ea9504a609

View file

@ -1190,11 +1190,12 @@ where each line of input produces a line of output.}
% Do not make many font distinctions in general in the index, since they % Do not make many font distinctions in general in the index, since they
% aren't very useful. % aren't very useful.
\setfont\ninett\ttshape{9}{1000} \setfont\ninett\ttshape{9}{1000}
\setfont\ninettsl\ttslshape{9}{1000}
\setfont\indrm\rmshape{9}{1000} \setfont\indrm\rmshape{9}{1000}
\setfont\indit\slshape{9}{1000} \setfont\indit\slshape{9}{1000}
\let\indsl=\indit \let\indsl=\indit
\let\indtt=\ninett \let\indtt=\ninett
\let\indttsl=\ninett \let\indttsl=\ninettsl
\let\indsf=\indrm \let\indsf=\indrm
\let\indbf=\indrm \let\indbf=\indrm
\setfont\indsc\scshape{10}{900} \setfont\indsc\scshape{10}{900}
@ -3747,49 +3748,52 @@ width0pt\relax} \fi
\fi \fi
} }
% To ending an @example-like environment, we first end the paragraph % Define the \E... control sequence only if we are inside the particular
% (via \afterenvbreak's vertical glue), and then the group. That way we % environment, so the error checking in \end will work.
% keep the zero \parskip that the environments set -- \parskip glue
% will be inserted at the beginning of the next paragraph in the
% document, after the environment.
% %
\def\nonfillfinish{\afterenvbreak\endgroup}% % To end an @example-like environment, we first end the paragraph (via
% \afterenvbreak's vertical glue), and then the group. That way we keep
% the zero \parskip that the environments set -- \parskip glue will be
% inserted at the beginning of the next paragraph in the document, after
% the environment.
%
\def\nonfillfinish{\afterenvbreak\endgroup}
% @lisp: indented, narrowed, typewriter font.
\def\lisp{\begingroup \def\lisp{\begingroup
\nonfillstart \nonfillstart
\let\Elisp = \nonfillfinish \let\Elisp = \nonfillfinish
\tt \tt
% Make @kbd do something special, if requested. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
\let\kbdfont\kbdexamplefont \gobble % eat return
\rawbackslash % have \ input char produce \ char from current font
\gobble
} }
% Define the \E... control sequence only if we are inside the % @example: Same as @lisp.
% environment, so the error checking in \end will work.
%
% We must call \lisp last in the definition, since it reads the
% return following the @example (or whatever) command.
%
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
% @small... is usually equivalent to the non-small (@smallbook
% redefines). We must call \example (or whatever) last in the
% definition, since it reads the return following the @example (or
% whatever) command.
%
% This actually allows (for example) @end display inside an
% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
%
\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
% @smallexample and @smalllisp. This is not used unless the @smallbook % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
% command is given. Originally contributed by Pavel@xerox. % Originally contributed by Pavel@xerox.
%
\def\smalllispx{\begingroup \def\smalllispx{\begingroup
\nonfillstart \def\Esmalllisp{\nonfillfinish\endgroup}%
\let\Esmalllisp = \nonfillfinish \def\Esmallexample{\nonfillfinish\endgroup}%
\let\Esmallexample = \nonfillfinish \indexfonts
% \lisp
% Smaller fonts for small examples.
\indexfonts \tt
\rawbackslash % make \ output the \ character from the current font (tt)
\gobble
} }
% This is @display; same as @lisp except use roman font. % @display: same as @lisp except keep current font.
% %
\def\display{\begingroup \def\display{\begingroup
\nonfillstart \nonfillstart
@ -3797,7 +3801,15 @@ width0pt\relax} \fi
\gobble \gobble
} }
% This is @format; same as @display except don't narrow margins. % @smalldisplay (when @smallbook): @display plus smaller fonts.
%
\def\smalldisplayx{\begingroup
\def\Esmalldisplay{\nonfillfinish\endgroup}%
\indexfonts \rm
\display
}
% @format: same as @display except don't narrow margins.
% %
\def\format{\begingroup \def\format{\begingroup
\let\nonarrowing = t \let\nonarrowing = t
@ -3806,20 +3818,27 @@ width0pt\relax} \fi
\gobble \gobble
} }
% @flushleft (same as @format) and @flushright. % @smallformat (when @smallbook): @format plus smaller fonts.
% %
\def\flushleft{\begingroup \def\smallformatx{\begingroup
\let\nonarrowing = t \def\Esmallformat{\nonfillfinish\endgroup}%
\nonfillstart \indexfonts \rm
\let\Eflushleft = \nonfillfinish \format
\gobble
} }
% @flushleft (same as @format).
%
\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
% @flushright.
%
\def\flushright{\begingroup \def\flushright{\begingroup
\let\nonarrowing = t \let\nonarrowing = t
\nonfillstart \nonfillstart
\let\Eflushright = \nonfillfinish \let\Eflushright = \nonfillfinish
\advance\leftskip by 0pt plus 1fill \advance\leftskip by 0pt plus 1fill
\gobble} \gobble
}
% @quotation does normal linebreaking (hence we can't use \nonfillstart) % @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins. % and narrows the margins.
@ -3842,6 +3861,7 @@ width0pt\relax} \fi
\fi \fi
} }
\message{defuns,} \message{defuns,}
% Define formatter for defuns % Define formatter for defuns
% First, allow user to change definition object font (\df) internally % First, allow user to change definition object font (\df) internally
@ -4202,7 +4222,7 @@ width0pt\relax} \fi
\def\defspecx #1 {\errmessage{@defspecx in invalid context}} \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
\def\deftypefunx #1 {\errmessage{@deftypeunx in invalid context}} \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}}
% @defmethod, and so on % @defmethod, and so on
@ -5093,9 +5113,10 @@ width0pt\relax} \fi
\deftypemargin = 0pt \deftypemargin = 0pt
\defbodyindent = .5cm \defbodyindent = .5cm
% %
\let\smalllisp = \smalllispx \let\smalldisplay = \smalldisplayx
\let\smallexample = \smalllispx \let\smallexample = \smalllispx
\def\Esmallexample{\Esmalllisp}% \let\smallformat = \smallformatx
\let\smalllisp = \smalllispx
}} }}
% Use @afourpaper to print on European A4 paper. % Use @afourpaper to print on European A4 paper.