views:

138

answers:

2

I'm interested how to construct certain kinds of layout in RTF documents, ideally using techniques that do not depend only on the most recent RTF standards, and that are "native", i.e., they do not involve embedding other representations, like picture files. In particular:

  1. In Postscript and DVI, I can specify a coordinate at any time that the next text will be printed at: can this be done with RTF?
  2. Can RTF compose characters through overstriking?
  3. Can lines, outline boxes and filled boxes be drawn, with their geometry specified either absolutely, or relative to text?
A: 
  1. I don't believe this is possible. You'd need to use tabs and newlines to get the text where you want it.
  2. Not really, unless \strike and \strikedl count.
  3. http://www.biblioscape.com/rtf15_spec.htm#Heading52 says drawing objects are an option, and so is inserting images, but neither are really "native", both being absent in the first RTF specs. (And the latter is a bad choice for i.e. just a line.)
nooodl
+2  A: 
  1. You can use the \pvpg \phpg \posx123 \posy123 construct after you start a paragraph with \pard to position it relative to the top left of the page. See: http://biblioscape.com/rtf15_spec.htm#Heading39

  2. Sorry, I don't understand what you mean.

  3. Yes, but it's rather involved, and I think it was only introduced in RTF 1.5. See the drawing objects section of the spec. Here is a basic example of drawing a box (I'm not sure it's entirely valid but it should give you an idea of how to work with drawing objects):

    {\rtf1\ansi\deff0 {\pard {\*\do \dobxcolumn \dobypara \dprect \dpx0 \dpy0 \dpxsize1000 \dpysize1000 \dplinew25 }\par} }

If you're doing any work with RTF it's worth picking up O'Reilly's RTF Pocket Guide.

Richard M
2. According to the RTF Pocket Guide book overstriking isn't possible.
Richard M
Charles Stewart