2

I'm using \usepackage{amssymb} in my LaTeX document, but I need a few symbols from the mathabx. I have followed these posts 1 2 3 to do so.

When using symbols from mathb everything works fine. But when using symbols from mathx, the symbols are placed below the line. As shown in the image.

How do I fix this?

enter image description here

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

sky_e
  • 23

1 Answers1

3

That's normal. The “big“ variants for symbols are not meant to be called by slot, but by metric font file features. For some (serious) reasons, Knuth decided that these “big” variants should hang from the baseline.

You need to vertically center them manually.

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

enter image description here

egreg
  • 1,121,712