9

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.

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}
| improve this answer | |
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}
| improve this answer | |
  • I need the \phiup, not the \Vdash. I wrote the \Vdash just as example how things can go wrong when I use package txfonts – zfm Feb 15 '11 at 0:02
  • @zfm Oops, sorry for the misunderstanding. – Will Robertson Feb 15 '11 at 0:57
  • And savesym package is useful. See also the source code of 'The Comprehensive LaTeX Symbol List'. – Leo Liu Feb 15 '11 at 5:35

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.