In my document, I am using a font and size which just makes scriptscriptstyle too small, and it looks weird to me:
If instead of \sqrt[3]{...}
I write \sqrt[\scriptstyle 3]{...}
it looks better:
And I want to apply this to all the square roots in my document, without typing \scriptstyle
every single time.
My first solution was this:
\let\oldsqrt\sqrt
\renewcommand{\sqrt}[2][\phantom{1}]{\oldsqrt[\scriptstyle#1]{#2}}
but then I can't use \uproot{}
in \sqrt
to adjust some fractions. (I'm not sure why, but it throws an error)
So, my next solution attempt was to look into the definition of \sqrt
(using \show
in a console)
> \sqrt =\long macro:
->\@ifnextchar [\@sqrt \sqrtsign .
<argument> \sqrt
then I looked into the \@sqrt
definition:
> \@sqrt=macro:
[#1]->\root #1\of .
<argument> \@sqrt
finally I had a look at the \root
definition and I found what I wanted:
> \root=macro:
#1\of ->\setbox \rootbox \hbox {$\m@th \scriptscriptstyle {#1}$}\mathpalette \r
@@t .
<argument> \root
so I just had to redefine \root
to the exact same but changing \scriptscriptstyle
to \scriptstyle
. I tried the following:
\makeatletter
\renewcommand{\root}[1]{\setbox\rootbox\hbox{$\m@th\scriptstyle{#1}$}\mathpalette\r@@t}
\makeatother
but it just throws a ton of illegible errors and breaks the whole document. I don't think I understood correctly the definition of \root
, so my code isn't okay. How would you do this?
I'd appreciate your help.