3

I am new to lualatex and I am trying to port the template at this link http://www.lorenzopantieri.net/LaTeX_files/TesiClassica.zip from pdflatex to lualatex. This template uses komascript, classicthesis and arsclassica, (package written by the template's author)

I got all a bunch of "undefined font shape" warning, and obviously the result is quite different.

What should I do to ensure that the output will be the same?

I have done some research: I guess I need to set up with \usepackage{fontspec}\setmainfont, and maybe defines some \newfontfamily for all different cases in which different font are used (section title, chapter, caption, etc..)

Ps. I am on Ubuntu 14.04 with no new fonts installed.

PPS I do recognize that I am not providing directly a MWE, because I think it would be redundant to copy-paste the entire template, as the goal of this question is to exactly reproduce the pdftex out with lualatex.

EDIT.

I got this bunch of warnings that I think are the problem.

LaTeX Font Warning: Font shape `EU2/pplj/m/n' undefined
LaTeX Font Warning: Font shape `EU2/pplj/m/sc' undefined
LaTeX Font Warning: Font shape `EU2/pplj/m/sl' undefined
LaTeX Font Warning: Font shape `EU2/pplj/m/it' undefined
LaTeX Font Warning: Font shape `EU2/fvm/m/n' undefined
LaTeX Font Warning: Font shape `EU2/pplj/bx/n' undefined
  • 1
    Unless you run into a LuaTeX bug or a change due to the differences in some parts of e.g. the hyphenation system, running an example from pdfTeX with LuaTeX will give you exactly the same result. What exactly are you aiming for there? – Joseph Wright Sep 5 '14 at 13:01
  • well, I got a lot of warnings about missing fonts, and I think that is the problem. For example, the template uses the euler math font, and that need to be set-up in lua latex using \usepackage{unicode-math} \setmathfont[range={\mathit->\mathup}]{Neo Euler} after adding the necessary otf file to my font. Anyway, I am editing the question to add the warnings I think that are problem. – Pierpaolo Sep 5 '14 at 13:07
  • 1
    Without editing anything you should be able to compile exactly the same source with Lualatex (there might be some utf-8 problem in the titlepage though). Now I could ask you @thunder1123 a question: why do you need the features of lualatex for in the end having a result similar to the one of pdflatex? – s__C Sep 5 '14 at 13:11
  • Well, I like the font-related flexibility of lualatex,and anyway, is that wrong experimenting and learning new features? – Pierpaolo Sep 5 '14 at 13:12
  • There is no problem with that, but the main problem with lualatex is the math font handling. If I'm not mistaken this template uses Palatino, so choosing tex-gyre pagella math for this would be preferable, as indicated by @egreg. – s__C Sep 5 '14 at 13:59
6

I can make it work with some small adjustments, but only with XeLaTeX:

  1. Remove \usepackage[T1]{fontenc}

  2. Remove \usepackage[utf8]{inputenc} (but make sure your files are UTF-8 encoded)

  3. Remove the eulermath option to classicthesis

  4. Add the following before \usepackage{bookmark}:

    \usepackage{unicode-math}
    \setmainfont{TeX Gyre Pagella}
    \setsansfont{Iwona}
    \setmathfont{TeX Gyre Pagella Math}
    \setmathfont[range={\mathit->\mathup}]{Neo Euler}
    

Run through XeLaTeX.

If you insist with LuaLaTeX, you need to change how \textls is defined; so, add just before \begin{document},

\renewrobustcmd{\textls}[2][100]{%
  {\addfontfeature{LetterSpace=\number\numexpr#1/10\relax}#2}%
}
  • I am still getting a warning: LaTeX Font Warning: Font shape EU2/fvm/m/n' undefined`. By the way, what your lualatex trick does? – Pierpaolo Sep 5 '14 at 14:14
  • @thunder1123 You're loading Beramono, which can't be used with fontspec. There are other monospaced fonts to be loaded with \setmonofont. LuaLaTeX seems to choke on the default \textls, I don't know why: a bad interaction with microtype, I guess. – egreg Sep 5 '14 at 14:19
  • Just to know, with evince, the two main fonts look different, with lualatex it seems "bolder", but when I zoom in, the fonts seems identical. Does it depends only on the pdf engine? – Pierpaolo Sep 5 '14 at 15:45
  • 1
    @thunder1123 TeX Gyre Pagella is not exactly the same as the font called by \usepackage{mathpazo}; possibly it's related to hinting in connection with antialiasing: just a viewer problem. – egreg Sep 5 '14 at 15:59

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.