![如何获得不带长笔画的变体 \boxtimes](https://linux22.com/image/467995/%E5%A6%82%E4%BD%95%E8%8E%B7%E5%BE%97%E4%B8%8D%E5%B8%A6%E9%95%BF%E7%AC%94%E7%94%BB%E7%9A%84%E5%8F%98%E4%BD%93%20%5Cboxtimes.png)
答案1
答案2
你可能加载mathabx
,但这会改变全部数学符号。
如果我们仔细观察,mathabx.dcl
就会发现
\DeclareMathSymbol{\boxtimes}{2}{mathb}{"62}
其中,2
表示\mathbin
、mathb
是符号字体的名称,"62
是插槽。
现在我们来mathabx.sty
看看
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{
<5> <6> <7> <8> <9> <10> gen * mathb
<10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}
但我们可以对其进行修改,以获得完全可扩展的字体。
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{mathb}{}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareFontShape{U}{mathb}{m}{n}{
<-5.5> mathb5
<5.5-6.5> mathb6
<6.5-7.5> mathb7
<7.5-8.5> mathb8
<8.5-9.5> mathb9
<9.5-11> mathb10
<11-> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareMathSymbol{\boxtimes}{\mathbin}{mathb}{"62}
\begin{document}
$a\boxtimes b$
\end{document}
我还提出了一种替代方法,展示了可用符号之间的比较。
\documentclass{article}
\usepackage{amsmath,amssymb}
\NewCommandCopy{\origboxtimes}{\boxtimes}
\DeclareFontFamily{U}{mathb}{}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareFontShape{U}{mathb}{m}{n}{
<-5.5> mathb5
<5.5-6.5> mathb6
<6.5-7.5> mathb7
<7.5-8.5> mathb8
<8.5-9.5> mathb9
<9.5-11> mathb10
<11-> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareMathSymbol{\boxtimes}{\mathbin}{mathb}{"62}
\makeatletter
\newcommand{\varboxtimes}{\mathbin{\mathpalette\varboxtimes@\relax}}
\newcommand{\varboxtimes@}[2]{%
\begingroup
\sbox\z@{$\m@th\vcenter{\hbox{$#1\Box$}}$}%
\vphantom{\usebox\z@}%
\ooalign{\hidewidth$\m@th#1\times$\hidewidth\cr\usebox\z@\cr}%
\endgroup
}
\makeatother
\begin{document}
$a\boxtimes b \varboxtimes c \origboxtimes d$
\end{document}