Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

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}
share|improve this answer
add comment

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}
share|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
    
these are also good... thanks Will and Liu! –  zfm Feb 15 '11 at 9:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.