1

I'm currently typesetting a document with Palatino as main font and eulervm as math font. I really do not like Palatino numbers so I typically use math mode to write number. This however to not apply to bibliography and numbers produced by \href (e.g. \ref{fig}). Is there a way to force eulervm numbers over palatino ones everywhere?

Thanks.

1
  • Welcome. Do you can add a complete fragment + one screenshot of your problem? Thanks.
    – Sebastiano
    Nov 25, 2020 at 22:10

1 Answer 1

4

In the Modern Toolchain

There is a free, OpenType version of Euler by Khaled Hosny and Hermann Zapf. I usually pair it with Zapf’s Palatino and Optima, with Rapf Levien’s Inconsolata as a humanist monospace font. This set-up also lets you typeset upright constants in Euler, such as \symup{e} or \symup{i}.

This sample uses as its sans-serif font URW Classico, a clone of Optima available on CTAN but that is not part of the distribution because of a restrictive license.

You might need to download some fonts to compile this MWE, but all you need to use Euler digits are the definitions of \euler and \texteuler.

This requires LuaLaTex or XeLaTeX.

\documentclass{article}
\usepackage{titlesec}
\usepackage{unicode-math}

\pagestyle{empty}
\defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX }

\setmainfont{TeX Gyre Pagella}[Scale=1.0]
\setsansfont{URW Classico}
\setmonofont{Inconsolata}[
  UprightFont = *N-Regular ,
  BoldFont = *N-Bold ,
  ItalicFont = *zi4-Regular ,
  BoldItalicFont = *zi4-Bold ,
  Extension = .otf ]
\setmathfont{TeX Gyre Pagella Math}
\setmathfont{Neo Euler}[range={up,bfup,cal,bfcal,frak,bffrak},
                        script-features={},
                        sscript-features={}]
\newfontfamily\euler{Neo Euler}

\DeclareTextFontCommand\texteuler{\euler}
\titlelabel{\texteuler{\thetitle}\quad}

\begin{document}
\section{First Section}\label{sec:one}

This is Section \texteuler{\ref{sec:one}}.
\end{document}

Pagella/Neo Euler sample

In the Legacy Toolchain

This version is similar to the above, but uses the Type 1 versions of the same fonts. It compiles in PDFTeX, should you be required to use it. You will need to download URW Classico or replace that package.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage{titlesec}
\usepackage{eulerpx, tgpagella, classico, inconsolata}

\pagestyle{empty}

\newcommand\euler{\fontencoding{U}\fontfamily{zeur}\selectfont}
\DeclareTextFontCommand\texteuler{\euler}
\titlelabel{\texteuler{\thetitle}\quad}

\begin{document}
\section{First Section}\label{sec:one}

This is Section \texteuler{\ref{sec:one}}.
\end{document}

Tgpagella/eulervm sample

5
  • Hi, thanks for the examples. Unfortunately I am using a fairly complex template (classic thesis) and I am 200 pages into my dissertation. I'm not sure I want do to something intrusive as changing all of my fonts. Nov 25, 2020 at 23:04
  • @AlbertoBragagnolo Okay. If you just copy the definitions of \euler and \texteuler, wrapping your numbers in \texteuler will work, without changing any of your other fonts.
    – Davislor
    Nov 25, 2020 at 23:48
  • 2
    @AlbertoBragagnolo In other words, consider my font selections just a suggestion.
    – Davislor
    Nov 25, 2020 at 23:49
  • thanks, I will try. However, I do not think is the solution i'm looking for. This approach is not applicable in various cases, such as: \autoref{}, figures/table numbers, large chunks of copy-pasted biblatex entries. I was hoping that was a way to substitute automatically the font for the text number. Nov 26, 2020 at 0:25
  • @AlbertoBragagnolo It works fine if you add a bit of formatting. If you really want every digit to be replaced by Euler automatically, you can use \XeTeXinterchartoks.
    – Davislor
    Nov 26, 2020 at 0:37

You must log in to answer this question.

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