Thread View: comp.text
5 messages
5 total messages
Started by gozdz,antoni s
Sat, 23 Jan 1993 21:43
extended \*(xx sequence for .RS/.RF; is it possible?
Author: gozdz,antoni s
Date: Sat, 23 Jan 1993 21:43
Date: Sat, 23 Jan 1993 21:43
23 lines
1250 bytes
1250 bytes
I use extensively automatic reference processing in troff/Eroff. However, the standard implementation allows one to use only a two-character string to name the reference (I think that's the way troff was set up to recognize the \*( sequence, right?). It's OK when there are 10-20 references in your document, but the method becomes inefficient when I have to handle 50-100 at a time, with multiple occurences of the same reference (search for the name, go back, etc.). I'd like to use longer, more descriptive strings, e.g., \*(weber91a, whose length could be either constant (at least 6 characters) or length. Is it possible? Another, related question: is there an internal limit in troff to the number of references a single document may have (like the number or registers etc.)? Tony Gozdz tony2@cc.bellcore.com
Re: extended \*(xx sequence for .RS/.RF; is it possible?
Author: Chris Lewis
Date: Sun, 24 Jan 1993 16:10
Date: Sun, 24 Jan 1993 16:10
29 lines
1886 bytes
1886 bytes
In article <1993Jan23.214359.29186@porthos.cc.bellcore.com> tony2@prefect.cc.bellcore.com (gozdz,antoni s) writes: |I use extensively automatic reference processing |in troff/Eroff. However, the standard implementation |allows one to use only a two-character string to name the |reference (I think that's the way troff was set up to |recognize the \*( sequence, right?). |I'd like to use longer, more descriptive strings, |e.g., \*(weber91a, whose length could be either |constant (at least 6 characters) or length. |Another, related question: is there an internal limit |in troff to the number of references a single document |may have (like the number or registers etc.)? Most versions of troff (probably including eroff) only support 2 character string names, so you're basically out of luck using the .RS/.RF mechanism. However, you can use "refer", which essentially bypasses all these limits, and allows you to say something like [weber91] in your document. "refer" is a standard part of DWB, don't know about eroff. If you don't have refer, you could probably pick up "grefer", which is a part of groff. While you need C++ to compile groff, you may be able to obtain a pre-compiled binary of grefer for your system. -- Chris Lewis; clewis@ferret.ocunix.on.ca; Phone: Canada 613 832-0541 Psroff 3.0 info: psroff-request@ferret.ocunix.on.ca Ferret list: ferret-request@ferret.ocunix.on.ca
Re: extended \*(xx sequence for .RS/.RF; is it possible?
Author: Nils-Peter Nelson
Date: Mon, 25 Jan 1993 21:29
Date: Mon, 25 Jan 1993 21:29
16 lines
1232 bytes
1232 bytes
Correspondent would like "long register names." Sorry, but the "twoness" of troff is pervasive. There are 96 printing characters (not all of which can appear in string names; eg I would't try backslash) and you can use one or two char names, so 96*96+96 appears to be the limit. The way most people solve this is to append to a diversinon with your own personal "magic cookie" and then use a companion awk program. For example: ***REF1 <contents of reference 1> Of course, this means you need 2 passes, but you always need two passes due to the potential for forward referencing. You then insert your simple awk program between the 2 passes.
Re: extended \*(xx sequence for .RS/.RF; is it possible?
Author: gozdz,antoni s
Date: Tue, 26 Jan 1993 00:45
Date: Tue, 26 Jan 1993 00:45
33 lines
1819 bytes
1819 bytes
In article <24703@alice.att.com> npn@alice.att.com (Nils-Peter Nelson) writes: > > >Correspondent would like "long register names." >Sorry, but the "twoness" of troff is pervasive. >There are 96 printing characters (not all of which >can appear in string names; eg I would't try backslash) >and you can use one or two char names, so 96*96+96 >appears to be the limit. >The way most people solve this is to append to >a diversinon with your own personal "magic cookie" >and then use a companion awk program. >For example: ***REF1 <contents of reference 1> >Of course, this means you need 2 passes, but you >always need two passes due to the potential for >forward referencing. You then insert your simple >awk program between the 2 passes. I did not complain that the number of combinations that could be used in the .RS/.RF pairs is too small; these two-character strings are just difficult to remember when needed again for re-referencing. The solution offered might do the job, but obviously, it's not as painless as it might/should be. A related question: what other structures in troff use the \*( prefix? If it's only the \*(Rf/.RS/.RF construct, would it be difficult to assign variable-length strings to it? (just a wild guess; I'm not a programmer). Tony tony2@cc.bellcore.com
Re: extended \*(xx sequence for .RS/.RF; is it possible?
Author: Nils-Peter Nelson
Date: Wed, 27 Jan 1993 19:17
Date: Wed, 27 Jan 1993 19:17
23 lines
1514 bytes
1514 bytes
Tony Gozdz asks: A related question: what other structures in troff use the \*( prefix? If it's only the \*(Rf/.RS/.RF construct, would it be difficult to assign variable-length strings to it? (just a wild guess; I'm not a programmer). == \*( means gobble up exactly the next two characters and treat it as the name of a string. Strings may be used by any of the macros: footnotes, references, table of contents, headers, footers, etc. \*x, where x is *not* ( means gobble up exactly 1 char. If string names could be more than 2 chars, about a million troff documents would stop working, because folks expect \(abcd to produce "string ab"cd, not "string abcd". The syntax was a poor choice, but it is so embedded in the culture it can't be changed. More modern "languages" use start and end delimiters, rather than fixed length tokens, although this does lead to verbosity (as in \stringname abcd \endstringname).
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads