维基百科中,在LaTeX/Mathmetic里,写到: 有些人喜欢平方根“关闭”,里面写内容。这种方法可以使得根号的范围更加清晰,所开根正是在根号的范围。 如:root proof 在连接中给出一个很好的解决方案,定义\ sqrt。然而,维基百科又讲到: 当你想使用多次根式时,不幸的是,这个命令就不能正常运行了。比如输入\ sqrt[B]{A}... ...你会得到一个错误的输出。换句话说,只有当你的整个文档中没有多次根式的时候,你可以这样重新定义的平方根这样。 该怎么办呢,我们只需这样重定义根号即可:

\documentclass{article}
\makeatletter
\let\oldr@@t\r@@t
\def\r@@t#1#2{%
\setbox0=\hbox{$\oldr@@t#1{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.4pt\box2}}
\makeatother
\usepackage{letltxmacro}
\LetLtxMacro{\oldsqrt}{\sqrt}
\renewcommand*{\sqrt}[2][\ ]{\oldsqrt[#1]{#2}}
\begin{document}
\[ \sqrt[3]{\frac{a}{b}} \quad \sqrt{\frac{a}{b}} \]
\end{document}
即可得到: closed-root 选自:http://texblog.net/latex-archive/maths/closed-root/

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部