如何从 MnSymbol 导入几何二元算子?

如何从 MnSymbol 导入几何二元算子?

我有一个文档,其中我加载了amssymbmnsymbol包。但是,后一个包会覆盖并缩短前一个包中的一些符号(例如,,,,=等),而我并不想这样。我知道我可以使用和来使用来自的原始符号,但我实际上更愿意导入的整个几何二元运算符集,这实际上是我从该包中需要的唯一一组符号。有人能告诉我如何实现吗?\approx\langle\rangledeclaresymbolfontdeclaremathfontamssymbmnsymbol

答案1

实际上,我不需要整个几何二元运算符集,而只需要一个子集。接下来,一个非常基本的 MWE,基于 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}

[以下由 Segletes 编辑]

以下是使用提供的简化宏的稍微修改的版本创建带有破折号的菱形

\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}

在此处输入图片描述

相关内容