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.

I wish to use a symbol provided by the package MnSymbol but if I have a \usepackage{MnSymbol} in my document then many other symbols change, including even the equals sign (=), which appears much shorter now.

How can I use a package to just get a few particular symbols without having my entire document in the font that the package imposes?

share|improve this question
3  
Very much related: Importing a Single Symbol From a Different Font –  Werner Nov 24 '11 at 8:32
    
I think there is no explicit relation. The problem occurs very often and so we should provide a more generally answer for MnSymbol. –  Marco Daniel Nov 24 '11 at 9:01
    
Which symbol of the MnSymbol package do you want to use? –  Stephen Nov 24 '11 at 19:02
    
@MarcoDaniel: I don't think a good general answer exists. Moreover, MnSymbol is a bit different: it doesn't provides .fd files, but defines the font families in the .sty file. Then we must copy a lot of code from MnSymbol to the document. –  Leo Liu Nov 24 '11 at 20:36
add comment

1 Answer

Similar questions

It is, my apologies, very difficult to get a symbol from MnSymbol. In the old questions,

Disgard symbols from package (MnSymbol)
The standard \cup vs. the mathabx \cup (mathabx)
Importing a Single Symbol From a Different Font (mathabx)

some similar technique is used to get a symbol from a package — In fact we just redefine the symbol like the font package do.

About MnSymbol

However, in MnSymbol we must define a more things than other packages, as Ulrike Fischer do in her answer. I'll provide another very similar example from another site:

Before reading the explanations below, you'd better have a look at fntguide document.

Assuming you want \rightlsquigarrow from MnSymbol, you must check the source code MnSymbol.sty, then we have

\Decl@Mn@Char\rightlsquigarrow       {MnSyA}{\mathrel}

It's awful! We still do not know which the symbol is. In fact \Decl@Mn@Char is just \DeclareMathSymbol which increase the character number automatically. \rightlsquigarrow is the 160th symbol, thus char code is 160. Or you can use fonttable package to find the code of the glyph. That's to say, \rightlsquigarrow is

\DeclareMathSymbol{\rightlsquigarrow}{\mathrel}{MnSyA}{160}

But before that, you must define MnSyA math family first. Then copy this from MnSymbol.sty:

\DeclareSymbolFont{MnSyA} {U} {MnSymbolA}{m}{n}

For most math font packages, that's enough. But for MnSymbol, the font family MnSymbolA is also defined in MnSymbol.sty, we must copy it to the documents.

\DeclareFontFamily{U} {MnSymbolA}{}

\DeclareFontShape{U}{MnSymbolA}{m}{n}{
  <-6> MnSymbolA5
  <6-7> MnSymbolA6
  <7-8> MnSymbolA7
  <8-9> MnSymbolA8
  <9-10> MnSymbolA9
  <10-12> MnSymbolA10
  <12-> MnSymbolA12}{}
\DeclareFontShape{U}{MnSymbolA}{b}{n}{
  <-6> MnSymbolA-Bold5
  <6-7> MnSymbolA-Bold6
  <7-8> MnSymbolA-Bold7
  <8-9> MnSymbolA-Bold8
  <9-10> MnSymbolA-Bold9
  <10-12> MnSymbolA-Bold10
  <12-> MnSymbolA-Bold12}{}

Now, if we don't know \rightlsquigarrow is actually the 160th symbol, we can use a small test file to check the glyph table:

\documentclass{article}
\usepackage{fonttable}
\begin{document}
\fonttable{MnSymbolA10}
\end{document}

A picture for fonttable

After all of this, you know exactly what \rightlsquigarrow is, and you can use it as this:

enter image description here

\documentclass{article}

\DeclareFontFamily{U} {MnSymbolA}{}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
  <-6> MnSymbolA5
  <6-7> MnSymbolA6
  <7-8> MnSymbolA7
  <8-9> MnSymbolA8
  <9-10> MnSymbolA9
  <10-12> MnSymbolA10
  <12-> MnSymbolA12}{}
\DeclareFontShape{U}{MnSymbolA}{b}{n}{
  <-6> MnSymbolA-Bold5
  <6-7> MnSymbolA-Bold6
  <7-8> MnSymbolA-Bold7
  <8-9> MnSymbolA-Bold8
  <9-10> MnSymbolA-Bold9
  <10-12> MnSymbolA-Bold10
  <12-> MnSymbolA-Bold12}{}

\DeclareSymbolFont{MnSyA} {U} {MnSymbolA}{m}{n}

\DeclareMathSymbol{\rightlsquigarrow}{\mathrel}{MnSyA}{160}

\begin{document}

$\rightlsquigarrow$

\end{document}
share|improve this answer
5  
+1 I think this is a great answer. –  Marco Daniel Nov 24 '11 at 22:39
    
Thanks for a very clear and useful answer! I hope the MnSybol would one day be re-written to allow importing single symbols, or not to ruin symbols from other packages. –  Ran G. Oct 1 '13 at 9:55
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.