我在 LaTeX 文档中使用\usepackage{amssymb}
,但我需要一些符号mathabx
。我已关注这些帖子1 2 3这样做。
使用 中的符号时,mathb
一切都正常。但使用 中的符号时mathx
,符号会放置在线下方。如图所示。
我该如何解决?
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{mathb}{}
\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}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareMathSymbol{\leftleftharpoons} {\mathrel}{mathb}{'302}
\DeclareFontFamily{U}{mathx}{}
\DeclareFontShape{U}{mathx}{m}{n}{
<-5.5> mathx5
<5.5-6.5> mathx6
<6.5-7.5> mathx7
<7.5-8.5> mathx8
<8.5-9.5> mathx9
<9.5-11> mathx10
<11-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathSymbol{\rvvs} {\mathrel}{mathx}{'232}
\DeclareMathSymbol{\rvvb} {\mathrel}{mathx}{'252}
\begin{document}
Test test test $a \leftleftharpoons b$. Test test test.
\vspace{1cm}
Test test test $\bigvee_S$. Test test test.
\vspace{1cm}
Test test test $\rvvs_{S}$. Test test test.
\vspace{1cm}
Test test test $\rvvb_{S}$. Test test test.
\end{document}
答案1
这很正常。符号的“大”变体不是要通过插槽调用,而是要通过公制字体文件功能调用。出于某些(严重)原因,Knuth 决定这些“大”变体应该从基线悬挂下来。
您需要手动将它们垂直居中。
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{mathb}{}
\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}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareMathSymbol{\leftleftharpoons}{\mathrel}{mathb}{'302}
\DeclareFontFamily{U}{mathx}{}
\DeclareFontShape{U}{mathx}{m}{n}{
<-5.5> mathx5
<5.5-6.5> mathx6
<6.5-7.5> mathx7
<7.5-8.5> mathx8
<8.5-9.5> mathx9
<9.5-11> mathx10
<11-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathSymbol{\rvvssym}{\mathrel}{mathx}{'232}
\DeclareMathSymbol{\rvvbsym}{\mathrel}{mathx}{'252}
\NewDocumentCommand{\rvvs}{}{\mathxbig{\rvvssym}}
\NewDocumentCommand{\rvvb}{}{\mathxbig{\rvvbsym}}
\makeatletter
\newcommand{\mathxbig}[1]{\mathop{\mathpalette\mathxbig@{#1}}\nolimits}
\newcommand{\mathxbig@}[2]{\vcenter{\hbox{$\m@th#1#2$}}}
\makeatother
\begin{document}
Test test test $a \leftleftharpoons b$. Test test test.
\vspace{1cm}
Test test test $\bigvee_S$. Test test test.
\vspace{1cm}
Test test test $\rvvs_{S}$. Test test test.
\vspace{1cm}
Test test test $\rvvb_{S}$. Test test test.
\end{document}