分类
LaTeX

商空间除号的改进

我们在写两个东西的商时, 用$/$往往并不能出色的完成任务, 我们常常希望分子要提高点, 而分母要降低点, 这样格式更好看.
这里其实用\raise, \lower就可以实现了.

为了区别判断, 我们还可以用mathchoice来判断数学环境, 进而采取不同的措施.

\mathchoice{display}{text}{script}{scriptscript}
\newcommand\quotient[2]{
        \mathchoice
            {% \displaystyle
                \text{\raise1ex\hbox{$#1$}\Big/\lower1ex\hbox{$#2$}}%
            }
            {% \textstyle
                #1\,/\,#2
            }
            {% \scriptstyle
                #1\,/\,#2
            }
            {% \scriptscriptstyle
                #1\,/\,#2
            }
    }

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据