Change the output size of ps_out

Hello all,

A less well known function in TeXmacs is that you can make a figure with the script-out function (Insert-Fold-Executable):

image

However with this method the width of the plot is always set to 0.7par.

Is there an idiomatic way of setting the width?

Following the manual, section “Advanced user preferences”, issuing this in a Scheme session before generating the figure worked

(set-preference "plugins:embedded postscript width" "0.9par")

Maybe with a little bit of work one can write a code that issues this command, taking as argument the figure width, as one presses a key combination. I do not see yet a good place where to insert the argument.

To write the code, you can take a look at Set Pasted Image to 0.8par and centered (you have to select the correct tree).
Also, in the Executable environment the Return key has a Scheme definition that makes it activate the Python code I think. I would look for that definition in the TeXmacs Scheme code and see if you can integrate those functions in your own code that both activates the Python code and sets the figure width.

1 Like

Should not be difficult to improve the plugin and modify the ps_out command to be able to specify the size of the image. This could be a nice exercise and also useful to many!

1 Like