Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] graphics mode questions

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] graphics mode questions


Chronological Thread 
  • From: Henri Lesourd <address@hidden>
  • To: Felix Breuer <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] graphics mode questions
  • Date: Tue, 16 May 2006 17:29:29 +0200

Felix Breuer wrote:

Hello everyone,

I have two questions regarding the graphics mode.

1) Scrolling

I always scroll through my documents pressing the up and down keys. This
is impossible when I have a graphics object in my document as TeXmacs
enters the graphics mode as soon as the cursor reaches the object and
then the drawing is scrolled instead of the page. Is there some way to
reconfigure this, so I can keep using my keys?


You could disable scrolling the graphics
by means of :
<<
(kbd-map
(:mode in-active-graphics?)
("left" (noop))
("right" (noop))
("down" (noop))
("up" (noop))
)
>>

But as far as scrolling the page pressing up & down, the
page movement in text is related to the fact that the cursor
is moving : when the cursor reaches the border of the screen,
a scroll occurs. Things don't work the same in graphics,
where the cursor stops moving when it reaches the border.

What you can do is move the cursor out of the graphics,
and then scroll. Something like that (the code below
could be buggy, but gives the overall idea) :
<<
(define (tm-traverse-tree-up p func)
(set! p (tm-adjust-path p))
(if (func (path->tree p))
p
(if (> (length p) 2)
(tm-traverse-tree-up (reverse (cdr (reverse p))) func)
#f)))

(define (tm-upper-path p tags)
(tm-traverse-tree-up p (lambda (t) (in? (tree-label t) tags))))

(define (go-outside-of-the-graphics)
(with p (tm-upper-path (cDr (cursor-path)) '(graphics))
(if p
(go-to p))))

(kbd-map
(:mode in-active-graphics?)
("up" (begin
(go-outside-of-the-graphics)
(kbd-up))))
>>


2) Embedding Postscript Image in Drawing

I want to embed a Postscript image in a graphics-mode drawing and draw
"on top" of the image. Is this possible? Can it be implemented easily?


This feature exists already. Insert your image (or anything else you
want), select it, and then do Insert->Image->Draw over selection, it
will embed the selection inside a graphics (and then, the selection
is in the background of this graphics).


So I want to include my drawing
(which I have as a PS file) in my document and use the graphics mode to
draw text at the right places on top of the image.


You can do as explained above for adding a graphics over a chunk of
TeXmacs markup. To put text at the right places on top of the image,
insert text boxes, and then fill & move each one of those at the
right position in the graphics.



  • graphics mode questions, Felix Breuer, 05/16/2006
    • Re: [TeXmacs] graphics mode questions, Henri Lesourd, 05/16/2006

Archive powered by MHonArc 2.6.19.

Top of Page