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

5
  • 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. May 28 '20 at 1:12
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

6
  • But I do really need mathabx in my project. Is it possible to leave it and make 'u' and 'v' from txfonts work?
    – antshar
    May 27 '20 at 17:37
  • @antshar Did I remove mathabx, perhaps? You were not using it for some symbols, because of the redefinition of matha, which I fixed.
    – egreg
    May 27 '20 at 17:40
  • Ohh... I am so sorry. I copied your code, but ran mine.
    – antshar
    May 27 '20 at 17:43
  • Just perfect! Thank you so much!
    – antshar
    May 27 '20 at 17:44
  • @egreg -- If you are changing the "v", the "w" should also be changed to be visually compatible. May 28 '20 at 1:15

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.