Some time ago i found the following code on wikipedia:
Code: Select all
% New definition of square root:
% it renames \sqrt as \oldsqrt
\let\oldsqrt\sqrt
% it defines the new \sqrt in terms of the old one
\def\sqrt{\mathpalette\DHLhksqrt}
\def\DHLhksqrt#1#2{\setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.4pt\box2}}
However i can't use this code to print cube roots.
Code: Select all
\sqrt[3]{27}
I can solve it using:
Code: Select all
\oldsqrt[3]{27}
I wonder if it's possible to alter the code (or write a new custom sqrt) to have cube roots who close after their content...
Does anyone know of such code?