将两个数学符号直接设置在彼此上方并垂直对齐

将两个数学符号直接设置在彼此上方并垂直对齐

我正在排版 Neyman Pearson 决策规则,想将大于>和小于<符号直接设置在彼此上方。我试过了\overset,但结果两个符号并没有垂直对齐到中间。

答案1

当然,总是\gtrless

\usepackage{amssymb}% http://ctan.org/pkg/amssymb

如果你不想使用包,你可以自己“覆盖”符号:

在此处输入图片描述

\documentclass{article}
\newcommand{\npsym}{%
  \mathrel{\ooalign{\raisebox{.6ex}{$>$}\cr\raisebox{-.6ex}{$<$}}}
}
\begin{document}
Here is some text. Here is some text. Here is some text. Here is some text.
See, for example, $x\npsym y$. Here is some text. Here is some text. Here is some text.
Here is some text. Here is some text. Here is some text. Here is some text.
\end{document}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

\subseteq+\circ作为单个符号(“开子集”)参加 短期课程\ooalign

答案2

如果\grtless没有的话,可以用表格来定义;为了提高效率,最好使用原始命令:

\documentclass{article}

% This won't do anything if amssymb is loaded first
\providecommand{\gtrless}{
  \mathrel{% it's a relation
  \smash{% we don't want that it influences the interline spacing
  \vcenter{% the symbol will be vertically centered
    \offinterlineskip % no interline skip here
    \ialign{% build a table
       \hfil##\hfil\cr % just one centered column
       $>$\cr % first row
       \noalign{\kern-.3ex}% shorten the vertical distance
       $<$\cr % second row
    }% end of the \ialign
  }% end of \vcenter
  }% end of \smash
  \vphantom{>}% pretend it's as high as a >
  }% end of \mathrel
}

\begin{document}
Here is some text. Here is some text. Here is some text. Here is some text.
See, for example, $x\gtrless y$. Here is some text. Here is some text. Here is some text.
Here is some text. Here is some text. Here is some text. Here is some text.
\end{document}

在此处输入图片描述

相关内容