mailing-list for TeXmacs Users

Text archives Help


[TeXmacs] More tricks


Chronological Thread 
  • From: Sam Liddicott <address@hidden>
  • To: address@hidden
  • Subject: [TeXmacs] More tricks
  • Date: Wed, 25 Apr 2012 09:44:03 +0100

I think I just learned that <compound|...> can take a macro or a macro name. That's pretty helpful.

I also finally got my brain around <quasi|...<unquote*|...>> which is pretty neat.

I also find the tools->update->styles also resolves forward declarations but much faster than document->update->all

For my literate programming I needed to be able to build up a list for each chunk, of other chunks that referenced it.
I was going to use indexes (well I do use them for the whole code index) but it would involve having so many indexes, plus to get the index contents I have to have a literal index tag in the document tree to be updated, and I don't yet have the skill to enforce node contents.

So I finally made good on a threat to make a storage-api out of labels. At the top of the document I can cache the aux-value of the label in a variable so it remains constant as the aux-value is re-built throughout the document.

So I have these three macros.



This will store any value in aux under name - but make sure name won't conflict with other labels.

<assign|nf-put|<macro|name|value|<with|the-label|<arg|value>|<label|<arg|name>>>>>



This will fetch any value from aux under name - or a later version of the value that has been updated at this point in the document.

<assign|nf-get|<macro|name|<get-binding|<arg|name>|0>>>



This macro should be used before nf-put or nf-get IF it could be the first point in the document that nf-put or nf-get is used on that name - probably everywhere nf-put or nf-get is used.
It will therefore cache the start-of-document value in a variable prefixed by old. Thus the final value as last stored in aux is available throughout the document.

<assign|nf-ping-old|<macro|name|<if|<not|<provides|<merge|old-|<arg|name>>>>|<assign|<merge|old-|<arg|name>>|<get-binding|<arg|name>|0>>>>>


With these means I can collect together references to a chunk, but still display all of them at the chunks definition.



Sam 


  • [TeXmacs] More tricks, Sam Liddicott, 04/25/2012

Archive powered by MHonArc 2.6.19.

Top of page