texmacs-dev
[Top][All Lists]
Advanced

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

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


From: Corcelle
Subject: [Texmacs-dev] Re: [TeXmacs] Automatically create maths figures in drawing mode
Date: Wed, 20 May 2009 10:30:27 +0200 (CEST)

 
> 2. 
> I would like to add a menu to automatically create geometrical (or
> technical) figures in drawing mode. I read in the roadmap that the
> solution would be to create a style file. My first attempts are in
> scheme to permit the modification of the created figures but I can be
> wrong and perhaps it would be more interesting to use .ts files.
> If there is a better way to do it please let me know.
> 
Hello 

I continue the discussion on this list.
It is simple to insert figure in drawing mode using for example :
  ("Triangle ABC" (graphics-set-mode "cline") 
        (insert '(cline (point "0" "0") (point "5" "0") (point "2" "3")))
        (tree-insert! (tree-ref (cursor-tree) :up) 0 '("")) (graphics-set-mode 
"text-at") 
        (insert '(with "text-at-halign" "center" "text-at-valign" 
"center"(text-at (math "A") (point "2" "3.3"))))
        (tree-insert! (tree-ref (cursor-tree) :up) 0 '("")) (graphics-set-mode 
"text-at") 
        (insert '(with "text-at-halign" "center" "text-at-valign" 
"center"(text-at (math "B") (point "-0.3" "-0.1"))))
        (tree-insert! (tree-ref (cursor-tree) :up) 0 '("")) (graphics-set-mode 
"text-at") 
        (insert '(with "text-at-halign" "center" "text-at-valign" 
"center"(text-at (math "C") (point "5.3" "-0.1"))))
        (tree-insert! (tree-ref (cursor-tree) :up) 0 '("")))
For people frequently using the same figures it is time saving.
This kind of figure can be modified and completed as usual.

My purpose was to do the same thing attaching objects to others For example 
attaching the label "A" to the associated summit. Moving the summit (2;3.3) of 
the triangle would move the label "A" too.
I tried a lot of things with tree-ref, tree-set, and tree-"relatives" commands 
but I can't manage to do it.
Could you tell me if it is (or isn't) doable only with scheme ?

Thanks.

Emmanuël




reply via email to

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