11

In the minimal example that follows luatex doesn't place the accent correctly (it's too far left):

\documentclass{minimal} 
\usepackage{fontspec}
\setromanfont{Linux Libertine O}
\begin{document}
\(\bar E\)
\end{document}

But if I compile it with xelatex, or with lualatex and \setromanfont{Linux Libertine O} commented out, everything works fine.

I believed that fonspec was only for text, and not for math. So why this strange behaviour ?

  • 2
    Try loading fontspec with the no-math option. – Andrey Vihrov Nov 4 '11 at 15:01
  • @AndreyVihrov : It works. Maybe you could make an answer of you comment. – Matsaya Nov 4 '11 at 16:22
  • Actually, I can't see any difference at all with LuaLaTeX and XeLaTeX. I use TeX Live 2011. Perhaps you could tell your distribution and show an image of what exactly is wrong. – Andrey Vihrov Nov 4 '11 at 16:59
  • @AndreyVihrov I see the same with TeXlive 2011 (on W7), the bar is shifted left. – Torbjørn T. Nov 4 '11 at 18:04
  • @AndreyVihrov I have TeXLive 2011 (on MacOs 10.7), fully updated. And the result really depend on the choice of the police (with Palatino, for example, it works fine). – Matsaya Nov 5 '11 at 9:57
4

This is what I get when calling \showlists after the formula:

LuaTeX

### horizontal mode entered at line 6
\whatsit
.\localinterlinepenalty=0
.\localbrokenpenalty=0
.\localleftbox=null
.\localrightbox=null
\hbox(0.0+0.0)x20.0, direction TLT
\mathon
\vbox(8.20554+0.0)x7.95831, direction TLT
.\hbox(5.67776+0.0)x0.0, direction TLT
..\OT1/cmr/m/n/10 ^^V
.\kern-4.30554
.\hbox(6.83331+0.0)x7.95831, direction TLT
..\OML/cmm/m/it/10 E
\mathoff

XeTeX

### horizontal mode entered at line 6
\hbox(0.0+0.0)x20.0
\mathon
\vbox(8.20554+0.0)x7.95831
.\hbox(5.67776+0.0)x0.0, shifted 2.31252
..\OT1/cmr/m/n/10 ^^V
.\kern-4.30554
.\hbox(6.83331+0.0)x7.95831
..\OML/cmm/m/it/10 E
\mathoff

There is clearly a problem with LuaTeX; it can be due to fontspec as, when not loading it or loading a different font than Linux Libertine O (I tested Old Standard and TeX Gyre Termes) I get the following:

LuaTeX (without Linux Libertine O)

### horizontal mode entered at line 6
\whatsit
.\localinterlinepenalty=0
.\localbrokenpenalty=0
.\localleftbox=null
.\localrightbox=null
\hbox(0.0+0.0)x20.0, direction TLT
\mathon
\vbox(8.20554+0.0)x7.95831, direction TLT
.\hbox(5.67776+0.0)x0.0, shifted 2.31252, direction TLT
..\OT1/cmr/m/n/10 ^^V
.\kern-4.30554
.\hbox(6.83331+0.0)x7.95831, direction TLT
..\OML/cmm/m/it/10 E
\mathoff
  • I don't see a difference between the two LuaTeX outputs.... – JPi Jan 20 '17 at 17:50
  • 1
    @JPi I see no shifted in the first case. – egreg Jan 20 '17 at 18:09
  • 1
    @JPi On the other hand, the problem seems to have been solved already with TeX Live 2012 (issued some months after my answer). – egreg Jan 20 '17 at 18:21
  • Yes, I was just reading this because it showed up when you answered my question posted 20 Jan 17. – JPi Jan 20 '17 at 18:27

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.