texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Re: [TeXmacs] Automatically create maths figures in dr


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] Re: [TeXmacs] Automatically create maths figures in drawing mode
Date: Wed, 17 Jun 2009 03:42:36 +0200
User-agent: Mutt/1.5.9i

On Tue, Jun 16, 2009 at 11:13:12PM +0200, Corcelle wrote:
> Hello,
> 
> For the moment, I didn't succeed in "attaching" objects to others and I think 
> I still have a long way to go...
> 
> So I started with something in between. I wrote procedures to automatically 
> create objects :
> 1- Some entries give a complete figure :
>   ("Rectangle" (graphics-set-mode "cline") 
>       (make-fig-polygon-lab '(0 4 4+2i +2i) '("D" "C" "B" "A") '("" "" "L" 
> "l"))   ;; polygon with n complex summits 
>       (make-fig-mark-right 4 0 +2i 0.3)   ;; angle (4 0 +2i) of size 0.3
>       (make-fig-mark-seg 0 4 "double" 0.2 +i)   ;; double mark on segment (0 
> 4) of size 0.2 and angle argument(+i)
>       (make-fig-mark-seg +2i 4+2i "double" 0.2 +i))

Yes, this is a good way to proceed. If you do things in a clean way,
you may later replace your make- commands by macro constructors.

> 2- Others give an interactive access to the different objects, the scheme 
> command is given in the footer and can be modified afterwards (I chose to use 
> complex numbers for an easier use) :
>   ("Polygone"
>       ((tm-property (footer-eval cmd)
>               (:argument cmd "Command ->")
>               (:proposals cmd '("(make-fig-polygon-lab '(0 4 3+2i +2i) 
> '(\"A\" \"B\" \"C\" \"D\") '(\"d\" \"c\" \"a\" \"b\"))" 
>                                 "Help : '(Affixes des points) '(Labels des 
> points) '(Labels des cotes)")))
>        (interactive footer-eval)))

I don't think that the user wants to give scheme commands at the footer, in 
general.
But if you just insert your figure, then you should be able to change the labels
(for instance) manually anyway.

> I have two little question about this :
> 1- All my procedures are called "fig-something" to clearly distinguish them 
> from TeXmacs ones. Is it necessary to do that or not ?

It is not necessary, but generally a good practice in Scheme.

> 2- The interactive insertion of figure works really well but it seems a 
> little tricky. Is it a problem and if it is could you give me an other way to 
> do that in a proper way ?

I don't understand your question very well.

Yours, Joris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]