On 17/07/23 17/07/23, 18:20, Henning Hraban Ramm wrote:
Bonus question: how also to handle the case of \startMPcode draw figure "MyFigure" xsized TextWidth ; ... \stopMPcode
Is MyFigure a pixel image? You could use \externalfigure within MP code.
The MP operator figure calls \externalfigure. However, the resolution downsampler hooked into externalfigure as you suggest would not give the desired resolutions once resized in MP. A solution might be to use draw rawtextext("\externalfigure[MyFigure][width=\textwidth") ; which is OK for this simplified example but would not work when more sophisticated MetaPost transformations might be needed. Along the lines of the conversion downsampler, a resolution reporter and manual resampling could be more efficient than reconverting the bitmap image at every run, of which there can be many. -- Alan