[texhax] Displaying the \current value of \prevgraf in the log file

Philip TAYLOR P.Taylor at Rhul.Ac.Uk
Sun Nov 13 16:44:19 CET 2011


Access to \prevgraf is fairly restricted, and simple
access is possible only at the end of a paragraph
and at the start of a displayed equation.  Way back
in 1990, DEK disabled the possibility to \write \prevgraf
as it was causing major problems :

> "391. Disable \write{\the\prevgraf} (B. Jackowski, July 1990)."

I am now attempting to gain some insights into the current
value of \prevgraf through a \vadjust injection, and
looking into TeX.web I can find the following code :

> 219. < Show the auxiliary 
field, a 219 > =
 > case abs (m) div (max_command + 1) of
> 0: begin print_nl ("prevdepth ");
> if a:sc <= ignore_depth then print ("ignored")
> else print_scaled (a:sc);
> if nest [p]:pg_fi
eld <> 0 then
> begin print (", prevgraf "); print_int (nest [p]:pg _field ); print (" line");
> if nest [p]:pg _field <> 1 then print_char ("s");
> end;
> end;

(the weird characters are caused by copying from Acrobat).

This code is called from :

> show_box (link (nest [p]:head_fi
eld )); < Show the auxiliary fi
eld, a 219 >;

in :

> 218. Here is a procedure that displays what TEX is working on, at all levels.
> procedure print_totals ; forward ;
> procedure show_activities ;

which is itself called from :

> 1293. < Declare action procedures for use by main control 1043 >  +=
> procedure show_whatever ;
> label common_ending ;
> var p: pointer ; { tail of a token list to show }
 > begin case cur_chr of
> show_lists : begin begin_diagnostic; show_activities ;

that can be invoked by \showlists.

/However/, the output from \showlists does /not/ (at least,
when invoked by \vadjust injection) display \prevgraf, nor
in fact make any mention of \prevgraf at all in the output.

What am I missing, please ?

Philip Taylor


More information about the texhax mailing list