# Workaround for pdfcomment not working lualatex

This is a very localized issue affecting Fedora 25 users with texlive.x86_64 6:2016-30.20160520.fc25

I have a one year old document that after upgrading Fedora 25 doesn't compile anymore. I determined that the combination of lualatex and pdfcomment is problematic.

A simple document like this

\documentclass{article}
\usepackage{pdfcomment}
\begin{document}
blah
\end{document}


Does not compile with LuaLaTeX

\$ lualatex --version
This is LuaTeX, Version 0.95.0 (TeX Live 2016)


by giving this error:

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(./fusion.out) (./fusion.out)
! Undefined control sequence.
\PDF@SetupDoc ...pstringB {\@baseurl }\pdfcatalog
{/PageMode/\@pdfpagemode \...

l.5 \begin{document}


Do you know of a workaround or option I have to pass to pdfcomment to make it work?

• Your example compiles fine for me, but in general \RequirePackage{luatex85} before \documentclass is worth a try. – Ulrike Fischer Feb 21 '17 at 11:50
• as Ulrike says, luatex85 package will define \pdfcatalog but it should not be needed with an up to date texlive. – David Carlisle Feb 21 '17 at 12:16
• luatex85 defines \pdfcatalaog so you can't get that undefined message if you use \RequirePackage{luatex85} as first line. but as I say with an up to date texlive you should get no error even without that – David Carlisle Feb 21 '17 at 22:36
• @alfC datetime I'd guess (which isn't used in the example posted) – David Carlisle Feb 21 '17 at 22:43
• You can't use \usepackage before \documentclass so \RequirePackage is better. – JPi Feb 21 '17 at 23:16

This is the solution proposed by @DavidCarlisle, for my particular combination of versions luatex 0.95.0 and pdfcomment 2016/03/26 v2.3b. (may not be general, see comments.)

First add \RequirePackage{luatex85} (or \usepackage?) and you will still get this new error ! Use of \@dt@getdate doesn't match its definition. \pdfcreationdate ->\pdffeedback creationdate.

Then add \RequirePackage{datetime} (or \usepackage?) and the minimal example will compile.

\documentclass{article}
\RequirePackage{datetime}
\RequirePackage{luatex85}
\usepackage{pdfcomment}
\begin{document}
blah
\end{document}

• You seem to have a weird combinbation of new and old packages! Update to pdfcomment v2.4. It has a compatability fix for luatex >= v0.85. Furthermore it uses datetime2 instead of the obsolete datetime. Your solution can't be regarded as general solution. Your MWE works perfectly with on up-to-date LaTeX distribution. – Josef Feb 22 '17 at 7:16
• @Josef, probably I do. This is an upgraded Fedora 25 distribution. dnf reports texlive.x86_64 6:2016-30.20160520.fc25. This could be useful to a Fedora user. – alfC Feb 22 '17 at 7:40