2

This is an 'import symbol from a different font' question, but I'm sure its is not duplicated.

I would like to get the upright \varepsilonfrom the \newtxmathpackage. Concretely, I would like to get the symbol ''34 of ntxmia.tfm (I have used `fonttable to find it). My attepms:

1.- Using the code from Import empty set from Computer Modern font:

\DeclareFontFamily{U}{ntxmia}{\hyphenchar\font45}
\DeclareFontShape{U}{ntxmia}{m}{n}{
  <5> <6> <7> <8> <9> <10> gen * matha
  <10.95> ntxmia <12> <14.4> <17.28> <20.74> <24.88> ntxmia
  }{}
\DeclareSymbolFont{ntxmia}{U}{ntxmia}{m}{n}

\DeclareMathSymbol{\varepsilonup}{3}{ntxmia}{"34}

(Once I would had got the symbol I would change the character (i. e. to be a \mathord).

2.- Using the code from Importing a Single Symbol From a Different Font:

\usepackage{pifont}
\makeatletter
\newcommand\Pimathsymbol[3][\mathord]{%
  #1{\@Pimathsymbol{#2}{#3}}}
\def\@Pimathsymbol#1#2{\mathchoice
  {\@Pim@thsymbol{#1}{#2}\tf@size}
  {\@Pim@thsymbol{#1}{#2}\tf@size}
  {\@Pim@thsymbol{#1}{#2}\sf@size}
  {\@Pim@thsymbol{#1}{#2}\ssf@size}}
\def\@Pim@thsymbol#1#2#3{%
  \mbox{\fontsize{#3}{#3}\Pisymbol{#1}{#2}}}
\makeatother

\newcommand{\varepsilonup}{\Pimathsymbol[\mathord]{ntxmia}{"34}}

3.- Using the code from Upright small greek via newtxmath without replacing the math font:

\makeatletter
\let\iftx@libertine\iftrue
\let\iftx@minion\iffalse
\def\ntxmath@scaled{s*[1.02]}
\makeatother
\DeclareSymbolFont{upgreek}{U}{ntxmia}{m}{it}
\SetSymbolFont{upgreek}{bold}{U}{ntxmia}{b}{it}
\DeclareMathSymbol{\deltaup}{\mathord}{upgreek}{14}
\DeclareMathSymbol{\varepsilonup}{\mathord}{upgreek}{34}
\DeclareMathSymbol{\piup}{\mathord}{upgreek}{25}

4.- And using the same code as above but including the lines

\usepackage[type1]{libertine}
\usepackage[libertine]{newtxmath}

Only 4 works, but then I have to use libertine font ands newtxmath math symbols and I don't want. I want to use the usual computer modern font together with symbols provided by the mathabx package.

Any solution?

  • It's decimal 34, not hexadecimal. – egreg Feb 7 '18 at 17:57
  • Oh, sorry. I don't understand anything about all these things... :( – Dog_69 Feb 7 '18 at 17:58
1

It's much easier than that:

\documentclass{article}
\usepackage{amsmath}

\DeclareFontFamily{U}{ntxmia}{\skewchar\font=127 }
\DeclareFontShape{U}{ntxmia}{m}{it}{
  <-> ntxmia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
  <-> txbmia
}{}
\DeclareSymbolFont{ntxmia}{U}{ntxmia}{m}{it}
\SetSymbolFont{ntxmia}{bold}{U}{ntxmia}{m}{it}
\DeclareMathSymbol{\in}{\mathrel}{ntxmia}{34}

\begin{document}

$x\in X$

\end{document}

enter image description here

  • Only one wuestion. What does the number 127 mean? – Dog_69 Feb 7 '18 at 17:57
  • @Dog_69 It's the character used by TeX for kerning math accents. – egreg Feb 7 '18 at 17:57
  • Ahhm... I don't understand anything you say, but don't worry. Thanks again. – Dog_69 Feb 7 '18 at 18:03
0

If using pdflatex, you can just unslant the Computer Modern \varepsilon using pdf special. See Upright Greek font fitting to Computer Modern

\documentclass[a4paper]{article}
\newsavebox{\foobox}
\newcommand{\slantbox}[2][0]{\mbox{%
        \sbox{\foobox}{#2}%
        \hskip\wd\foobox
        \pdfsave
        \pdfsetmatrix{1 0 #1 1}%
        \llap{\usebox{\foobox}}%
        \pdfrestore
}}
\newcommand\unslant[2][-.25]{\slantbox[#1]{$#2$}}

\begin{document}
$x\mathrel{\unslant\varepsilon\!} X$
\end{document}

enter image description here

  • I thought that, but I prefer much more the other varepsilon. Thanks anyway. – Dog_69 Feb 7 '18 at 18:02

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.