2

I recently reinstalled LaTeX and I'm encountering this error. It happens on nearly every compilation step and I don't know how to fix it.

When compiling, if a PDF is produced, the beginning of the PDF displays about a page and a half of XMP data which is supposed to be metadata.

garbage output all the way to page 2

This error shows up in total about 20 times each on my attempts to compile both .tex files from this repository: https://github.com/liantze/AltaCV

/usr/local/texlive/2021/texmf-dist/tex/latex/pdfx/pdfx.sty:2855: LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.2855 \includexmp{\xmp@template} %

This is on MacOS 11.4. TeXLive 2021. Installed with the unix installer from https://www.tug.org/mactex/mactex-unix-download.html.

  • 6
    it is a problem of pdfx it needs an adaption to the newest latex. Write the author, and disable pdfx for now. – Ulrike Fischer Jul 19 '21 at 19:51
  • 2
    Welcome to TeX SX! Probably you have in your preambles some code that should be after \begin{document}. Try to compile a minimal document. – Bernard Jul 19 '21 at 19:51
  • A minimal document will compile without problems. I'm writing an email to the current maintainer of pdfx. Is there a way to downgrade my version of LaTeX? Alternatively, how difficult would it be to try debugging this myself? – wildwestrom Jul 20 '21 at 05:54
  • 1
    You have provided no example, but try pdflatex-dev see https://tex.stackexchange.com/questions/605854/error-using-pdfx-on-tex-live-2021#comment1519200_605854 – David Carlisle Jul 21 '21 at 11:29
  • @DavidCarlisle Thank you for the response. Does the project I tested on not count as an example? – wildwestrom Jul 22 '21 at 12:18
  • @wildwestrom Questions ideally are self-contained here, and in particular are normally written with a minimal example showing the issue – Joseph Wright Jul 22 '21 at 12:33
  • I can confirm that Ulrike's suggestion of outcommenting the line \RequirePackage[a-1b]{pdfx} solves this error. When loading pdfx, even the minimal example of \documentclass{altacv} \begin{document} Hello \end{document} produces the error on the 2021 distribution as of August 5, 2021. – jan Aug 06 '21 at 04:34
  • Just for info: My own custom document class writes XMP metadata correctly. It does not use the pdfx or xmpincl packages. So, LaTeX certainly can write the metadata. As noted, the problem probably lies with pdfx. I recall that, a couple of years ago, some TeXlive yearly update had a bad interaction with pdfx. But I do not recall the details, or whether it has since been resolved. Did not affect my own code. – rallg Apr 14 '23 at 17:26

1 Answers1

0

You don't seem to be compiling the document at the github repository at all.

Line 19 of your source (from your screenshot) is \begin{document}

Line 19 of https://github.com/liantze/AltaCV/blob/main/mmayer.tex is not \begin{document} (which is at line 82)

All sorts of stuff is consequently failing.

Suggest try compile the actual document to which you refer and let us know the first error (if any)

Then edit the file altacv.cls to comment out the line 41 \RequirePackage[a-1b]{pdfx} (put a % sign at the start of the line)

Then let us know what LaTex distribution you are using.

  • 1
    My bad, I tried to change it based on Bernard's suggestion. I just edited my post.

    Now after commenting out the \RequirePackage statement for pdfx, it seems to compile, but the hyperlink functionality breaks. Image of the result.

    By the way, the AltaCV template works perfectly on Overleaf, probably because they're still using the 2020 TL distro.

    – wildwestrom Jul 20 '21 at 10:42