While this answer also imports the symbol from MnSymbol font, it offers two significant improvements.
First, as many have noted in other answers on this site, using the MnSymbol
package changes many glyphs, which is often not wanted. So the approach often mentioned is to import just the desired glyphs from MnSymbol
, leaving all the others intact.
The "value added" I provide here, since that approach seems to be used frequently, is to introduce three macros
\ImportFromMnSymbol{<family>}
\DeclareMnSymbol{<macro-name>}{<type>}{<family>}{<glyph-slot>}
\MnSymbolGlyphs{<family>}% EXECUTED IN THE PREAMBLE
The \DeclareMnSymbol
macro is analogous to the \DeclareMathSymbol
macro, except the 3rd argument is merely the MnSymbol
family, such as A
or B
, etc. The Glyph slot can be given in decimal, 'octal, or "hexidecimal.
The \MnSymbolGlyphs
macro, executed in the preamble, shows the font table for the desired MnSymbol
family as the first thing in the document. This allows one to locate particular glyphs and their slot numbers.
So in this example, once the above macros are defined, if I wanted to use the MnSymbol
glyph directly, the usage would be
\ImportFromMnSymbol{A}
\DeclareMnSymbol{\ConIndep}{\mathrel}{A}{225}
Multiple glyphs can be imported from a single family by repeated invocation of \DeclareMnSymbol
. Of course, the \ImportFromMnSymbol
macro must be invoked for the family, prior to declaring symbols from that family.
But here is the second improvement. The MnSymbol
representing the desired glyph is too small vertically. So I use the scalerel
package to scale the desired glyph to the proper size, while keeping it compatible with the current math style.
In the MWE below, I include the commented line employing \MnSymbolGlyphs
, which can be uncommented/edited to explore the available glyphs of MnSymbol.
\documentclass{article}
\usepackage{scalerel}
\def\MnSymbolGlyphs#1{% IF ONE NEEDS TO LOCATE GLYPHS
\usepackage{MnSymbol,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{A}
\DeclareMnSymbol{\ConIndepNat}{\mathrel}{A}{225}
\def\ConIndep{\mathrel{\scalerel*{\ConIndepNat}{X}}}
%\MnSymbolGlyphs{A}
\begin{document}
$A \ConIndepNat B$ as imported from MnSymbol\par
$A \ConIndep B$ scaled to height of X\par
$A \ConIndep B\quad\scriptstyle A \ConIndep B\quad\scriptscriptstyle A \ConIndep B$
autoscaling to math style
\end{document}