I'm having troubles with LuaLaTeX and the listings package: the former doesn't seem to accept me performing \lstinputlisting on a filename that doesn't have an extension.

Minimal example:


hello: hello.c
    cc -o hello hello.c



pdfLaTeX is successful, LuaLaTeX displays the following error:

! Package Listings Error: File `Makefile(.tex)' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: tex)

Enter file name:

I'm using the freshest versions from TeXLive 2012 (pdfTeX 3.1415926-2.4-1.40.13, LuaTeX beta-0.70.2-2012052410).

What's the trouble?


2 Answers 2


The problem has been mentioned on the luatex mailing list: http://tug.org/mailman/htdig/luatex/2013-February/004042.html

The problem is that LaTeX is using \openin and \ifeof to test for the existence of a file and this test fails for files without extensions (despite the fact that the (primitive) \input itself would work).

The problem is not confined to luatex: In miktex your example fails with pdflatex too.

With luatex there is a work around: \openin accepts arguments with braces and this seems to protect the file name. So you can use \lstinputlisting{{Makefile}}.

  • As far as I can see the workaround with two {{/}} doesnt work anymore with current luatex. Dec 5, 2019 at 23:07

I use MiKTeX.

To correct this issue, I add a dot after the Makefile filename:


References: MiKTeX and miktex-users

  • 1
    Interesting. Unfortunately, it seems that this works with neither pdfLaTeX nor LuaLaTeX on Linux. Nov 13, 2013 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.