mailing-list for TeXmacs Users

Text archives Help


[TeXmacs] Redefining new-list


Chronological Thread 
  • From: Enrique Perez-Terron <address@hidden>
  • To: address@hidden
  • Subject: [TeXmacs] Redefining new-list
  • Date: Tue, 07 Oct 2008 05:35:53 +0200

I am trying to extend the new-list macro. However, when I try to use the
macros so created, TeXmacs says "unknown macro".

I want to modify new-list so that it creates additional environment
macros that do not reset the item counter.

The macro defined in packages/standard/std-list.ts uses the auxiliary
macros "list" and "list*" to reset the counter:

(Use a mail agent with fixed-width font and that don't break the lines.
I have indicated the code that resets the counter.)

<assign|list|<\macro|item-render|item-transform|body>

<\with|current-item|<arg|item-render>|transform-item|<arg|item-transform>|item-nr|0>
-----------------------------------------------------------------------------^^^^^^^^^^
<render-list|<arg|body>>
</with>
</macro>>

list* uses list:

<assign|list*|<\macro|item-render|item-transform|body>

<style-with|src-compact|none|<list|<arg|item-render>|<quasiquote|<macro|x|<unquote|<value|last-item>>.<compound|<unquote|<arg|item-transform>>|<arg|x>>>>|<arg|body>>>
---------------------------------^^^^^
</macro>>

Then my modified versions. I used copy and paste in Emacs, and deleted
the restting, and changed the macro names:

<assign|list-cont|<\macro|item-render|item-transform|body>
--------------^^^^^
<\with|current-item|<arg|item-render>|transform-item|<arg|item-transform>>
----------------------------------------------------------------------------^^
<render-list|<arg|body>>
</with>
</macro>>

<assign|list-cont*|<\macro|item-render|item-transform|body>
---------------^^^^^

<style-with|src-compact|none|<list-cont|<arg|item-render>|<quasiquote|<macro|x|<unquote|<value|last-item>>.<compound|<unquote|<arg|item-transform>>|<arg|x>>>>|<arg|body>>>
--------------------------------------^^^^^
</macro>>

The macro call <new-list|enumerate> creates new macros enumerate and
enumerate*. The modified new-list additionally creates enumerate-cont
and enumerate-cont*, using list-cont and list-cont* rather than list and
list*. I had to use "merge" to paste the "-cont" part of the name.



<assign|new-list|<macro|name|item-render|item-transform|<quasi|<style-with|src-compact|none|<assign|<arg|name>|<\macro|body>

<list|<unquote|<arg|item-render>>|<unquote|<arg|item-transform>>|<arg|body>>
</macro>><assign|<merge|<arg|name>|*>|<\macro|body>

<list*|<unquote|<arg|item-render>>|<unquote|<arg|item-transform>>|<arg|body>>
</macro>><assign|<merge|<arg|name>|-cont>|<\macro|body>
-------------------^^^^^^^^^^^^^^^^^^^^^^^^

<list-cont|<unquote|<arg|item-render>>|<unquote|<arg|item-transform>>|<arg|body>>
---------^^^^^
</macro>><assign|<merge|<arg|name>|-cont*>|<\macro|body>
-------------------------------------^^^^^

<list-cont*|<unquote|<arg|item-render>>|<unquote|<arg|item-transform>>|<arg|body>>
---------^^^^^
</macro>>>>>>


I have done this in a copy of the standard file, and I have placed it in
my .TeXmacs/packages under a different name. I have also copied
generic.ts and std.ts under new names, and edited the generic-modified
to point to std-modified instead of std, and std-modified points to
std-list-modified. In a document I select
Document->Style->generic-modified - it appears in the menu as promised.

However, I cannot use the macros, and if I doctor the file in emacs and
reopen it in texmacs, the macro call shows with red name.

The file essentially looks like this:

<TeXmacs|1.0.6.15>

<style|quique>

<\body>
<\enumerate>
<item>First point

<item>Second point.
</enumerate>

Some non-enumerated text before we continue with a third point

<\enumerate-cont>
<item>This is the third point.
</enumerate-cont>

\;
</body>

<\initial>
<\collection>
<associate|preamble|true>
</collection>
</initial>

What can I do?




Archive powered by MHonArc 2.6.19.

Top of page