1

In short, I am trying to use a LuaTeX package, and after digging into the error-emitting code have come up with the following minimal example:

\documentclass[11pt,a4paper,twoside]{article}
\usepackage{fontspec}
\usepackage{lipsum}
\font \cmuntt = file:cmuntt.otf
\begin{document}
    \fontid \cmuntt
    \textbf{Zulu \lipsum[1-8]}
\end{document}    

The font file cmuntt.otf is arbitrary in this case, and is otherwise recognised by Lua(La)Tex, but the sequence \fontid \cmuntt, dragged verbatim out of the package in question, typewriter.sty, doesn't seem to work, and causes the compiler to emit the following error code:

! Undefined control sequence.
l.6      \fontid
             \cmuntt
?

I'm not sure what is supposed to happen, nor what is actually happening, but it is worrying that the compiler is emitting that error message with what is supposed to be a core LuaTeX control sequence. Replacing fontspec with luaotfload predictably doesn't change anything.

I am using a (supposedly?) up-to-date MikTeX installation, if it makes a difference.

Darkgamma
  • 125
  • 4
    On my TeXLive 2017 distribution the snippet compiles with lualatex (if I add \usepackage{lipsum} to the preamble). –  Feb 04 '18 at 02:14
  • @marmot how terribly worrying! (I just added lipsum to the example, forgot I left it out — but it breaks just before that); and I'm on MikTeX – Darkgamma Feb 04 '18 at 02:16
  • 1
    Well, with an current complete MiKTeX 2.9 I can compile your code without any error or warning. – Mensch Feb 04 '18 at 02:27
  • 1
    Where is file typewriter.sty? I do not find it in my own TeX setup, or CTAN. –  Feb 04 '18 at 02:53
  • @RobtAll No idea. Perhaps a custom package of the OP's? The MWE doesn't require it, after all. – cfr Feb 04 '18 at 02:59
  • @RobtAll Only thing a web search turns up is https://tex.stackexchange.com/questions/383925/what-fonts-are-available-to-me-when-using-usepackaget1fontenc ;). – cfr Feb 04 '18 at 03:03
  • Why are you loading fontspec and then using TeX-level font macros? Not even LaTeX. – cfr Feb 04 '18 at 03:04
  • typewriter.sty is this brilliant package at https://tex.stackexchange.com/questions/344214/use-latex-to-simulate-old-typewriter-written-texts – Darkgamma Feb 04 '18 at 03:05
  • @cfr I used fontspec to make 10000% sure it wasn't the font file messing up; otherwise, the TeX macros wouldn't be in my actual code, but in the package — and it's those very macros (or, well, specifically \fontid) that cannot work. I'm currently installing TeXLive to see whether it'll fix my issue, but it's a bit like taking a hammer to a brain surgery imho – Darkgamma Feb 04 '18 at 03:06
  • 1
    But why are you using \font etc. at all in LaTeX? You should use the higher level macros, even in a package, unless your package is the package providing those macros, obviously. – cfr Feb 04 '18 at 03:09
  • 2
    Oh, the purpose of the package is to screw up the typesetting. Fair enough. – cfr Feb 04 '18 at 03:12
  • The package itself is using \font and \fontid; I didn't want to take the whole package apart, and using TeX macros in LaTeX ought to work anyhow; whether I use \fontid in the file itself, or do \include{typewriter}, the error is the same — but the code is more legible like this and doesn't require taking a look at two separate files. – Darkgamma Feb 04 '18 at 03:12
  • take it apart take it apart take it apart – doed Feb 04 '18 at 04:17
  • 1
    Works ok for me, show your log-file. – Ulrike Fischer Feb 04 '18 at 07:51
  • 1
    @cfr "screw up the typesetting" what a thing to say! I am sure that you meant to say "honour the typesetting traditions of an earlier age" – David Carlisle Feb 04 '18 at 09:57
  • 1
    @RobtAll good thing is, typewriter.sty requires luatex so you could use it with novel class. – David Carlisle Feb 04 '18 at 10:01
  • I only get the error if I use TeX Live 2014. The linked answer clearly specifies that TeX Live 2015 or newer should be used. – egreg Feb 04 '18 at 11:52
  • @egreg post as answer? – David Carlisle Feb 04 '18 at 12:20
  • @DavidCarlisle Not biting at that bait. –  Feb 05 '18 at 02:56

1 Answers1

3

The answer to Use LaTeX to simulate old typewriter written texts you mention in comments clearly specifies that the code works only with TeX Live 2015 or later.

Indeed, I tried to compile your example with various releases of TeX Live and it fails only with TeX Live 2014 (and earlier).

egreg
  • 1,121,712
  • Huh, yeah; the oddest part about it is that I did update MikTeX, but LuaTeX seemingly didn't update and was stuck on a 2013 release. Truly upsetting. Reinstalling MikTeX and admin-priv updating it fixed everything, and caught a few more un-updated packages and executables (why are they not updated? The update tool gives no error messages when I update even when it fails, it seems; but that's a question for a different time), and it works on, apparently, any LuaTeX version after 2015. +1, thanks – Darkgamma Feb 04 '18 at 14:59