A comment up front: The txfonts
package, which provides both text and math fonts, has been superseded for several years now by a pair of packages: newtxtext
and newtxmath
. I can see no good reason for using the txfonts
package if the vintage of your TeX distribution is more recent than, say, 2012.
If you can at all switch to LuaLaTeX, it becomes very straightforward to handle almost any number of math fonts side-by-side within a single document. Indeed, for what you appear to have in mind, something like the following setup is entirely sufficient:
\usepackage[no-math]{fontspec}
\setmainfont{STIX Two Text}[Numbers={OldStyle,Proportional}]
\usepackage{unicode-math}
\setmathfont{STIX Two Math}
The "STIX Two" text and math fonts may be downloaded free of charge from https://sourceforge.net/projects/stixfonts/
A full MWE (the use of "old-style", proportional-width text-mode numerals is optional):
% !TeX program = lualatex
\documentclass{article}
\usepackage[no-math]{fontspec}
\setmainfont{STIX Two Text}[Numbers={OldStyle,Proportional}]
\usepackage{unicode-math}
\setmathfont{STIX Two Math}
% macros for characteristic functions and power classes of sets
\newcommand\cfset[1]{\mathit{1}_{\mkern-1.5mu#1}}
\newcommand\pcset[1]{\mathit{2}^{#1}}
\begin{document}
0123456789abcdef % text: oldstyle numerals, proportional width
$0123456789abcdef$ % math: lining style numerals, fixed width
$\mathit{0123456789abcdef}$ "\mathit" automatically uses Latin Modern glyphs
$\cfset{K}$ $\pcset{\varpi}$
\end{document}
\mathit
not\textit
then you may get what you ask for already if you are only using newtxtext and not newtxmath\mathit{1}
doesn't seem to produce what I desire.txfonts
sets the math mode in times too. So,\mathit{1}
and\textit{1}
are (visually) identical.\mathit
is the thing to use in any case\mathit
gives a fixed font from the math setup,\textit
will give you whatever italic font is current in that part of the text. and won't get smaller in subscripts unless amsmath is used.\it
in any case. It is long obsolete in LaTeX.