1

I have a text and math document typeset with \usepackage{cochineal} and \usepackage[cochineal]{newtxmath}.

I would like use the cochineal font for text and math, but to replace the greek math font only, with that from usepackage[libertine]{newtxmath}. I tried the following (as per this answer: Changing math fonts for Greek letters) but without succes.

\documentclass[10pt,a4paper]{article}

\usepackage{cochineal}
\usepackage{textcomp}
\usepackage[cochineal]{newtxmath}

\usepackage[T1]{fontenc}

\DeclareSymbolFont{Letters} {OML}{libertine}{m}{n}   %% how to access the [libertine]{newtxmath} here?
\DeclareMathSymbol\Gamma    {\mathalpha}{Letters}{"00}
\DeclareMathSymbol\Delta    {\mathalpha}{Letters}{"01}
% etc
\DeclareMathSymbol{\alpha}  {\mathalpha}{Letters}{"0B}
\DeclareMathSymbol{\beta}   {\mathalpha}{Letters}{"0C}
% etc

\begin{document}

$\alpha, \beta$

\end{document}

2 Answers 2

2

In your example, you don't use the correct encoding for the Libertine font.

Here's an example which uses Cochineal with the greek letters from Libertine. The code which declares the greek letters is based on newtxmath's code.

\documentclass{article}
\usepackage{cochineal}
\usepackage[cochineal]{newtxmath}
\makeatletter
\newif\iflibus@sansmath
\makeatother
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{libertinust1math}{m}{n}
\DeclareSymbolFont{LettersLibertinus}       {LS1}{libertinust1math}{m}{it}
\DeclareSymbolFont{OperatorsLibertinus}     {LS1}{libertinust1math}{m} {n}
\DeclareMathSymbol{\Gamma}     {\mathalpha}{OperatorsLibertinus}{"00}
\DeclareMathSymbol{\Delta}     {\mathalpha}{OperatorsLibertinus}{"01}
\DeclareMathSymbol{\Theta}     {\mathalpha}{OperatorsLibertinus}{"02}
\DeclareMathSymbol{\Lambda}    {\mathalpha}{OperatorsLibertinus}{"03}
\DeclareMathSymbol{\Xi}        {\mathalpha}{OperatorsLibertinus}{"04}
\DeclareMathSymbol{\Pi}        {\mathalpha}{OperatorsLibertinus}{"05}
\DeclareMathSymbol{\Sigma}     {\mathalpha}{OperatorsLibertinus}{"06}
\DeclareMathSymbol{\Upsilon}   {\mathalpha}{OperatorsLibertinus}{"07}
\DeclareMathSymbol{\Phi}       {\mathalpha}{OperatorsLibertinus}{"08}
\DeclareMathSymbol{\Psi}       {\mathalpha}{OperatorsLibertinus}{"09}
\DeclareMathSymbol{\Omega}     {\mathalpha}{OperatorsLibertinus}{"0A}
\DeclareMathSymbol{\alpha}     {\mathalpha}{LettersLibertinus}  {"0B}
\DeclareMathSymbol{\beta}      {\mathalpha}{LettersLibertinus}  {"0C}
\DeclareMathSymbol{\gamma}     {\mathalpha}{LettersLibertinus}  {"0D}
\DeclareMathSymbol{\delta}     {\mathalpha}{LettersLibertinus}  {"0E}
\DeclareMathSymbol{\epsilon}   {\mathalpha}{LettersLibertinus}  {"0F}
\DeclareMathSymbol{\zeta}      {\mathalpha}{LettersLibertinus}  {"10}
\DeclareMathSymbol{\eta}       {\mathalpha}{LettersLibertinus}  {"11}
\DeclareMathSymbol{\theta}     {\mathalpha}{LettersLibertinus}  {"12}
\DeclareMathSymbol{\iota}      {\mathalpha}{LettersLibertinus}  {"13}
\DeclareMathSymbol{\kappa}     {\mathalpha}{LettersLibertinus}  {"14}
\DeclareMathSymbol{\lambda}    {\mathalpha}{LettersLibertinus}  {"15}
\DeclareMathSymbol{\mu}        {\mathalpha}{LettersLibertinus}  {"16}
\DeclareMathSymbol{\nu}        {\mathalpha}{LettersLibertinus}  {"17}
\DeclareMathSymbol{\xi}        {\mathalpha}{LettersLibertinus}  {"18}
\DeclareMathSymbol{\pi}        {\mathalpha}{LettersLibertinus}  {"19}
\DeclareMathSymbol{\rho}       {\mathalpha}{LettersLibertinus}  {"1A}
\DeclareMathSymbol{\sigma}     {\mathalpha}{LettersLibertinus}  {"1B}
\DeclareMathSymbol{\tau}       {\mathalpha}{LettersLibertinus}  {"1C}
\DeclareMathSymbol{\upsilon}   {\mathalpha}{LettersLibertinus}  {"1D}
\DeclareMathSymbol{\phi}       {\mathalpha}{LettersLibertinus}  {"1E}
\DeclareMathSymbol{\chi}       {\mathalpha}{LettersLibertinus}  {"1F}
\DeclareMathSymbol{\psi}       {\mathalpha}{LettersLibertinus}  {"20}
\DeclareMathSymbol{\omega}     {\mathalpha}{LettersLibertinus}  {"21}
\DeclareMathSymbol{\varepsilon}{\mathalpha}{LettersLibertinus}  {"22}
\DeclareMathSymbol{\vartheta}  {\mathalpha}{LettersLibertinus}  {"23}
\DeclareMathSymbol{\varpi}     {\mathalpha}{LettersLibertinus}  {"24}
\DeclareMathSymbol{\varphi}    {\mathalpha}{LettersLibertinus}  {"27}
\begin{document}
\[
\alpha\beta\gamma\delta\epsilon
\varepsilon\zeta\theta\vartheta\eta\iota
\kappa\lambda\mu\nu\xi
\pi\varpi\rho\sigma\tau\upsilon
\phi\varphi\chi\psi\omega
\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Phi\Psi\Omega
\]
\end{document}

To compare, here's the same example without the new definitions of greek letters.

\documentclass{article}
\usepackage{cochineal}
\usepackage[cochineal]{newtxmath}
\begin{document}
\[
\alpha\beta\gamma\delta\epsilon
\varepsilon\zeta\theta\vartheta\eta\iota
\kappa\lambda\mu\nu\xi
\pi\varpi\rho\sigma\tau\upsilon
\phi\varphi\chi\psi\omega
\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Phi\Psi\Omega
\]
\end{document}

1
  • This works exactly as expected, thanks!
    – lab
    Dec 7, 2020 at 8:35
1

This is much easier if you use unicode-math in LuaLaTeX or XeLaTeX, or mathspec in XeLaTeX. The former lets you use \setmathfont[range=it/{greek,Greek}, Scale=MatchLowercase]{Libertinus Math}, and the latter \setmathsfont(Greek){Libertinus}.

There are some publishers who still, in 2020, force you to use legacy 8-bit fonts, but my advice is to use unicode-math in LuaLaTeX when you can, and PDFTeX when you have to.

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.