# How do I get Libertine + Libertine in math mode + historical ligatures + french-style?

I would like to write a document using:

• Libertine;
• Libertine in a correct math mode;
• Historical ligatures;
• French style of mathematics (upright greek letters and capital letters).

I know I should use XeLaTeX, newtxmath and unicode-math for this, but all my attemps failed.

What is the correct code to get this done?

Here's an attempt; lowercase and uppercase Greek letters are upright, as uppercase Latin letters in math. Everywhere the Libertine font is used, which might give poor results in some cases, as its sidebearings are not really good for math.

\documentclass{article}
\usepackage[libertine]{newtxmath}
\usepackage{libertine}

%%% Set up French style math
\makeatletter
\count@=A
\loop\ifnum\count@<Z
\begingroup\lccodex=\count@
\lowercase{\endgroup\DeclareMathSymbol{x}{\mathalpha}{operators}{x}}
\repeat

% the next is for compatibility with LuaLaTeX
\providecommand{\Umathchardef}{\XeTeXmathchardef}

\AtBeginDocument{
\Umathchardef\Gamma   = "7 "0 "0393
\Umathchardef\Delta   = "7 "0 "0394
\Umathchardef\Theta   = "7 "0 "0398
\Umathchardef\Lambda  = "7 "0 "039B
\Umathchardef\Xi      = "7 "0 "039E
\Umathchardef\Pi      = "7 "0 "03A0
\Umathchardef\Sigma   = "7 "0 "03A3
\Umathchardef\Upsilon = "7 "0 "03A5
\Umathchardef\Phi     = "7 "0 "03A6
\Umathchardef\Psi     = "7 "0 "03A8
\Umathchardef\Omega   = "7 "0 "03A9
}
\@for\next:={alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
mu,nu,xi,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,varepsilon,
vartheta,varrho,varsigma,varphi}\do
{\expandafter\let\csname\next\expandafter\endcsname\csname\next up\endcsname}

\makeatother

\begin{document}

$\alpha A \Gamma$ (αAΓ)

Math: $ABCDEFGHIJKLMNOPQRSTUVWXYZ$

Text: ABCDEFGHIJKLMNOPQRSTUVWXYZ

$\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega$

$I_{n}=J_{n}$

$\displaystyle\int_{\alpha}^{\beta}\Gamma(x)\,dx$
\end{document}


• Thx a lot, how can I get better math font for Libertine ? May 27 '13 at 15:12
• @DamienL As things stand this is what's offered. May 27 '13 at 17:25
• Am I suppose to put this code in LaTeX or XeLaTeX ? May 28 '13 at 23:27
• @DamienL This code works only with XeLaTeX or LuaLaTeX. May 28 '13 at 23:29
\documentclass[a4paper]{scrartcl}
\usepackage{blindtext}
\usepackage{unicode-math}
\usepackage{libertine}
\setmathfont[range={\mathrm,\mathit,\mathup}]{Linux Libertine O}
\setmathfont[range=\mathsf]{Linux Biolinum O}

\begin{document}
\blindtext

$$a^2 + b^2 = c^2 \qquad 1234567890$$

\end{document}

• \sqrt{\int_0^{2\pi} cos t dt} gives a terrible result. May 27 '13 at 15:11

You can use fontspec with the [no-math] option. In this case XeLaTeX and LuaLaTeX will fall back on using legacy math fonts, so you can load newtxmath with the [libertine] option

\documentclass[a4paper]{scrartcl}
\usepackage{blindtext}
\usepackage[no-math]{fontspec}
\setmainfont[
Ligatures=Historic, % ligatures for st, ct
Ligatures=Rare, % ligatures for tz
]
{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\usepackage[libertine]{newtxmath}

\begin{document}
\blindtext

$$a^2 + b^2 = c^2 \qquad 1234567890$$

\end{document}


For french style math typography you may have a look at CTAN: http://www.ctan.org/tex-archive/macros/latex/contrib/smflatex