![]() |
Export or Copy selection to graphics | ![]() |
TeXmacs can export the active selection to many graphical formats, either as files (File\(\rightarrow\)Export\(\rightarrow\)Export selection as image) or through the system clipboard (Edit\(\rightarrow\)Copy to…\(\rightarrow\)Image), for pasting into other applications.
In case of file export, the desired graphical format is determined by the file extension you choose (for instance: pdf, eps, jpg…).
For the clipboard mechanism, you need to set in advance the desired format in Edit\(\rightarrow\)Preferences\(\rightarrow\)Converters\(\rightarrow\)TeXmacs -> image\(\rightarrow\)Clipboard image format. This menu offers a choice between png, jpeg, tif, eps, svg and pdf formats, provided a suitable converter is available (see below).
For both the clipboard mechanism and file export, the resolution of bitmap formats is set by the preference Edit\(\rightarrow\)Preferences\(\rightarrow\)Converters\(\rightarrow\)TeXmacs -> image\(\rightarrow\)Bitmap export resolution (dpi).
When Svg format is selected, TeXmacs annotates the image with the source information for the image's content. When inserted in Inkscape or Libreoffice documents, such images can easily be re-edited using the Equation editor plugin.
TeXmacs can natively produce PDF vector images.
In order to produce the various other graphic formats, TeXmacs relies on various libraries or external programs, notably :
Qt,
Ghostscript,
pdf2svg, for Svg output,
pdftocairo (from the Poppler project) can can produce both vector (svg) and raster formats (png, jpg),
ImageMagick, for raster formats.
Several of these converters are accessed through Scheme
converter procedures (defined in $TEXMACS_PATH/progs/convert/images/init-images.scm).
Additional converters can be similarly defined, when
needed.
When attempting a conversion, TeXmacs looks for suitable external programs in the system PATH, and if none is found, it displays an error message. On Linux if these external programs are not already installed, they are easy to install from your distribution's package manager. On MacOS, pdf2svg and ImageMagick (as well as Inkscape) are available from MacPorts. On Windows, pdftocairo can be obtained from here, or you can get it bundled with TeXmacs.