7

I am writing my phd thesis now, and all these while I have used texshop in mac os X (mavericks). I have compiled in Lualatex through texshop (or even texworks) and the file compiles fine, but I have a problem compiling it from the command line and get many errors like this :

   lualatex --shall-escape Report.tex 
    .
    .
    .
   ! Package fontenc Error: Encoding file `lgrenc.def' not found.
   (fontenc)                You might have misspelt the name of the encoding.

    See the fontenc package documentation for explanation.
    Type  H <return>  for immediate help.

Very typical latex compilation errors. My simple question is how to compile using lualatex from the command line?

  • 4
    withou seeing the source it is hard to tell, but a couplw of thing jump out. It shpuld be --shell-escape, and you should not be using fontenc with lualatex. Apart from that, the error ypu have shown are not related to lualatex, and pdflatex would probably crash the same way. – ArTourter Nov 05 '15 at 01:10
  • 3
    You have been using fontenc with lualatex this whole time? This is not (usually) recommended! Or is some package loading it "behind the scenes"? It is hard to tell without an actual, but minimal .tex file.... – jon Nov 05 '15 at 01:12
  • 1
    Welcome! You almost certainly don't want to be using lgrenc.def with LuaLaTeX in any case... But, again, without code it is hard to say. That said, the error you are getting is odd. lgrenc.def should be found. Loading it may well cause problems. But there should not be a problem loading it. Hard to say more without some more details, though. How did you install TeX exactly? – cfr Nov 05 '15 at 02:50
  • 1
    My impression is that you have two TeX Live distributions, one installed as MacTeX and the other, probably, with MacPorts. Can you add the output you get from giving which lualatex from the terminal? – egreg Nov 05 '15 at 07:36
  • @egreg which lualatex -- /opt/local/bin/lualatex I dont know how to put up the tex file its so big, but the confusion (for me ) arises as to how does texshop compile it ? – Ayan Mitra Nov 05 '15 at 08:42
  • 1
    @AyanMitra As I suspected, you have a MacPorts TeX Live that kicks in. See http://tex.stackexchange.com/questions/271525/error-in-mactex-font-not-loadable-metric-tfm-file-not-found – egreg Nov 05 '15 at 08:44
  • @AyanMitra as you have found a solution, perhaps you could make it an answer which would be more useful to visitors than having to read the whole question til the end. –  Nov 05 '15 at 16:56

1 Answers1

3

As mentioned by others in the comments, I found the macports installed binaries

port provides /opt/local/bin/latex

Then simply uninstall it

sudo port uninstall --follow-dependents texlive-bin

Now if you do which lualatex it shows

/usr/texbin/lualatex

The other shortcut I realised could be directly accessing the mactex binaries by

/usr/local/texlive/2012/bin/x86_64-darwin/lualatex  Report.tex

and put an alias to this path and then simply calling lualatex will invoke the texshop used same binaries, and that's what I am doing now and everything works fine.

  • 1
    You may want to look into updating your TeX distribution to MacTeX2015. LuaTeX and LuaLaTeX, in particular, have changed significantly since MacTeX2012. – Mico Nov 05 '15 at 17:17