在latex的根号中,遇到较高的内容,根号就会变得垂直,我在mtpro2的宏包中看到了这样的一个定义:
\newbox\SQRTbox@
\def\SQR@@T#1{\setbox\SQRTbox@\hbox{$\displaystyle{#1}$}%
\SQtest@{#1}%
\hbox{\SQtest@@$\displaystyle\radical"270370{\box\SQRTbox@}$}}
\newcount\UPROOT@
\newcount\LEFTROOT@
\def\LEFTROOT#1{\relax
\ifmmode\LEFTROOT@#1\relax
\else\PackageError{mtpro2}
{\protect\LEFTROOT\space allowed only in math mode}
{Type <return> to proceed; the command will be ignored.}
\fi}
\def\UPROOT#1{\relax
\ifmmode\UPROOT@#1\relax
\else\PackageError{mtpro2}
{\protect\UPROOT\space allowed only in math mode}
{Type <return> to proceed; the command will be ignored.}
\fi}
\def\ROOT#1\OF#2{\setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$}%
\mathpalette\R@@T{#2}}
\def\R@@T#1#2{\setbox\z@\hbox{$\UPROOT@\z@\LEFTROOT@\z@\m@th#1\SQR@@T{#2}$}%
\dimen@\ht\z@\advance\dimen@-\dp\z@
\dimen@ii\dimen@
\setbox\tw@\hbox{$\m@th#1\mskip\UPROOT@ mu$}\advance\dimen@ii by1.667\wd\tw@
\setbox\tw@\hbox{$\m@th#1\mskip10mu$}%
\ifcase\SQcount@\advance\dimen@3\wd\tw@\or\advance\dimen@1.5\wd\tw@\or
\advance\dimen@\wd\tw@\fi
\mkern1mu\kern.13\dimen@\mkern-\LEFTROOT@ mu
\raise.5\dimen@ii\copy\rootbox % was .44
\mkern-1mu\kern-.13\dimen@\mkern\LEFTROOT@ mu\box\z@\kern-\wd\rootbox
\LEFTROOT\z@\UPROOT\z@}
\DeclareRobustCommand\SQRT{\@ifnextchar[\SQRT@\SQR@@T}
\def\SQRT@[#1]{\ROOT #1\OF}
使用SQRT命令可以得到倾斜的积分号,请问如何让上面的代码对于stix1字体也可以用呢?
mtpro2的例子:
我不建议,因为根号是由多个字符拼接成并由引擎去自动控制它的大小,所以与字体很强相关改动起来很麻烦,不过可以试试其他的方法,比如:
\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}[2013-10-15]
\usepackage{scalerel}
\newcommand\mysqrt[2][0pt]{\stretchrel{\sqrt{}}{\addstackgap%
[#1]{$\displaystyle\overline{#2}$}}}
\begin{document}
\[
\mysqrt[1pt]{\sum_{i=1}^{n}(y^{i}-x^{i})^{3}}
\]
\end{document}
\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}
\usepackage{scalerel}
\newcommand\mysqrt[2][0pt]{\stretchrel{\sqrt{}}{\addstackgap%
[#1]{$\displaystyle\overline{#2}$}}}
\begin{document}
\[
\mysqrt{1+\mysqrt{1+\mysqrt{1+\mysqrt{1+\mysqrt{1+\mysqrt{1+\mysqrt{1+\mysqrt{1}}}}}}}}
\]
\[
\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1}}}}}}}}
\]
\end{document}