Skip to Content.
Sympa Menu

texmacs-users - Re: New environments and paragraphs length

Subject: mailing-list for TeXmacs Users

List archive

Re: New environments and paragraphs length


Chronological Thread 
  • From: Joris van der Hoeven <address@hidden>
  • To: Philippe Audebaud <address@hidden>
  • Cc: address@hidden
  • Subject: Re: New environments and paragraphs length
  • Date: Sat, 26 Oct 2002 11:30:22 +0200 (MET DST)


> While trying to define new theorems, actually new environments which
> are
> passed an argument plus the body, I failed to get the text
> respecting
> paragraph length anymore. See the visual result at the bottom of this mail.
> How can I solve that problem?
>
> The experience is made of the macros file (m.ts) and example file (g.tm)
> both
> attached to this mail.

Block text (i.e. multiple paragraph text) and tabular text inside
macros is a little bit tricky. Since TeXmacs does not yet support
"meta-information about DTD's" (it will, it will), the fact that
a macro contains block text or tabular text should be detectable
automatically from the macro body, both when defining *and*
when expanding the macro. Even when the body consists of a single
paragraph, you should make TeXmacs believe that the body is a
(potentially multiparagraph) block with a single paragraph.

Using scheme notation, the string

"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"

is typically normal text, while

(document
"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")

would be block text (one paragraph).
Macro expansions or with modified blocks remain blocks.
For instance,

(theorem
(document
"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"))

is again a block. If you want to *concatenate* block text with
normal text, then you should use the "surround" primitive:
this primitive surrounds block text on the left and the right
with normal text.

Returning to your example, the fact that you concatenated
the normal text (<arg|x>) with the block text <arg|y>
(in the body of the block macro application of "testref")
*without* using the surround primitive will make TeXmacs
think that the whole is normal text and *not* block text
(which is necessary if you want the lines to be wrapped).

You therefore should have used the "surround" primitive here.
In normal TeXmacs notation, the correct macro definition
would have been:

<assign|test|<macro|x|y|<\testref>
<surround|(<arg|x>)||<arg|y>>
</testref>>>

All this will be simplified in the future, but this depends on several
complex changes which we plan to make in the forthcoming year.
In any case, the recognition of block text can not be fully automized,
so the user will always need to specify this information somewhere
(in the macro definition, application, or in a file with "meta-information
about the DTD").

Best wishes, Joris




Archive powered by MHonArc 2.6.19.

Top of Page