Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!bloom-beacon!mit-eddie!killer!pollux!lll From: lll@pollux.UUCP (Laurence Leff) Newsgroups: comp.text Subject: troff macro problem Keywords: diversion thesis list of figures Message-ID: <13138@pollux.UUCP> Date: 17 Nov 88 05:34:11 GMT Organization: Department of Electrical Engineering; S.M.U.; Dallas, TX Lines: 73 I am having trouble making the correct page number appear on a list of figures, when the figure caption appears inside the ms macros KS-KE pair of KF KE pair. I have made the necessary additions and modifications to the ms macros to print out stuff for thesis. ONe of the theings I would like to do would be to output the table of figures and table of tables. This is done by the use of diversinos, each time a figure caption is generated, an addition is made containing the figure number, the title of the figure and lastly the page number on which the figure appears. Most of the time, this figure caption macro is called inside a KS, KE or KF KE pair. Unfortunately, the page number that appears is the one where the macro was called and not the one that it appeared on. If there wasn't enough space for the KS KE to print on the same page, then the page number is off by one. I have reproduced the problem using the KS, KE macros given in the nroff/troff tutorial. The last line should indicate that the figure appeared on page two. ON the line in FG, after the comment (tm help), I Have tried various counts of backslashes both before the n and before the t to no avail. .de hd .tl "-%- .. .wh 0 hd .de LP .sp 1 .. .de FG 'ev 2 'br 'da XZ .\" 'tm help \\$1 page: \\n% 'da 'ev .. .de KS .br .ev 1 .fi .di XX .. .de KE .br .di .ne \\n(.t .\" .if \\n(dn>=\\n(.t .bp .nf .XX .ev .. test1 .sp 1i .KS .FG "Figure 1" .sp 10i Figure 1 .KE .sp 1i test 2 .bp .tl "this is XZ:" .ev 2 .XZ