0

Unfortunately, I am not so good at extracting single characters from the other fonts, so I would like to ask for some help.

I need to import 'u' and 'v', that are used in math mode, from txfonts

enter image description here

I am aware of this answer, but the solution there corrupts other math characters for me. I guess that is because there is no \DeclareFontFamily and \DeclareFontShape to exclude there.

enter image description here

Here is the code I am using

\documentclass{article}

\usepackage{mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{amsmath,amsfonts,amssymb,amsthm,mathtools}
\usepackage{mathabx}
\usepackage{polynom}

\usepackage{xparse}

\DeclareFontFamily{OMX}{MnSymbolE}{}
\DeclareFontShape{OMX}{MnSymbolE}{m}{n}{
    <-6>  MnSymbolE5
    <6-7>  MnSymbolE6
    <7-8>  MnSymbolE7
    <8-9>  MnSymbolE8
    <9-10> MnSymbolE9
    <10-12> MnSymbolE10
    <12->   MnSymbolE12}{}
\DeclareFontShape{OMX}{MnSymbolE}{b}{n}{
    <-6>  MnSymbolE-Bold5
    <6-7>  MnSymbolE-Bold6
    <7-8>  MnSymbolE-Bold7
    <8-9>  MnSymbolE-Bold8
    <9-10> MnSymbolE-Bold9
    <10-12> MnSymbolE-Bold10
    <12->   MnSymbolE-Bold12}{}
\DeclareSymbolFont{mnlargesymbols}{OMX}{MnSymbolE}{m}{n}
\SetSymbolFont{largesymbols}{bold}{OMX}{MnSymbolE}{b}{n}
\DeclareMathDelimiter{\lwavy}{\mathopen}{mnlargesymbols}{'136}{mnlargesymbols}{'136}
\DeclareMathDelimiter{\rwavy}{\mathclose}{mnlargesymbols}{'136}{mnlargesymbols}{'136}


% --- Get fancy 'u' and 'v' --- %
\DeclareSymbolFont{matha}{OML}{txmi}{m}{it}
\DeclareMathSymbol{\varru}{\mathord}{matha}{117}
\DeclareMathSymbol{\varrv}{\mathord}{matha}{118}

\begin{document}

\begin{gather*}
\lambda^3-\lambda^2-5\lambda-3 = 0,\\
(\lambda+1)(\lambda^2-2\lambda-3) = 0,\\
(\lambda+1)(\lambda+1)(\lambda-3) = (\lambda+1)^2(\lambda-3) = 0,\\
\lambda_{1\,[2]}=-1, \qquad \lambda_{2\,[1]} = 3
\\
\\
f(u) = u^2+3u
\end{gather*}

\end{document}

And also I would like to use them nativly, so that I don't need a command for them like \varu, \varv, simply use it straight forward f(u) = u^2 + 3u

CarLaTeX
  • 62,716
antshar
  • 4,238
  • 9
  • 30
  • Please, add a sample document which we can play with: what math font are you using? – egreg May 27 '20 at 17:18
  • @egreg Sure, I've added it. – antshar May 27 '20 at 17:22
  • 2
    What would be the meaning of using two letters from Times in a context where Computer Modern is used? – egreg May 27 '20 at 17:28
  • 1
    I'd like to add my objection to mixing fonts unnecessarily. Aside from the aesthetic, it can cause problems when switching to a journal's class file (if you plan to submit for publication), causing extra work for the production team.. – Fintan May 27 '20 at 17:53
  • You don't seem to be aware that, in traditional math journals set in metal using a Times font, the "v" was substituted by the more round "v" from Century Schoolbook because the Times "v" was too easily confused with the Greek "nu". This is the style copied in Computer Modern. If you are using the "sharp" Times "v". promise that you will never use "nu" in the same document. – barbara beeton May 28 '20 at 01:12

1 Answers1

3

You get very strange symbols because you're redeclaring the symbol font matha, a name which is used by mathabx.

You can change the shape of “u” and ”v” by

\DeclareSymbolFont{mathtx}{OML}{txmi}{m}{it}
\DeclareMathSymbol{u}{\mathalpha}{mathtx}{117}
\DeclareMathSymbol{v}{\mathalpha}{mathtx}{118}

(note the change in the font family name), but the result will be very disputable.

\documentclass{article}

%\usepackage{mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{amsmath,amsfonts,amssymb,amsthm,mathtools}
\usepackage{mathabx}
\usepackage{polynom}

\usepackage{xparse}

\DeclareFontFamily{OMX}{MnSymbolE}{}
\DeclareFontShape{OMX}{MnSymbolE}{m}{n}{
    <-6>  MnSymbolE5
    <6-7>  MnSymbolE6
    <7-8>  MnSymbolE7
    <8-9>  MnSymbolE8
    <9-10> MnSymbolE9
    <10-12> MnSymbolE10
    <12->   MnSymbolE12}{}
\DeclareFontShape{OMX}{MnSymbolE}{b}{n}{
    <-6>  MnSymbolE-Bold5
    <6-7>  MnSymbolE-Bold6
    <7-8>  MnSymbolE-Bold7
    <8-9>  MnSymbolE-Bold8
    <9-10> MnSymbolE-Bold9
    <10-12> MnSymbolE-Bold10
    <12->   MnSymbolE-Bold12}{}
\DeclareSymbolFont{mnlargesymbols}{OMX}{MnSymbolE}{m}{n}
\SetSymbolFont{mnlargesymbols}{bold}{OMX}{MnSymbolE}{b}{n}
\DeclareMathDelimiter{\lwavy}{\mathopen}{mnlargesymbols}{'136}{mnlargesymbols}{'136}
\DeclareMathDelimiter{\rwavy}{\mathclose}{mnlargesymbols}{'136}{mnlargesymbols}{'136}


% --- Get fancy 'u' and 'v' --- %
\DeclareSymbolFont{mathtx}{OML}{txmi}{m}{it}
\DeclareMathSymbol{u}{\mathalpha}{mathtx}{117}
\DeclareMathSymbol{v}{\mathalpha}{mathtx}{118}

\begin{document}

\[
r+u+v+w=\mathrm{horrible}
\]

\begin{gather*}
\lambda^3-\lambda^2-5\lambda-3 = 0,\\
(\lambda+1)(\lambda^2-2\lambda-3) = 0,\\
(\lambda+1)(\lambda+1)(\lambda-3) = (\lambda+1)^2(\lambda-3) = 0,\\
\lambda_{1\,[2]}=-1, \qquad \lambda_{2\,[1]} = 3
\end{gather*}

\end{document}

enter image description here

egreg
  • 1,121,712