mailing-list for TeXmacs Users

Text archives Help


Re: Difficult macro parameters - removing the implicit document tag


Chronological Thread 
  • From: Sam Liddicott <address@hidden>
  • To: TeXmacs user list <address@hidden>
  • Subject: Re: Difficult macro parameters - removing the implicit document tag
  • Date: Mon, 12 Feb 2024 16:56:07 +0000

It's incredible the number of hours I spent over the last week because of the difficulty in getting texmacs to remove the default document tag from a macro definition/invocation.

I can trick it into not happening with: \compound ENTER do-something TAB
and then enter arguments with TAB for each one, then I get all on one line:
<do-something|<arg|x>>

But if I type: \do-something ENTER 
and then enter arguments, I get:
<\do-something>
  <arg|x>
</do-something>

which wraps my argument in an implicit document tag

That makes me very sad.

But I learned so much interesting stuff that should never need to be learned doing this :-)

Sam

On Mon, 12 Feb 2024 at 15:03, Sam Liddicott <address@hidden> wrote:
TL;DR: I'm trying to work out how get rid of the implicit document tag if I press ENTER to insert a newline into a macro argument

This sample macro x can be used for the demo:

    <assign|x|<\macro|a|b|c>
      <arg|a> <arg|b><arg|c>
    </macro>>

If I invoke it like this:

  <x|aa|bb|cc>

I get the expected rendering: 
aa bbcc

If I insert a new-line between the two a's, the source will invoke it like this:

  <\x>
    a

    a
  </x|bb|cc>

And I get (as expected, due to implicit concatenation of document blocks):
a bbcc
a

If I delete the new-line separating the a's my source is:

  <\x>
    aa
  </x|bb|cc>

Although it renders as:
aa bbcc
this is NOT the same as before the newline:   <x|aa|bb|cc>

The difference is that the first argument now has label "document" but before it had label "string" (or as it may have been in real life, "concatenation" or "with" etc)

From within the editor, how do I get rid of the implicit document tag and reduce back to string?

Sam



Archive powered by MHonArc 2.6.24.

Top of page