6

I was testing something with Overleaf, and then a weird result was output.

enter image description here

What's more weird is that I went to a Discord server where a TeX-rendering engine exists. This is its result: enter image description here

It's a really simple piece of code:

\Huge$$\sqrt[3]{\frac{100}{300}}$$

While This one looks better, I like how the first one appears. How can I keep the look of the first cube root, but also align the 3 properly? Also, why's this happening?

UPDATE: This question is related to the original one.

I defined a new command that is a mirror of the root (\newcommand{\asqrt}[2][1]{\reflectbox{\ensuremath{{\sqrt[#1]{#2}}}}}) in the preamble. Its size is smaller than the normal root:

enter image description here

Here's how I call both of them: \Huge\[\ \sqrt[n]{\frac{100}{300}} \quad \asqrt[n]{\frac{100}{300}}\]\

Why are they different?

4
  • 1
    note also $$ should not be used in latex Mar 25, 2021 at 23:56
  • 1
    The \reflectbox will make the argument in \textstyle instead of \displaystyle. If you add \displaystyle before the \sqrt in the definition of \asqrt, it should match. Mar 26, 2021 at 0:19
  • 1
    That is to say, \newcommand{\asqrt}[2][1]{\reflectbox{\ensuremath{{\displaystyle\sqrt[#1]{#2}}}}} Mar 26, 2021 at 0:36
  • 1
    It's not really considered good practice to completely change the question, including changing the title after answers are posted. Any readers may wonder why my answer doesn't mention reflection at all. But I'll extend my answer this time. Mar 26, 2021 at 11:53

2 Answers 2

5

Almost any document using math should load amsmath which provides many additional math features and corrects this

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\Huge
a
\[\sqrt[3]{\frac{100}{300}}\]
\end{document}

If you want the straight form use the cmex10 option

enter image description here

\documentclass{article}
\usepackage[cmex10]{amsmath}
\begin{document}

\Huge
a
\[\sqrt[\leftroot{6}\uproot{-6}3]{\frac{100}{300}}\]
\end{document}

With either definition, you can add a reflectbox in a mathpalette so it works in all styles

enter image description here

\documentclass{article}
\usepackage[cmex10]{amsmath}
\usepackage{graphicx}
\newcommand\asqrt[1][]{\mathpalette{\aasqrt{\sqrt[#1]}}}
\makeatletter
\newcommand\aasqrt[3]{\reflectbox{$\m@th#2#1{#3}$}}
\makeatother
\begin{document}

\Huge 

$\sqrt{x} \qquad \asqrt{x}$


$\sqrt[3]{x} \qquad \asqrt[3]{x}$

a
\[
\sqrt[\leftroot{6}\uproot{-6}3]{\frac{100}{300}}
\qquad
\asqrt[\leftroot{6}\uproot{-6}3]{\frac{100}{300}}
\]
\end{document}
0
3

I took the question to mean you wanted the \surd more vertically oriented.

What I do is vertically stretch the argument 50% before applying the square root. The greater height makes the \surd orient itself more vertically. Then I vertically compress the result back to its original scale. Note the root degree (optional argument) needs to be stretched separately, so that the recompression brings it back to proper scale.

\documentclass{article}
\usepackage{scalerel,amsmath}
\newcommand\xsqrt[2][]{%
  \vstretch{.666}{\sqrt[\vstretch{1.5}{#1}]{\vstretch{1.5}{\!#2}}}
}
\begin{document}
\Huge
\[
x\xsqrt[3]{\frac{100}{300}}
\]
\end{document}

enter image description here

2
  • What's the \! part of there in the second argument? Mar 26, 2021 at 12:01
  • 1
    @BoredComedy It is a small backspace. I found the argument shifted more to the right than I wanted, for some reason. Mar 26, 2021 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .