mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] texmacs databases ?


Chronological Thread 
  • From: Julien Frontisi <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] texmacs databases ?
  • Date: Wed, 30 May 2012 18:45:50 +0200

Thanks a lot for your quick answers.
It's going to take me a while to fully understand Sam's templates  but I'll try hard.
In any case, it seems to be what I need.
Julien
 
Le 30 mai 2012 à 09:44, Sam Liddicott a écrit :


On Wed, May 30, 2012 at 4:56 AM, Aleksandr Dobkin <address@hidden> wrote:
I think there are several approaches.

1) You can put each problem in it's own TeXmacs file and include the ones you want in the master document using Insert > Link > Include... .

2) If you want to define all the problems in the same document you can do so in the preamble. If you put an assign tag in the preamble, e.g. <assign|p1|My Problem Text>, you can include in the main document as <p1>.


I do it rather like (2) but not in the pre-amble. I had to produce some documents which showed step-by-step how to configure some systems, and most of the steps were the same but took different parameters so I developed a nice way of parameterising paragaphs. See attached zip file.

There is a file: templates.ts which allows one to use:
<save-chunk|chunk-name|...>

In the document one can use <placeholder|name|default-value>.

The first time placeholder is used for a name, it defines the name to the provided default-value, otherwise it uses the defined value (which can be overridden <with|name|new-value> or <assign|name|new-value>

This way I can define blocks of document and then re-use them inside a <with|...> block to change the rendering.

So I write a document using the template.ts which makes all my definitions. I can save this document as a .ts file instead of a .tm file. I do not use the "source" style sheet.

I then use this .ts file AND the templates.ts for my new document. Then I can invoke all the pre-defined chunks as I like (with parameterisations) my document.

So in the zip file, templates-test.ts is the database.

However it is a couple of years since I wrote it and I will re-write it soon, but it is very servicable. I have trouble rememberering how to make the templateised graphics work, but you must specify the width and height explicitly!

Sam


 

Numbering you get for free by inserting Question environments, for example, using Insert > Enunciation > Question.

Alex


On Tue, May 29, 2012 at 1:02 PM, Julien Frontisi <address@hidden> wrote:
Hi,
does anyone know if there is a simple way to create exercise databases with texmacs with the possibility
to select and extract some exercises out of the lot and then automatically create a document with the chosen exercises ?
Hope that's clear.
More generally, select some items out of a collection and create a new document listing the selected items. (Besides manually copy/pasting each, of course...)
(Re-)numbering of the items would be great.
Thanks
Julien
ps : sorry for double-posting this on the texmacs-edu list and here, I'm not sure if that one is working yet (no archive available).


<templates.zip>




Archive powered by MHonArc 2.6.19.

Top of page