* texinfo.tex (\anchor): New command @anchor.
authorKarl Berry <karl@gnu.org>
Wed, 1 Jul 1998 14:28:14 +0000 (14:28 +0000)
committerKarl Berry <karl@gnu.org>
Wed, 1 Jul 1998 14:28:14 +0000 (14:28 +0000)
(\xrefX): Avoid double space when xref to an @anchor or an @unnumbered.

* texinfo.tex (\itemzzz): Use kerns and \unhbox when item text
fits in the space, so footnotes can work.

texinfo.tex

index 1b88096676228b12ae3a4ba3b48dcbb84638de2f..52a9a762a4312b385b20df6b26ea6d258096bfa0 100644 (file)
@@ -1793,11 +1793,6 @@ July\or August\or September\or October\or November\or December\fi
   \itemindex{#1}%
   \nobreak % This prevents a break before @itemx.
   %
-  % Be sure we are not still in the middle of a paragraph.
-  %{\parskip = 0in
-  %\par
-  %}%
-  %
   % If the item text does not fit in the space we have, put it on a line
   % by itself, and do not allow a page break either before or after that
   % line.  We do not start a paragraph here because then if the next
@@ -1830,9 +1825,15 @@ July\or August\or September\or October\or November\or December\fi
     % text will be indented by \tableindent, we make the item text be in
     % a zero-width box.
     \noindent
-    \rlap{\hskip -\tableindent\box0}\ignorespaces%
-    \endgroup%
-    \itemxneedsnegativevskiptrue%
+    % Do this with kerns and \unhbox so that if there is a footnote in
+    % the item text, it can migrate to the main vertical list and
+    % eventually be printed.
+    \nobreak\kern-\tableindent
+    \dimen0 = \itemmax  \advance\dimen0 by -\wd0
+    \unhbox0
+    \nobreak\kern\dimen0
+    \endgroup
+    \itemxneedsnegativevskiptrue
   \fi
 }
 
@@ -1843,9 +1844,10 @@ July\or August\or September\or October\or November\or December\fi
 \def\xitem{\errmessage{@xitem while not in a table}}
 \def\xitemx{\errmessage{@xitemx while not in a table}}
 
-%% Contains a kludge to get @end[description] to work
+% Contains a kludge to get @end[description] to work.
 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
 
+% @table, @ftable, @vtable.
 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
 {\obeylines\obeyspaces%
 \gdef\tablex #1^^M{%
@@ -4623,11 +4625,17 @@ width0pt\relax} \fi
 \def\appendixnoderef{%
   \ifx\lastnode\relax\else
     \expandafter\expandafter\expandafter\setref{\lastnode}%
-      {Yappendixletterandtype}
+      {Yappendixletterandtype}%
     \global\let\lastnode=\relax
   \fi
 }
 
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+% 
+\def\anchor#1{\setref{#1}{Ynothing}}
+
+
 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
 % NAME-title, NAME-pg, and NAME-SNT.  Called from \foonoderef.  We have
 % to set \indexdummies so commands such as @code in a section title
@@ -4691,8 +4699,15 @@ width0pt\relax} \fi
     % into the usual \leavevmode...\vrule stuff for purposes of
     % printing. So we \turnoffactive for the \refx-snt, back on for the
     % printing, back off for the \refx-pg.
-    {\normalturnoffactive \refx{#1-snt}{}}%
-    \space [\printednodename],\space
+    {\normalturnoffactive
+     % Only output a following space if the -snt ref is nonempty; for
+     % @unnumbered and @anchor, it won't be.
+     \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+     \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+    }%
+    % `mynode, '
+    [\printednodename],\space
+    % `page 3'.
     \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
   \fi
 \endgroup}