1

I have a document in which I load both the amssymb and mnsymbol packages. However, the latter package overwrites and shortens some symbols from the former package (like =, \approx, \langle, \rangle, etc.), and I don't want that. I know I can use declaresymbolfont and declaremathfont to use the original symbols from amssymb, but I would actually prefer to import the whole set of geometric binary operators of mnsymbol, which is actually the only set of symbols I need from that package. Can someone please tell me how I can achieve that?

4
  • 1
    thanks a lot Steven! I haven't understood in detail yet how the fonttable package works, but I understood enough to solve the problem. For completeness, I will post a MWE with my own answer to my own question..............
    – Euclides
    Mar 2 '20 at 21:10
  • 1
    See also my answer here, tex.stackexchange.com/questions/450691/…, for cases where you wish to import a larger number of MnSymbol glyphs. Mar 2 '20 at 21:12
  • OK. Thanks again Steven. I'll have a look at your code at some point and use it in case it's considerably less artisanal than mine, but on a first glance, it doesn't look like it, with the exception perhaps of the glyph location lines..............
    – Euclides
    Mar 2 '20 at 21:36
2

Actually, I don't need the whole set of geometric binary operators, but only a subset. Next, a very basic MWE, based on the first example provided above by Steven:

\documentclass{article}
\DeclareFontFamily{U} {MnSymbolC}{}

\DeclareFontShape{U}{MnSymbolC}{m}{n}{
  <-6> MnSymbolC5
  <6-7> MnSymbolC6
  <7-8> MnSymbolC7
  <8-9> MnSymbolC8
  <9-10> MnSymbolC9
  <10-12> MnSymbolC10
  <12-> MnSymbolC12}{}
\DeclareFontShape{U}{MnSymbolC}{b}{n}{
  <-6> MnSymbolC-Bold5
  <6-7> MnSymbolC-Bold6
  <7-8> MnSymbolC-Bold7
  <8-9> MnSymbolC-Bold8
  <9-10> MnSymbolC-Bold9
  <10-12> MnSymbolC-Bold10
  <12-> MnSymbolC-Bold12}{}

\DeclareSymbolFont{MnSyC} {U} {MnSymbolC}{m}{n}

\DeclareMathSymbol{\smalltriangleright}{\mathbin}{MnSyC}{72}
\DeclareMathSymbol{\smalltriangleup}{\mathbin}{MnSyC}{73}
\DeclareMathSymbol{\smalltriangleleft}{\mathbin}{MnSyC}{74}
\DeclareMathSymbol{\smalltriangledown}{\mathbin}{MnSyC}{75}
\DeclareMathSymbol{\filledtriangleright}{\mathbin}{MnSyC}{76}
\DeclareMathSymbol{\filledtriangleup}{\mathbin}{MnSyC}{77}
\DeclareMathSymbol{\filledtriangleleft}{\mathbin}{MnSyC}{78}
\DeclareMathSymbol{\filledtriangledown}{\mathbin}{MnSyC}{79}
\DeclareMathSymbol{\smallsquare}{\mathbin}{MnSyC}{104}
\DeclareMathSymbol{\filledsquare}{\mathbin}{MnSyC}{105}
\DeclareMathSymbol{\smalldiamond}{\mathbin}{MnSyC}{108}
\DeclareMathSymbol{\filleddiamond}{\mathbin}{MnSyC}{109}
\DeclareMathSymbol{\smallstar}{\mathbin}{MnSyC}{128}
\DeclareMathSymbol{\filledstar}{\mathbin}{MnSyC}{129}
\DeclareMathSymbol{\thinstar}{\mathbin}{MnSyC}{134}

\usepackage{fonttable}

\begin{document}
\centering
$\smalltriangleright$
$\smalltriangleup$
$\smalltriangleleft$
$\smalltriangledown$
$\filledtriangleright$
$\filledtriangleup$
$\filledtriangleleft$
$\filledtriangledown$
$\smallsquare$
$\filledsquare$
$\smalldiamond$
$\filleddiamond$
$\smallstar$
$\filledstar$
$\thinstar$

$\approx$ % not overwritten by MnSymbol
$=$ % not overwritten by MnSymbol
$\langle$ % not overwritten by MnSymbol
$\rangle$ % not overwritten by MnSymbol

\clearpage\fonttable{MnSymbolC10}
\end{document}

[EDIT by Segletes follows]

Here is a slightly altered version using the simplifying macros provided in Create diamond with a dash in it

\documentclass{article}
%%%% COPIED FROM https://tex.stackexchange.com/questions/450691/create-diamond-with-a-dash-in-it/450703#450703
\def\MnSymbolGlyphs#1{% IF ONE NEEDS TO LOCATE GLYPHS
  \usepackage{fonttable}%
  \AtBeginDocument{\fonttable{MnSymbol#110}}%
}
\def\ImportFromMnSymbol#1{%
  \DeclareFontFamily{U} {MnSymbol#1}{}
  \DeclareFontShape{U}{MnSymbol#1}{m}{n}{
   <-6> MnSymbol#15
   <6-7> MnSymbol#16
   <7-8> MnSymbol#17
   <8-9> MnSymbol#18
   <9-10> MnSymbol#19
   <10-12> MnSymbol#110
   <12-> MnSymbol#112}{}
  \DeclareFontShape{U}{MnSymbol#1}{b}{n}{
   <-6> MnSymbol#1-Bold5
   <6-7> MnSymbol#1-Bold6
   <7-8> MnSymbol#1-Bold7
   <8-9> MnSymbol#1-Bold8
   <9-10> MnSymbol#1-Bold9
   <10-12> MnSymbol#1-Bold10
   <12-> MnSymbol#1-Bold12}{}
  \DeclareSymbolFont{MnSy#1} {U} {MnSymbol#1}{m}{n}
}
\newcommand\DeclareMnSymbol[4]{\DeclareMathSymbol{#1}{#2}{MnSy#3}{#4}}
%%%%
\ImportFromMnSymbol{C}

\DeclareMnSymbol{\smalltriangleright}{\mathbin}{C}{72}
\DeclareMnSymbol{\smalltriangleup}{\mathbin}{C}{73}
\DeclareMnSymbol{\smalltriangleleft}{\mathbin}{C}{74}
\DeclareMnSymbol{\smalltriangledown}{\mathbin}{C}{75}
\DeclareMnSymbol{\filledtriangleright}{\mathbin}{C}{76}
\DeclareMnSymbol{\filledtriangleup}{\mathbin}{C}{77}
\DeclareMnSymbol{\filledtriangleleft}{\mathbin}{C}{78}
\DeclareMnSymbol{\filledtriangledown}{\mathbin}{C}{79}
\DeclareMnSymbol{\smallsquare}{\mathbin}{C}{104}
\DeclareMnSymbol{\filledsquare}{\mathbin}{C}{105}
\DeclareMnSymbol{\smalldiamond}{\mathbin}{C}{108}
\DeclareMnSymbol{\filleddiamond}{\mathbin}{C}{109}
\DeclareMnSymbol{\smallstar}{\mathbin}{C}{128}
\DeclareMnSymbol{\filledstar}{\mathbin}{C}{129}
\DeclareMnSymbol{\thinstar}{\mathbin}{C}{134}

%\MnSymbolGlyphs{C}% TO DISPLAY WITH fonttable
\begin{document}
\clearpage
\centering
$\smalltriangleright$
$\smalltriangleup$
$\smalltriangleleft$
$\smalltriangledown$
$\filledtriangleright$
$\filledtriangleup$
$\filledtriangleleft$
$\filledtriangledown$
$\smallsquare$
$\filledsquare$
$\smalldiamond$
$\filleddiamond$
$\smallstar$
$\filledstar$
$\thinstar$

$\approx$ % not overwritten by MnSymbol
$=$ % not overwritten by MnSymbol
$\langle$ % not overwritten by MnSymbol
$\rangle$ % not overwritten by MnSymbol
\end{document}

enter image description here

4
  • I took the liberty of editing your answer to show how to use those macros cited in the other answer. If you object, you or I can roll back the answer to the prior version. Mar 2 '20 at 21:48
  • nothing against, but for some reason the \approx, =, \langle, and \rangle coming out of your edit are actually being overwritten by MnSymbol..............
    – Euclides
    Mar 2 '20 at 22:06
  • Sorry about that. It happened because I created the \fonttable at the beginning of the document, which had to load MnSymbol via \MnSymbolGlyphs. I commented out that line from my MWE, and the other glyphs reverted. Mar 3 '20 at 0:19
  • Looks like we now have yet another, reasonably automated, didactic MWE showing how to import sets of glyphs without affecting glyphs loaded by other packages, for those that might need it.............. Great! I cannot vote for "my own" answer yet. I'll do that tomorrow. Thanks a lot again and best regards Steven!
    – Euclides
    Mar 3 '20 at 8:14

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.