Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding space between texts in RTF?

4,361 views
Skip to first unread message

liu

unread,
Apr 20, 2009, 2:22:27 PM4/20/09
to
The application I use can import RTF text and generate questions.

The text is like below:

"Question 1","True/False","{\rtf1\ansi\ansicpg1252\deff0\deflang1033
{\fonttbl{\f0\froman\fprq2\fcharset0 Arial;}}\viewkind4\uc1\pard
\f0\fs32 Is this true?\f1\par}",2,1,"{\rtf1\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
Arial;}}\viewkind4\uc1\pard\f0\fs32 True\f1\par}","","{\rtf1\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
Arial;}}\viewkind4\uc1\pard\f0\fs32 False\f1\par}",""

"Question 2","True/False","{\rtf1\ansi\ansicpg1252\deff0\deflang1033
{\fonttbl{\f0\froman\fprq2\fcharset0 Arial;}}\viewkind4\uc1\pard
\f0\fs32 Is this true?\f1\par}",2,1,"{\rtf1\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
Arial;}}\viewkind4\uc1\pard\f0\fs32 True\f1\par}","","{\rtf1\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
Arial;}}\viewkind4\uc1\pard\f0\fs32 False\f1\par}",""

Between question 1 and 2, there is not too much space. Is there a RTF
Control Word that I can add to increase the space between 2 questions?
The only way I can find is to add \line or \par the text block would
have an extra blank line. That kind of increase the space between the
2.

Thanks for the help!

Robin Fairbairns

unread,
Apr 20, 2009, 3:40:15 PM4/20/09
to
liu <spamf...@yahoo.com> writes:
>The application I use can import RTF text and generate questions.

since you choose not to tell us what application that is, what hope
have we of answering the question?
--
Robin Fairbairns, Cambridge

T3X

unread,
Apr 20, 2009, 6:26:01 PM4/20/09
to
On Apr 20, 7:22 pm, liu <spamfree...@yahoo.com> wrote:
> Between question 1 and 2, there is not too much space. Is there a RTF
> Control Word that I can add to increase the space between 2 questions?

I assume you ask how to edit an RTF code, right?

If you are happy with an extra blank line just stick \par between the
two. If not, ADVANCE field might be of interest. Google for RTF
specification and check how to embed fields (or reverse engineer that
from MS Word generated rtf).

Cheers,

Tomek

Wilfried

unread,
Apr 21, 2009, 3:41:46 AM4/21/09
to
liu <spamf...@yahoo.com> wrote:

First of all, ou can download the rtf language specifications issued by
Microsoft from the latex2rtf homepage
http://latex2rtf.sourceforge.net/
It's your choice which rtf level you need.

Regarding your question:
You can add free space before a paragraph by adding the control word
\sbN
after the \pard control word.

Similarly, space after the paragraph is set by
\saN

N is an integer number indicating the amount of space.
If you want one line (12pt) space, use N=240.
A half line space (6pt) is 120.

HTH, Wilfried
--
Wilfried Hennings
please reply in the newsgroup, the e-mail address is invalid

liu

unread,
Apr 21, 2009, 8:37:30 AM4/21/09
to
On Apr 20, 3:40 pm, r...@cl.cam.ac.uk (Robin Fairbairns) wrote:
> since you choose not to tell us what application that is, what hope
> have we of answering the question?

custom program used in-house.

liu

unread,
Apr 21, 2009, 8:47:29 AM4/21/09
to
On Apr 21, 3:41 am, Wilfried <inva...@invalid.invalid> wrote:
>
> First of all, ou can download the rtf language specifications issued by
> Microsoft from the latex2rtf homepagehttp://latex2rtf.sourceforge.net/

> It's your choice which rtf level you need.
>
> Regarding your question:
> You can add free space before a paragraph by adding the control word
> \sbN
> after the \pard control word.
...

Thanks for the help. This works when the text is in one block of
multiple paragraphs, but does not affect different blocks (? not sure
about the right term). For example, I would like add space between


"{\rtf1\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
Arial;}}\viewkind4\uc1\pard\f0\fs32 True\f1\par}"

and


"{\rtf1\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
Arial;}}\viewkind4\uc1\pard\f0\fs32 False\f1\par}"

On the screen, you can see only True and False and each one is a
individual text object.

Thanks again for the help.

liu

unread,
Apr 21, 2009, 9:09:52 AM4/21/09
to
On Apr 20, 6:26 pm, T3X <t34...@googlemail.com> wrote:
> two. If not, ADVANCE field might be of interest. Google for RTF
> specification and check how to embed fields (or reverse engineer that
> from MS Word generated rtf).
>
> Cheers,
>
> Tomek
Thanks for the help, can you elaborate more? All I can find is:
<formulas> ('=' <formula>) | 'ADVANCE' | 'EQ' | 'SYMBOL'

T3X

unread,
Apr 21, 2009, 11:25:49 AM4/21/09
to
On Apr 21, 2:09 pm, liu <spamfree...@yahoo.com> wrote:
> Thanks for the help, can you elaborate more? All I can find is:
> <formulas>        ('=' <formula>) | 'ADVANCE' | 'EQ' | 'SYMBOL'

I don't know much about RTF format. I sometimes use ADVANCE field in
Word to fine tune text position, hence the idea. I've made once the
LaTeX logo in Word this way. Below is cleaned RTF version of it, that
you can open in Word and see what I mean.

Cheers,

Tomek

============LaTeX-logo.rtf===========
{\rtf1\ansi
{\fs24 L}{\field{\*\fldinst {ADVANCE \\u 2 \\l 4}}}
{\fs18 A}{\field{\*\fldinst {ADVANCE \\d 2 \\l 2}}}
{\fs24 T}{\field{\*\fldinst {ADVANCE \\d 3 \\l 1}}}
{\fs24 E}{\field{\*\fldinst {ADVANCE \\u 3 \\l 1}}}
{\fs24 X}{\fs24 logo in Word}
}

Luis Rivera

unread,
Apr 21, 2009, 2:23:44 PM4/21/09
to

liu ha escrito:


> On Apr 21, 3:41 am, Wilfried <inva...@invalid.invalid> wrote:
> >
> > First of all, ou can download the rtf language specifications issued by
> > Microsoft from the latex2rtf homepagehttp://latex2rtf.sourceforge.net/
> > It's your choice which rtf level you need.
> >
> > Regarding your question:
> > You can add free space before a paragraph by adding the control word
> > \sbN
> > after the \pard control word.
> ...
>
> Thanks for the help. This works when the text is in one block of
> multiple paragraphs, but does not affect different blocks (? not sure
> about the right term). For example, I would like add space between
> "{\rtf1\ansi
> \ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
> Arial;}}\viewkind4\uc1\pard\f0\fs32 True\f1\par}"
> and
> "{\rtf1\ansi
> \ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0
> Arial;}}\viewkind4\uc1\pard\f0\fs32 False\f1\par}"
>

Besides the fact that you don't specify the RTF version specification,
your original source code seems to be a database mix of comma
separated values and RTF code interspersed; your homebrewed software
seems to arrange all the fields to do something (the questionnaire),
including formatting the text of the question in RTF. If this is the
case, there is no way to control the space between the fields of the
comma separated database fields, since the main program takes care of
that. Sorry.

In any event, your question is OT in a (La)TeX group.

Good luck,

Luis.

0 new messages