3/30/2023 0 Comments Latex to ps to pdfGs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -sOutputFile=my_plot_embedded.pdf -f my_plot.pdfĮach of the three options will result in PDF plots with fonts embedded. Use Ghostscript to embed all fonts in the figure:. Use cairo_pdf() instead of pdf() in R to export your plots as PDF.Let R generate postscript (.eps) files and convert them to PDF with epstopdf.Use one of the following three options to get your fonts embedded in PDF plots generated from R: The statistics package R, however, produces postscript and PDF plots without embedded fonts. If you use Gnuplot, the resulting figures will most likely have their fonts embedded. Consequently, we have two options for embedding all fonts: Either make sure that all fonts are embedded in each figure, or post-process the resulting PDF document (and don't forget to do the same with every other document in which you use that particular figure). Similarly, if a figure does not embed all its fonts, usually the respective fonts are not embedded in the final document either. My experiments indicated that fonts are embedded in the final document if the font is embedded in the respective figure. Postscript or PDF figures may or may not include all their fonts. In such case, I recommend dvips and ps2pdf with the options discussed above. My experiments showed that dvipdfm does not embed fonts which are missing in postscript graphics. Instead of using dvips and ps2pdf, you may also use dvipdfm to generate a PDF directly from a DVI file: latex my_file.tex Just replace 'my_file.ps' with 'my_file.pdf' above. If you already have a file my_file.pdf with fonts not embedded, you can also use the Ghostscript command above to produce a new PDF with all fonts embedded. The ps2pdf call above is essentially the same as calling Ghostscript directly, e.g.: gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -sOutputFile=my_file_embedded.pdf -f my_file.ps On my system it turned out to be sufficient to just pass -dPDFSETTINGS=/prepress. Ps2pdf -dPDFSETTINGS=/prepress -dEmbedAllFonts=true my_file.ps If some fonts are not embedded, you can instruct ps2pdf to embed all fonts by passing the options -dPDFSETTINGS=/prepress -dEmbedAllFonts=true as follows: latex my_file.tex If you use LaTeX to produce a DVI file, dvips to produce a postscript file, and ps2pdf to generate the PDF, you should check for embedded fonts just like described for PDFLaTeX above. Some figures (usually in PDF format) included in your document may, however, result in fonts not being embedded. Overall, if your document does not include externally generated figures, most likely your fonts are properly embedded when using PDFLaTeX. Here is a sample output from pdffonts for a PDF with all fonts embedded: name type emb sub uni object ID The third column says ' yes' if the font is embedded, and ' no' if the font is not embedded. The tool prints a table listing all the fonts used in the PDF. This can be achieved with either your favorite PDF viewer, or on the command line with pdffonts: pdffonts my_file.pdf If you use PDFLaTeX and do not include any figures, you may not need to do anything other than verify that all fonts are indeed embedded. There is also a small tarball available for download with all the details so that you can reproduce (and use for copy&paste) the subsequent discussion. Some tricks will even apply to PDFs in general and not be specific to LaTeX. In the following I will explain how you can make sure that all fonts are embedded in your LaTeX documents (journal papers, conference contributions, flyers, etc.). Not quite what you want from a portable document standard, is it? If a PDF does not embed all fonts, the target system may replace the respective font with the 'best' available system font, so the document is almost certain to look different on different machines. For high quality publications it is absolutely mandatory to embed all fonts in the respective PDF.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |