20230731

PDF embedding: 2023 edition

 Solely for my own benefit, some updates to how to create PDFs from Latex/Overleaf that meet the PDF/A standard required by various publishers, whose own instructions miss out several important features. 

  • The final missing piece: make sure that hyperref receives the pdfa option.  In particular, if you are using acmclass call it with
    \documentclass[pdfa]{acmart}

    Or similar adaptation, e.g., \documentclass[sigconf, nonacm, pdfa]{acmart}.  Yes, I'm looking at you, PVLDB. 

  •  Throw in 

    \usepackage[a-2b]{pdfx}

    I've no idea if this does anything useful, but why not?

  • Edit 2025 edition: check to see if there are any Type3 fonts snuck in because these are bad bad bad apparently.  One egregious source of type three fonts is using the \mathbb{}font.  Instead \usepackage{dsfontt} and replace with \mathds{}. Thanks to the good folks of stackexchange for this tip.  

  •  Go back to your plots in python, and make sure that Matplotlib is instructed to not use type 3 fonts.  The correct answer is of course 42, as in 

    import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42

    or something similar. 
Hopefully that will do it.  Web services like https://avepdf.com/pdfa-validation can be useful at debugging things, if you don't mind uploading your documents to a random server, and running out of free goes. 

No comments: