0

How can we make the tip of the closed square root symbol better?

enter image description here enter image description here

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{letltxmacro}

\LetLtxMacro{\OldSqrt}{\sqrt} \newcommand{\ClosedSqrt}[1][\hphantom{3}]{\def\DHLindex{#1}\mathpalette\DHLhksqrt} \makeatletter \newcommand\bold@name{bold} \def\DHLhksqrt#1#2{% \setbox0=\hbox{$#1\OldSqrt{#2,}$}\dimen0=\ht0\relax% \advance\dimen0-0.25\ht0\relax% size of the added box is still 0.2 times ht0 \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}% {\hbox{$#1\expandafter\OldSqrt\expandafter[\DHLindex]{#2,}$} \lower\ifx\math@version\bold@name0.6pt\else0.4pt\fi\box2} } % root index positioning and added space at the end, mostly noticeable in inline math mode \renewcommand{\sqrt}[2][\ ]{\ClosedSqrt[\leftroot{-2}\uproot{1}#1]{#2}\kern0.1em} \makeatother

\begin{document}

$\sqrt{2}$

\end{document}

cufcuf
  • 594

1 Answers1

2

Do you want a round cap? It can be done, but the symbol is really ugly and useless.

\documentclass{article}
\usepackage{amsmath}
\usepackage{letltxmacro}
\usepackage{pict2e}

\DeclareFontShape{OMX}{cmex}{b}{n}{<->cmexb10}{} \SetSymbolFont{largesymbols}{bold}{OMX}{cmex}{b}{n}

\LetLtxMacro{\OldSqrt}{\sqrt} \newcommand{\ClosedSqrt}[1][\hphantom{3}]{\def\DHLindex{#1}\mathpalette\DHLhksqrt} \makeatletter \newcommand\bold@name{bold} \def\DHLhksqrt#1#2{% \setbox0=\hbox{$#1\OldSqrt{#2,}$}\dimen0=\ht0\relax% \advance\dimen0-0.25\ht0\relax% size of the added box is still 0.2 times ht0 \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}% \begingroup \hbox{$#1\expandafter\OldSqrt\expandafter[\DHLindex]{#2,}$}% \dimen2=\fontdimen8 \ifx#1\displaystyle\textfont\else \ifx#1\textstyle\textfont\else \ifx#1\scriptstyle\scriptfont\else \scriptscriptfont\fi\fi\fi 3 \lower1.5\dimen2\hbox{\closer@{#1}}% \endgroup } % root index positioning and added space at the end, mostly noticeable in inline math mode \renewcommand{\sqrt}[2][\ ]{\ClosedSqrt[\leftroot{-2}\uproot{1}#1]{#2}\kern0.1em} \newcommand\closer@[1]{% \raisebox{\dimen0}{% \kern-0.5\dimen2 \unitlength=\dimexpr\ht0-\dimen0\relax \begin{picture}(0,1) \linethickness{\dimen2}% \roundcap \Line(0,0)(0,0.4) \buttcap \Line(0,0.3)(0,1) \end{picture}% }% } \makeatother

\begin{document}

[ \sqrt{2}+\sqrt[3]{\frac{1}{2}}-\scriptstyle\sqrt{2} ]

\boldmath [ \sqrt{2}+\sqrt[3]{\frac{1}{2}}-\scriptstyle\sqrt{2} ]

\end{document}

enter image description here

enter image description here

egreg
  • 1,121,712
  • Excuse for this comment Prof.. But the question is it similar to this? https://tex.stackexchange.com/questions/29834/closed-square-root-symbol?rq=1 – Sebastiano Oct 12 '21 at 22:18
  • 1
    @Sebastiano Yes, but the problem is to change the end of the vinculum to be round, I have guessed. – egreg Oct 12 '21 at 22:39
  • Surely...in fact I have upvoted you :-). Just a succesive comment: but the 3 (also in bold) it is very closer to the sqrt. – Sebastiano Oct 12 '21 at 22:44
  • 1
    @Sebastiano I didn't change the setting of \uproot ad \leftroot. I consider the symbol bad anyway. – egreg Oct 12 '21 at 22:53