2

I'm looking to use the vvarbb style blackboard bold font from newpxmath but use eulervm for all other math. Unfortunately it seems that eulerpx doesn't support the vvarbb option. Is there a way to load newpxmath only for the blackboard bold font?

Here's a MWE with the issues with each setting:

\documentclass[12pt]{article}

% setting 1
\usepackage[vvarbb]{newpxmath}
\usepackage{eulervm}

% setting 2
%\usepackage{eulervm}
%\usepackage[vvarbb]{newpxmath}

% setting 3
%\usepackage{newpxtext}
%\usepackage{eulerpx}

\begin{document}
$\sum a, a\in \mathbb{R}$ 
\begin{itemize}
    \item The \verb|\sum| doesn't display correctly with setting 1
    \item The $a$ isn't in \verb|euler| with setting 2
    \item The \verb|\mathbb{R}| isn't in the correct sans-serif font with setting 3, and there's no way to specify \verb|vvarbb| in \verb|eulerpx|
\end{itemize}
\end{document}


2 Answers 2

0

In newpxmath we find

\DeclareOption{vvarbb}{\px@vvarbbtrue}

Looking for \px@vvarbbtrue we see

% Changed macros which are not limited to a single character, and can include digits, \imath, \jmath
\def\px@@vvbb#1#2\@nil{%
        \ifiscseq{#1}{\ifcsdef{px@Bbb\@xp\@gobble\string#1}{\csname px@Bbb\@xp\@gobble\string#1\endcsname}{#1}}{%not a cs
        \csname px@Bbb#1\endcsname}
        \ifblank{#2}{\relax}{\px@@vvbb #2\@nil}}

\DeclareRobustCommand*{\vvmathbb}[1]{\px@@vvbb#1\@nil}
\ifpx@vvarbb
  \let\mathbb\vvmathbb
\else
  \ifpx@varbb
    \let\mathbb\vmathbb
  \else
    \ifpx@ams\else\let\mathbb\vmathbb\fi
  \fi
\fi

What's this? The letters for \vvmathbb aren't in their standard ASCII position, so the code changes \vvmathbb{A} into \px@BbbA and similarly for other codes: an example is

\DeclareMathSymbol{\px@BbbA}{\mathord}{lettersA}{193}

Digits, uppercase and lowercase letters are defined together with \imath and \jmath. There are also \Gamma, \gamma, \Pi and \pi.

OK, for the moment we need to see what lettersA is.

\DeclareSymbolFont{lettersA}{U}{npxmia}{m}{it}
\SetSymbolFont{lettersA}{bold}{U}{npxmia}{b}{it}
\DeclareFontSubstitution{U}{npxmia}{m}{it}

In the following code I use a more robust processor for the contents of \mathbb. Digits and the four Greek letters are not included, but can if needed.

\documentclass{article}
\usepackage{tgpagella}% for Palatino
\usepackage{eulervm}

\makeatletter
% code for vvarbb
\AtBeginDocument{\newcommand{\mathbb}{\vvarbb}}

% the processing macro
\ExplSyntaxOn
\NewDocumentCommand{\vvarbb}{m}
 {
  \tl_map_function:nN { #1 } \__egreg_vvarbb:n
 }
\cs_new_protected:Nn \__egreg_vvarbb:n
 {
  \token_if_cs:NTF #1
   {% the next token is a control sequence
    \str_case_e:nnF { \cs_to_str:N #1 }
     {
      {imath}{\vvarbb@Bbbimath}
      {jmath}{\vvarbb@Bbbjmath}
      % maybe add Gamma,gamma,Pi,pi
     }
    {#1}% not defined, just output it
   }
   {% not a control sequence
    \cs_if_exist_use:cF { vvarbb@Bbb#1 } { #1 }
   }
 }
\ExplSyntaxOff

% define the math font
\DeclareSymbolFont{vvarbb}{U}{npxmia}{m}{it}
\SetSymbolFont{vvarbb}{bold}{U}{npxmia}{b}{it}
\DeclareFontSubstitution{U}{npxmia}{m}{it}

% define the symbols
\DeclareMathSymbol{\vvarbb@BbbA}{\mathord}{vvarbb}{193}
\DeclareMathSymbol{\vvarbb@BbbB}{\mathord}{vvarbb}{194}
\DeclareMathSymbol{\vvarbb@BbbC}{\mathord}{vvarbb}{195}
\DeclareMathSymbol{\vvarbb@BbbD}{\mathord}{vvarbb}{196}
\DeclareMathSymbol{\vvarbb@BbbE}{\mathord}{vvarbb}{197}
\DeclareMathSymbol{\vvarbb@BbbF}{\mathord}{vvarbb}{198}
\DeclareMathSymbol{\vvarbb@BbbG}{\mathord}{vvarbb}{199}
\DeclareMathSymbol{\vvarbb@BbbH}{\mathord}{vvarbb}{200}
\DeclareMathSymbol{\vvarbb@BbbI}{\mathord}{vvarbb}{201}
\DeclareMathSymbol{\vvarbb@BbbJ}{\mathord}{vvarbb}{202}
\DeclareMathSymbol{\vvarbb@BbbK}{\mathord}{vvarbb}{203}
\DeclareMathSymbol{\vvarbb@BbbL}{\mathord}{vvarbb}{204}
\DeclareMathSymbol{\vvarbb@BbbM}{\mathord}{vvarbb}{205}
\DeclareMathSymbol{\vvarbb@BbbN}{\mathord}{vvarbb}{206}
\DeclareMathSymbol{\vvarbb@BbbO}{\mathord}{vvarbb}{207}
\DeclareMathSymbol{\vvarbb@BbbP}{\mathord}{vvarbb}{208}
\DeclareMathSymbol{\vvarbb@BbbQ}{\mathord}{vvarbb}{209}
\DeclareMathSymbol{\vvarbb@BbbR}{\mathord}{vvarbb}{210}
\DeclareMathSymbol{\vvarbb@BbbS}{\mathord}{vvarbb}{211}
\DeclareMathSymbol{\vvarbb@BbbT}{\mathord}{vvarbb}{212}
\DeclareMathSymbol{\vvarbb@BbbU}{\mathord}{vvarbb}{213}
\DeclareMathSymbol{\vvarbb@BbbV}{\mathord}{vvarbb}{214}
\DeclareMathSymbol{\vvarbb@BbbW}{\mathord}{vvarbb}{215}
\DeclareMathSymbol{\vvarbb@BbbX}{\mathord}{vvarbb}{216}
\DeclareMathSymbol{\vvarbb@BbbY}{\mathord}{vvarbb}{217}
\DeclareMathSymbol{\vvarbb@BbbZ}{\mathord}{vvarbb}{218}

\DeclareMathSymbol{\vvarbb@Bbba}{\mathord}{vvarbb}{225}
\DeclareMathSymbol{\vvarbb@Bbbb}{\mathord}{vvarbb}{226}
\DeclareMathSymbol{\vvarbb@Bbbc}{\mathord}{vvarbb}{227}
\DeclareMathSymbol{\vvarbb@Bbbd}{\mathord}{vvarbb}{228}
\DeclareMathSymbol{\vvarbb@Bbbe}{\mathord}{vvarbb}{229}
\DeclareMathSymbol{\vvarbb@Bbbf}{\mathord}{vvarbb}{230}
\DeclareMathSymbol{\vvarbb@Bbbg}{\mathord}{vvarbb}{231}
\DeclareMathSymbol{\vvarbb@Bbbh}{\mathord}{vvarbb}{232}
\DeclareMathSymbol{\vvarbb@Bbbi}{\mathord}{vvarbb}{233}
\DeclareMathSymbol{\vvarbb@Bbbj}{\mathord}{vvarbb}{234}
\DeclareMathSymbol{\vvarbb@Bbbk}{\mathord}{vvarbb}{235}
\DeclareMathSymbol{\vvarbb@Bbbl}{\mathord}{vvarbb}{236}
\DeclareMathSymbol{\vvarbb@Bbbm}{\mathord}{vvarbb}{237}
\DeclareMathSymbol{\vvarbb@Bbbn}{\mathord}{vvarbb}{238}
\DeclareMathSymbol{\vvarbb@Bbbo}{\mathord}{vvarbb}{239}
\DeclareMathSymbol{\vvarbb@Bbbp}{\mathord}{vvarbb}{240}
\DeclareMathSymbol{\vvarbb@Bbbq}{\mathord}{vvarbb}{241}
\DeclareMathSymbol{\vvarbb@Bbbr}{\mathord}{vvarbb}{242}
\DeclareMathSymbol{\vvarbb@Bbbs}{\mathord}{vvarbb}{243}
\DeclareMathSymbol{\vvarbb@Bbbt}{\mathord}{vvarbb}{244}
\DeclareMathSymbol{\vvarbb@Bbbu}{\mathord}{vvarbb}{245}
\DeclareMathSymbol{\vvarbb@Bbbv}{\mathord}{vvarbb}{246}
\DeclareMathSymbol{\vvarbb@Bbbw}{\mathord}{vvarbb}{247}
\DeclareMathSymbol{\vvarbb@Bbbx}{\mathord}{vvarbb}{248}
\DeclareMathSymbol{\vvarbb@Bbby}{\mathord}{vvarbb}{249}
\DeclareMathSymbol{\vvarbb@Bbbz}{\mathord}{vvarbb}{250}
\DeclareMathSymbol{\vvarbb@Bbbimath}{\mathord}{vvarbb}{125}
\DeclareMathSymbol{\vvarbb@Bbbjmath}{\mathord}{vvarbb}{126}

\makeatother

\begin{document}

\[
\sum a, a\in \mathbb{R}
\]
\[
\mathbb{ABCdefi\imath\jmath}
\]

\end{document}

enter image description here

0

Run with xelatex or lualatex

\documentclass[12pt]{article}
\usepackage{neo-euler} 
\begin{document}

\[ \sum a, a\in \symbb{R} \]
\[ \symbb{ABCdefi} \]
\[ \sum a, a\in \BbbR \]

\end{document}

enter image description here

You must log in to answer this question.

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