Export selection as image not working

The “export selection as image” in the menu only works if I choose to export as pdf, gif or pnm (svg is produced for the last two). A terminal window will briefly appear if I choose jpeg or png but no file will be produced.

Yes, this export menu is promising way too much! Many of the proposed formats cannot be generated because, actually, there is no external converter installed on your system for generating that format (it would be more friendly if this were checked beforehand, and that is definitely possible). In any case, these export menu items should never deliver a format in place of another, as you describe.

What OS are you using, where did you get TeXmacs from and what version is it? Are any information or error messages displayed when such export fails?

Thank you for the reply. My texmacs was the windows version (2.1.1) downloaded from texmacs.org. There’s no error message, only a terminal window appearing for about 0.5 sec.

Don’t know if it’s relevant but I have ghostscript 9.56.1 and imagemagick 7.1.0 installed, although I doubt temacs knows that. I also have miktex installed.

It would be great if I can install the necessary programs to get the export to png or jpeg working.

My windows build comes bundled with a bunch of graphical converters; it should be able to generate jpeg and png.

I tried your build. Now it can produce a jpeg or png file, but all the image produced (including pdf) from

  • an inline formula will have trailing white space.
  • a displayed formula will have both preceding and trailing white space.

Another thing unrelated to the topic. I tried all the user interface themes but the toobars always appear to be bigger than that of the original texmacs, taking more screen space.

I get images with no leading/trailing white space, for both inline and displayed equations. I can only reproduce what you get by including some explicit extra spaces (e.g. ⟨nbsp⟩) in the selection.
Furthermore, I can see no difference in appearance between the official v.2.1.2 windows build and mine (except for an intended change of the preference settings dialog).

Hmm… I found that the white space problem happens when the style is “article” or “tmarticle”. It works when the style is “generic” or “letter”.

As for the menu size, it seems that the “legacy” user interface theme of your build is different from the offical texmacs build. The latter has smaller menu icons and line spacing. I’m also using a 4k monitor, don’t know if it’s relevant.

Thank you for reporting the extra spaces in exported images when using some styles. I will look into it.

However, even when using the “legacy theme”, I still do not observe the toolbar height difference you report:

The look (not size) has some slight unintentional differences, though. I presume they are due to differences among the various Qt 5.x.y libraries that can be used for building.

My builds are made for improving functionality in some areas (better image handling as you can witness, bundled converters and plugins, simple bug fixes…), but with the core code (including the GUI) essentially unchanged. For the same version, the same UI settings and the same display, I hence expect both builds to provide the same overall GUI, and that is what I have seen so far.

1 Like

OK, I’ve found a fix for that : as superuser, edit the scheme file tmimage.scm in your texmacs installation, and delete line 374 containing

(cwith “1” “1” “1” “1” “cell-hyphen” “t”)

or comment it out with a semicolon. You can find the full path to that file by running

(eval-system “find $TEXMACS_PATH -name tmimage.scm”)

in a scheme session inside TeXmacs.

Of course, I’ll incorporate the fix in the proposed patch and my future builds.