mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] More on TeXmacs Footnote behaviour


Chronological Thread 
  • From: Sam Liddicott <address@hidden>
  • To: Miguel de Benito Delgado <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] More on TeXmacs Footnote behaviour
  • Date: Mon, 21 Jan 2013 09:20:39 +0000

It looks like I need to do something to the function edit_typeset_rep::typeset_preamble in the file ./src/src/Edit/Editor/edit_typeset.cpp to make it execute a macro called after-preamble.

To answer Miguel's question about the initial environment, I see that in the same files we have these interesting looking functions:
edit_typeset_rep::defined_at_init (string var) 
edit_typeset_rep::defined_in_init (string var)
edit_typeset_rep::get_init_value (string var)
...
edit_typeset_rep::get_init_string






On Mon, Jan 21, 2013 at 2:43 AM, Sam Liddicott <address@hidden> wrote:
I dug out my closure code and split it off from the work it was part of and it works to solve the footnote problem.

In the attached document, the pre-amble line:
<quasi|<assign|render-footnote|<macro|nr|body|<with|render-footnote|<unquote|<value|render-footnote>>|<with-default-style|<render-footnote|<arg|nr>|<arg|body>>>>>>>

exists only to force render-footnote to use the new with-default-style macro. If this fix is adopted then all render-footnote macros would be re-written to use with-default-style and so it would not be needed in the pre-amble.

Also in the pre-amble, the definition for with-default-style should not need to be there but by automatically executed texmacs at the end of the preamble either by magic or as part of a deferred execution stylesheet macro system.

The stylesheet enclose.ts is defined using an experimental literate programming style for TeXmacs which is designed to be fully readable without view-source mode. It does this with a show-active macro it defines, which allows a macro to be defined and rendered visible at the same time, using rewrite-inactive. This is so that the stylesheet can be proper documentation (like latex packages) instead of just heavily commented stylesheet.

Interestingly I had to re-define render-footnote using quasi; adding it to the with-default-style closure and defining it like this caused a crash (I guess infinite recursion) 
<assign|render-footnote|<macro|nr|body|<with-default-style|<render-footnote|<arg|nr>|<arg|body>>>>>
I tried deferring evaluation if the inner render-footnote so it would take the enclosed value by means of compound, and quote, but it always crashed.

I also say in closing that taking the top few scheme tutorials about 5 times each has improved my understanding of quasi, unquote* and all that stuff.


On Fri, Jan 18, 2013 at 3:32 PM, Miguel de Benito Delgado <address@hidden> wrote:

On 18/01/2013, at 16:21, Sam Liddicott wrote:

with-default-style should be a closure of the font environments as they existed at the end of the pre-amble.

This looks perfect to me. 

Also there should be a way somewhere to access the initial environment. It can be set with the macro <initial|>, but retrieved how?
--
Miguel.







Archive powered by MHonArc 2.6.19.

Top of page