13

I need to build a PDF 1.6 with LuaLaTeX, and I can't get \pdfminorversion command to work:

\pdfminorversion=6
\documentclass{article}
\begin{document}
    This is a test
\end{document}

The result is

Undefined control sequence. \pdfminorversion

PdfLaTeX builds the PDF, but I need to use LuaLaTeX (I need the fontspec package).

2 Answers2

16

As of LuaTeX v0.87, the pdfTeX-derived extension primitives are renamed. Here, you want

\pdfvariable minorversion

The details of emulation are given in the LuaTeX manual, or you can load the luatex85 package which wraps up this emulation for the transition.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • Thanks, @JosephWright. I've been searching for this answare all day. – Zé Cláudio Jun 14 '17 at 19:54
  • Why did they do this? On the surface, it is just to make life difficult. I assume that's not the reason, but I would really like to know what it is. It just right now seems to add to the number of conditionals needed for documents to work with multiple engines, and to increase the work needed to switch from one to the other, as well as sowing version-based confusions for users of LuaTeX. (I should admit, that I am not such a user, so perhaps the benefits are more obvious than I realise.) – cfr Jun 15 '17 at 00:38
  • @cfr https://www.tug.org/TUGboat/tb37-1/tb115hagen-pdf.pdf – Henri Menke Jun 15 '17 at 00:41
  • @HenriMenke I'm not convinced that explains the decision to change the end-user interface. It's concerned solely with implementation, as far as I can tell. (But I haven't read it all right now - just skimmed through it quickly - so maybe this is explained somewhere.) – cfr Jun 15 '17 at 01:06
  • 1
    @cfr »The way these [the \pdf... primitives] were implemented in LuaTeX prior to 0.82 violates the separation between frontend and backend, an inheritance from pdfTeX. Additional features such as protrusion and expansion add to that entanglement. However, because PDF is an evolving standard, occasionally we need to adapt the related code. A separation of code makes sure that the frontend can become stable (and hopefully frozen) at some point.« – Henri Menke Jun 15 '17 at 01:09
  • @HenriMenke That explains why they don't want to have the pdf... primitives. But I don't care whether \pdfminorversion is a primitive. I care whether it works. And since I can wrap it and make it work, it seems to me that its working must be consistent with the separation. That is, it is a matter of implementation, which is nothing to me if I just want my code to keep working. Fortunately, my code all uses pdfTeX and I tell all my students to stick to pdfTeX, so my code and their code did not break. – cfr Jun 15 '17 at 01:19
  • @HenriMenke In fact, I use this incident in class as an explanation for why I recommend avoiding LuaTeX and sticking to pdfTeX. – cfr Jun 15 '17 at 01:21
  • @cfr I abandoned pdfTeX some time ago because I want to use OpenType fonts and XeTeX is just broken. Also scripting in Lua is really nice, I love the syntax. – Henri Menke Jun 15 '17 at 01:24
  • 1
    @cfr LuaTeX is a tool for typesetting. The toolmakers are continually making improvements and changes to the tool, including to the user interface. Of course while it is in such a beta state, it should not be used for archival documents. Did you know there were many features of TeX78 that no longer worked or were even simply renamed in TeX82? When it is stable the developers will announce it; until then I wouldn't hold the instability against it. – ShreevatsaR Jun 15 '17 at 01:41
  • @ShreevatsaR It is not beta. – cfr Jun 15 '17 at 01:48
  • @cfr: You're right, LuaTeX doesn't have "beta" in its version number. By "beta" I was thinking of this bit: https://i.stack.imgur.com/iBcrd.png (“Can I use LuaTeX today?” on the LuaTeX FAQ page). In the meantime, I enjoy using it to play with, for stuff like this :-) – ShreevatsaR Jun 15 '17 at 12:48
11

You can also set the minor version on the Lua end.

\directlua{pdf.setminorversion(6)}
\documentclass{article}
\begin{document}
    This is a test
\end{document}
$ pdfinfo test.pdf 
Creator:        TeX
Producer:       LuaTeX-1.0.4
[...]
PDF version:    1.6
Henri Menke
  • 109,596