Latex Figure Pdf Trim
Posted : admin On 27.01.2020Is a good starting point. Instead of -deps use -dpdf for pdf output.You can fix the bounding box issue using the code below.
Latex Figure Location
Set(gcf, 'PaperSize', 6.25 7.5);set(gcf, 'PaperPositionMode', 'manual');set(gcf, 'PaperPosition', 0 0 6.25 7.5);set(gcf, 'PaperUnits', 'inches');set(gcf, 'PaperSize', 6.25 7.5);set(gcf, 'PaperPositionMode', 'manual');set(gcf, 'PaperPosition', 0 0 6.25 7.5);set(gcf, 'renderer', 'painters');print(gcf, '-dpdf', 'my-figure.pdf');print(gcf, '-dpng', 'my-figure.png');print(gcf, '-depsc2', 'my-figure.eps');You can read more about this on article. The answers above seem too complicated. This function uses a figure handle and a string to print the stuff in a pdf file without the huge margins. For raster image outputs (e.g png), the following is in my Makefile: convert -trim input.png input-trimmed.pngThis requires imagemagick.Update: For all my recent publications I used and it is the best solution I found so far (along with many other solutions to other problems in a single package). I feel a tool that is at least as powerful as this should already be an official part of Matlab. I use it as: exportfig -transparent fig.pdfWhich exports the current Figure, cropping the output by default.Require ghostcript.