texmacs-dev
[Top][All Lists]

## Re: [Texmacs-dev] Solution environment

 From: Miguel de Benito Delgado Subject: Re: [Texmacs-dev] Solution environment Date: Fri, 24 Dec 2010 10:59:05 +0100

I agree this would be nice and it ought not to be too hard to achieve, at least for your own personal documents: to the file src/TeXmacs/progs/text/text-menu.scm you can add the line

("Solution" (make 'solution))

(a good place might be after the exercise and problem environments). Then all you have to do is add something like the following to your style file:

<assign|solution-text|<macro|<localize|Solution>>>

<assign|render-solution|<\macro|which|body>

<\render-remark|<arg|which>>

<\surround||<htab|0.5fn><active*|<with|mode|math|\<box\>>>>

<arg|body>

</surround>

</render-remark>

</macro>>

<assign|solution|<\macro|body>

<render-solution|<solution-text>|<arg|body>>

</macro>>

I tried adding this to packages/environment/env-theorem.ts but it wasn't enough, maybe someone can shed some light here? Adding the macros to the preamble of the document (hide it with <hide-preamble>) did of course work as expected (i.e. when clicking on the "solution" item inside the menu, I got a new Solution environment).

The problem with adding the environment to the TeXmacs source could be that there are already many styles that don't implement it, as well as latex conversion to be done and lots of translations, all of which adds up to some 40 files. Of course all this can always be done if the others agree.

Regards,
________________
Miguel de  Benito.

On Fri, Dec 24, 2010 at 06:12, Zou Hu wrote:
Hi all,
Currently in TeXmacs there are "theorem" and "proof" environments; and also there is a "problem" environment, but I can not find a "solution" environment. I think it would be better to add a "solution" environment to texmacs.
Best.

_______________________________________________
Texmacs-dev mailing list