Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdfx with current LaTeX Release (2024/06/01) - Not only Letter template broken #472

Open
schoeps opened this issue Jun 4, 2024 · 20 comments
Labels
dependency the issue is caused by some other package resolved resolved (Issue just left open until … see issue for condition) workaround workaround provided within the issue

Comments

@schoeps
Copy link
Collaborator

schoeps commented Jun 4, 2024

Hello @TeXhackse, I recently updated texlive and I see those errors when compiling the letter template:

Latex Error: /usr/local/texlive/2024/texmf-dist/tex/latex/pdfx/pdfx.sty:2746 LaTeX Error: Loading a class or package in a group.

Latex Error: /usr/local/texlive/2024/texmf-dist/tex/latex/xmpincl/xmpincl.sty:20 LaTeX Error: Loading a class or package in a group.

Latex Error: /usr/local/texlive/2024/texmf-dist/tex/latex/xmpincl/xmpincl.sty:34 LaTeX Error: Loading a class or package in a group.

I guess it's a problem from a third party package? Can you check? Maybe there is some way around?

@TeXhackse
Copy link
Collaborator

TeXhackse commented Jun 4, 2024 via email

@schoeps
Copy link
Collaborator Author

schoeps commented Jun 4, 2024

Thanks. This works for me. I remember that this setting was necessary in the past but then it worked for some time without this option. No it's back again?! Anyway, thanks. No need to rush with an answer or fix.

@TeXhackse
Copy link
Collaborator

TeXhackse commented Jun 4, 2024

Well… it's more complicated. The whole pdfx package which we had used to PDF/A mode before is affected. The package will be fixed but that's not on CTAN so far.

I moved the setup to use the new pdfmangement, but did not yet change all the templates to use it.

You can use

\DocumentMetadata{
	pdfstandard=a-2b,
	pdfversion=1.7,% 2.0 is possible as well, but some validators don't support that yet
}

To get PDF/A without that package now. This has to be before \documentclass. But it's complex to do that via a package option. The pdfmanagement is not intending to support these options that way. I did some tests, but don't think it's woth to increase the maintenance effort. It's in the new documentation, which I still am working on as the support effort generally is increased a lot within the last months this is sadly not yet finished :/

@TeXhackse TeXhackse changed the title Letter template broken pdfx with current LaTeX Release (2024/06/01) - Not only Letter template broken Jun 4, 2024
@schoeps
Copy link
Collaborator Author

schoeps commented Jun 6, 2024

Should help to set pdfa=false. Will explain as soon as possible.

If I compile once then yes. If I compile multiple times there is again an error.

@TeXhackse
Copy link
Collaborator

I have planned to have a look at this today.

@TeXhackse TeXhackse added the dependency the issue is caused by some other package label Jun 6, 2024
@TeXhackse TeXhackse added the workaround workaround provided within the issue label Jun 24, 2024
@u-fischer
Copy link

@TeXhackse Well I'm naturally quite happy if you advertise the use of the \DocumentMetadata setup. But as it doesn't look as if pdfx is moving, I would suggest that you implement this workaround for pdfx user:

https://tex.stackexchange.com/a/720984/2388

@TeXhackse
Copy link
Collaborator

@u-fischer Thanks a lot for the hint.

@TeXhackse
Copy link
Collaborator

The release (https://github.com/tudace/tuda_latex_templates/releases/tag/v3.40) including the workaround mentioned before has been uploaded to CTAN yesterday and was installed, so it should be available during the day.

I will message the TUDa sharelatex team to ask if the sharelatex can also get that version asap.

@StefanFabian
Copy link

StefanFabian commented Jul 2, 2024

pdfx was updated for me today, now I have the issue:

Package pdfx Error: 
(pdfx)	Cannot change the \pdfminorversion
(pdfx)	PDF version remains at 1.5.
(pdfx)	Use \pdfmajorversion=1 
and \pdfminorversion=3 before \documentclass.

Not sure if it's related to this issue or the workaround.

@TeXhackse
Copy link
Collaborator

Neither – nor. It's a bug in the package. It's loading the luatex85 package which sets the version number when using luatex and afterwards complains about the number being set already.

What you can do is as mentioned before switching to the other mechanism, which I'd recommend.

Or do what the message tells you to workaround. Silly thing is, the message is wrong for luatex, as those macros only exist after luatex85 was loaded.

So in case you use luatex it would be

\pdfvariable majorversion = 1% instead of  \pdfmajorversion
\pdfvariable minorversion =3 % instead of \pdfminorversion=3

before \documentclass.

But this will use PDF version 1.3. Which might lead to issues with included PDFs of a higher version.

@StefanFabian
Copy link

With other mechanism, you mean using DocumentMetadata instead of the pdfa option?

@TeXhackse
Copy link
Collaborator

If you activate PDF/A output via the pdfmanagement (So yes, that's what \DocumentMetadata does). The pdfa option will still be active, but the pdfx option which is internally will be switched off automatically. This will prevent pdfx from being loaded.

Alternatively… I just thought about it's also possible to set the PDF version manually with pdfx. But that's more effort than just using the \DocumentMetadata setup.

@TeXhackse
Copy link
Collaborator

So actually … Things I fixed yesterday using the workaround won't help … We could enforce this before the pdfx package is loaded … But actually I am not sure if I want to add more workarounds as long as we have the other option.

Actually the update of pdfx was not expected anymore.

@u-fischer
Copy link

@schoeps no, I get the error also for book class if I load pgfcore (or tikz or something like that) before pdfx. pdfx is then no longer able to change the pdfversion as the PDF has already started. With luatex this currently errors as it starts with different defaults.

Generally the class should load pdfx earlier, before pgfcore is loaded.

@TeXhackse
Copy link
Collaborator

@u-fischer You're extremly fast.

Actually I just had the same finding. That's something I can easily change of course. I will also have a look at the other changes of the packge to avoid other conflicts.

@u-fischer
Copy link

u-fischer commented Jul 2, 2024

Actually the update of pdfx was not expected anymore.

;-) I had given up hope too and was rather suprised.

@schoeps
Copy link
Collaborator Author

schoeps commented Jul 2, 2024

You are both (too) fast (for me) 🥇

@TeXhackse: can you put somewhere (here or under discussion or whatever) two MWEs with pdf/a support and without? I am confused and probably other users as well.

@u-fischer
Copy link

@TeXhackse

as those macros only exist after luatex85 was loaded.

Yes and another workaround which would work as long as pdfx wants to generate only 1.5 would be to load luatex85 before, but that works only in some cases, and doesn't work before \documentclass as it would disturb your ifPDFTeX test (and that is a but in iftex that we will handle). So I wouldn't recommend that ...

@TeXhackse
Copy link
Collaborator

The updated template files use the \DocumentMetadata mechanism already.

You can just remove that and turn pdfa=false as you could before.

\DocumentMetadata{
	pdfstandard=a-2b,
	lang=de,
	pdfversion=1.7,
}
\documentclass{tudapub}
\title{text}
\author{names}
\begin{document}
\maketitle
\end{document}

disabled pdfa

\documentclass[pdfa=false]{tudapub}
\title{text}
\author{names}
\begin{document}
\maketitle
\end{document}

If I could finally finish the refactoring + the global docs … then we could also have this explained in more detail (not your fault of course).

Worst thing about all this is, that we have to do \DocumentMetadata before \documentclass which I can totally understand but it makes it hard with the libraries condition to have pdfa enabled by default.

@TeXhackse
Copy link
Collaborator

I changed the order of the packages yesterday and released 3.41 to CTAN. Was already installed and depending on the used mirror it will be lastest by tomorrow morning I guess. - As before I still leave this open until the sharelatex server updated.

@TeXhackse TeXhackse added the resolved resolved (Issue just left open until … see issue for condition) label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency the issue is caused by some other package resolved resolved (Issue just left open until … see issue for condition) workaround workaround provided within the issue
Projects
None yet
Development

No branches or pull requests

4 participants