Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to use \dot{P} in a math environment.

MWE:

\documentclass{scrartcl}
\usepackage[no-math]{fontspec}
\usepackage{libertineotf}
\usepackage[libertine]{newtxmath}
\begin{document}
    \begin{equation}
        \dot{P}(t) + 1234567890
    \end{equation}
\end{document}

Without the command \dot everything works as aspected.
With it I get the error: Internal error: bad native font flag and no output is produced.

Without the option no-math or the entire fontspec package (whose functionality I don't even need at the moment) there is an output compiled that includes a correct "dotted" P.
But the paranthesis, the plus sign and the numbers are not set in the Libertine font but rather in CM. Also the spacing information from the newtxmath package seems to get lost (could be related to CM).

I already tried to change the package order. That resulted in an option clash error for fontspec and the same output as without the fontspec package at all.

Any suggestions?
I tried using the libertine package for pdflatex (without fontspec of course) which produced the same output as XeLaTeX without the fontspec package.

Versions/File List:

MikTeX                2.9 64bit, Win7
libertineotf.sty      2012/04/07 5.13-8
fontspec.sty          2012/05/06 v2.2b
newtxmath.sty         2012/06/25 v0.99
share|improve this question

2 Answers

up vote 7 down vote accepted

This a bug in XeTeX resulting from mixing the OpenType (AKA "native") font Libertine with accent from the TFM font newtxmath. It didn't show up in earlier versions because of a bug that prevented the proper utilisation of OpenType math accent positioning that has been recently fixed.

I tried to fix the new bug, but it seems to be a bit tricky. Anyway, I hope it will be fixed by the time of the next release.

share|improve this answer

I (finally) found a solution with the help of Hendrik's answer to Dot Derivative Discrepancy.

By simply adding

\renewcommand*\dot[1]{%
  \placeaccent{\acc@dot}{#1}%
  }
\renewcommand*\ddot[1]{%
  \placeaccent{\acc@dot\mkern1.4mu\acc@dot}{#1}%
  }

to his code snippet.

This does not help for other accents, of course.
For the \hat{} command I found the following solution:

\renewcommand*\hat[1]{%
  \placeaccent{\acc@hat}{#1}%
 }

where \acc@hat is defined as:

\def\acc@hat{\mbox{\raisebox{-1.27ex}[0ex][0ex]{\^{}}}}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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