deutsch@jplcwp.UUCP (04/18/87)
I have an urgent yet probably a minor problem to resolve. It deals with diversions under nroff/troff. The register "dn" as I know gives the number of lines since last diversion, however in my case it comes up with a number of 320 for nroff and 400 for troff, instead of 9 as the following example shows. Follows the input text: -------------------input text------------------------ .sp 4 .nf .ll 30 .po 3 .de TM .ti +19 Copyright Courseware Technologies Inc., 1986 .. .de MP .wh -26 PM .. .de PM .sp 1 .. .de SE .sp 10 .. .de ED \l'2.0i' .. .de MP .wh -26 PM .. .de PM .sp 1 .. .de EP .wh -2 PE .. .nr SP 0 .nr S1 0 .nr S2 0 .de KS .br .ev 1 .nr dn 0 .nf .di XX .. .de KE .br .di .nr SP 18-\\n(dn .nr S1 \\n(SP/2 .nr S2 (\\n(SP-\\n(S1) .if \\n(dn>=\\(.t .bp #.sp \\n(SP #.sp \\n(S1 .XX #.sp \\n(S2 #.sp \\n(dn .ev .. .de PE .tl : Copyright Courseware Technologies Inc. 1987, Page 1 - %: .bp .. .EP .MP System Administrator 2-0 .TS box expand; c a. TOPICS TO LEARN _ .KS 1 - The Hierarchical File System 2 - UNIX File Types 3 - File Ownership 4 - File Protection and How To Change it .KE .TE System Administrator 2-1.1 .TS box expand; c a. HIERARCHICAL FILE SYSTEM _ \(bx The UNIX file system is a uniform set of directories and files arranged in a tree-like, hierarchical structure. \(bx The files are grouped into directories and the directories organized into a hierarchy. \(bx The top of the hierarchy is a special directory called root , with a pathname of / . \(*x A pathname is the complete name of a directory or a file. \(*x A pathname traces the path through the file system to the desired file. .TE ------------------------------- follows the output ------------------- System Administrator 2-0 8 _________________________________________________ TOPICS TO LEARN 8 _________________________________________________ #.sp -302 #.sp -151 1 - The Hierarchical File System 2 - UNIX File Types 3 - File Ownership 4 - File Protection and How To Change it #.sp -151 #.sp 320 8 _________________________________________________ -------------------------------------------------------- What should I do go get the right number for the register "dn", or how would I center "vertically" (not with .ce) text on a page of a limited length, e.g. On a page of .pl 40, a text of 25 lines, i.e. what macros should I use to get 7/8 blanks in front of the text and 7/8 lines after. Your time and help are greatly appreciated. Thanks in advance. Michael Deutsch
richl@penguin.UUCP (04/19/87)
In article <187@jplcwp.UUCP> deutsch@jplcwp.UUCP (Michael Deutsch) writes: > The register "dn" as I know gives the number > of lines since last diversion, however in my > case it comes up with a number of 320 for nroff > and 400 for troff, instead of 9 as the following > example shows. The documentation says that "dn" is only valid AFTER a diversion; I'm not sure if that's what you mean. (It may be valid during, but I'm not sure if you can count on it.) But one thing I *am* sure about is its units are the "basic units", not the number of lines. That is, in troff, your lines are 400 units high, and in nroff they are 320. I haven't tried, but you can probably get number of lines by dividing dn by .v. Rick