Skip to Content.
Sympa Menu

texmacs-users - Re: customizing size by default of images

Subject: mailing-list for TeXmacs Users

List archive

Re: customizing size by default of images


Chronological Thread 
  • From: Giovanni Piredda <address@hidden>
  • To: address@hidden
  • Subject: Re: customizing size by default of images
  • Date: Sun, 28 Aug 2022 13:26:31 +0000

Rather than searching for the bug, let us try again (I also modified the set-image-size function so that it preserves the aspect ratio):


(define (image? t) (tree-is? t 'image))

(define (find-image t)
  (car (tree-search (tree-outer t) image?)))

(define (set-image-size t)
  (tree-set! t 1 (string->tree "0.5par"))
  (tree-set! t 2 (string->tree ""))) ; set to one's wishes


(kbd-map ("v v v" (let ((t (find-image (cursor-tree))))
                   (set-image-size t))))


Let's see if this works :-)

G.




On 28.08.22 15:05, vincent douce wrote:
hello Giovanni and thanks
i understand that we dont know where to parameter size by default for images in texmacs
as my aim si to customize TeXmacs from the file my-texmacs-init.scm (so that i can share all my custom with just one file), i typed this in this file :
i quitted and launched again TeXmacs
now with the cursor at the right of a newly pasted image, i press VVV : nothing happens
i start again with apple e then v : nothing happens
i precise i regularly use M-e p for exporting to pdf : works very well

then if you can give me a tipp to make it work it's very cool :-)
Vincent

Le 23 août 2022 à 10:32, Giovanni Piredda <address@hidden> a écrit :

The best that I can do is to provide a shortcut for quickly changing the size immediately after you have inserted an image. Admitting that you did not have that already in mind, please see https://lists.texmacs.org/wws/arc/texmacs-users/2021-09/msg00029.html. Id est, I did not make any progress (any progress I am aware of :-) ) since I wrote that, and in fact I had forgotten that I had written it! I did not test it again.

If you want to limit the shortcut to some mode (for example, in text only) you can do that by adding a "mode" form to the definition of the shortcut. For example

(kbd-map

|(:mode in-text?)|

("C-w"
          (let ((t (find-image (cursor-tree))))
            (set-image-size t))))

Please let me know if it works.

G.

On 23.08.22 10:09, vincent douce wrote:
hello
i notice that size by default for incuded or linked images is always 1par
how can i customize this to, say, 5cm ?
Vinz

----
https://lemathoscope.com/
cours de maths en ligne

https://tsunaminuage.com/
photographie poétique




Archive powered by MHonArc 2.6.24.

Top of Page