10

Is there a way to use a package locally?

Here is the case...

I NEED to use \phiup on my document, however it needs the using of package pxfonts or txfonts. However, when I use either of those packages, it will make the whole documents uglier, u may try writing \Vdash on your document with and without those packages, and see the difference.

That's the point of my question. Can I use the package locally, or in this case, I want that pxfonts (or txfonts) package will be used only when I write \phiup, otherwise I just want to use the normal font.

Caramdir
  • 89,023
  • 26
  • 255
  • 291
zfm
  • 8,987
  • 9
  • 30
  • 21

2 Answers2

10

What about borrowing the definition of the symbol from txfonts.sty?

\documentclass[12pt]{article}
%
\DeclareSymbolFont{lettersA}{U}{txmia}{m}{it}
\DeclareMathSymbol{\phiup}{\mathord}{lettersA}{30}
%
\begin{document}
\begin{equation}
\phi\quad\phiup
\end{equation}
\end{document}
Ian Thompson
  • 43,767
7

No, not in general. It is theoretically possible to write

\begingroup
\usepackage{foo}
\global\let\foocmd\foocmd % access this command only
\endgroup

But packages aren't designed to be loaded like that and it would rarely work correctly.

For upright greek, you can try the upgreek package; with the symbol fonts it'll match what you're seeing in the tx fonts; Palatino users should use its Euler option instead:

\documentclass{article}
\usepackage[Symbol]{upgreek}
\begin{document}
$\phi$ v $\upphi$
\end{document}