6

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?

3 Answers 3

4

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}
\AtBeginDocument{\addfontfeatures{Ligatures=Historic}}

%%% Set up French style math
\makeatletter
\count@=`A
\advance\count@\m@ne
\loop\ifnum\count@<`Z
  \advance\count@\@ne
  \begingroup\lccode`x=\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}

The story is about
$\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}

enter image description here

4
  • Thx a lot, how can I get better math font for Libertine ?
    – Damien L
    May 27, 2013 at 15:12
  • @DamienL As things stand this is what's offered.
    – egreg
    May 27, 2013 at 17:25
  • Am I suppose to put this code in LaTeX or XeLaTeX ?
    – Damien L
    May 28, 2013 at 23:27
  • @DamienL This code works only with XeLaTeX or LuaLaTeX.
    – egreg
    May 28, 2013 at 23:29
3
\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

\begin{equation}
     a^2 + b^2 = c^2 \qquad 1234567890
\end{equation}

\end{document}
1
  • \sqrt{\int_0^{2\pi} cos t dt} gives a terrible result.
    – Damien L
    May 27, 2013 at 15:11
0

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

\begin{equation}
     a^2 + b^2 = c^2 \qquad 1234567890
\end{equation}

\end{document}

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .