I thought to point out this strange problem. I was using code from answer in improving spacing between math expressions automatically? which changes the sqrt sign, so instead of
It now looks like
The strange thing, is that once I also load breqn, something strange happens. compare this
\documentclass[12pt]{book}
\usepackage{amsmath}
\usepackage{breqn}
\iftrue
%see https://tex.stackexchange.com/questions/553382/improving-spacing-between-math-expressions-automatically
%added july 13, 2020
% Give a nicer sqrt symbol.
\usepackage{letltxmacro}
\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}}
\LetLtxMacro{\oldsqrt}{\sqrt}
\renewcommand*{\sqrt}[2][\ ]{\oldsqrt[#1]{#2}\,}
\makeatother
\fi
\begin{document}
\[
\frac{\sqrt{2}\, \mathrm{arctanh} \left(\frac{f \sqrt{2}}{2 \sqrt{c_{1}}}\right)}{\sqrt{c_{1}}}
\]
\end{document}
compiled with lualatex, gives
The letter f
alignment becomes bad. It has fallen down. Compiling the above again, but without loading breqn, this is the output
Now f
base is higher, which is the normal.
So for now I have removed the code which changes the sqrt sign and kept breqn
, as I need this much more. This is the result
\documentclass[12pt]{book}
\usepackage{amsmath}
\usepackage{breqn}
\begin{document}
\[
\frac{\sqrt{2}\, \mathrm{arctanh} \left(\frac{f \sqrt{2}}{2 \sqrt{c_{1}}}\right)}{\sqrt{c_{1}}}
\]
\end{document}
Who is at fault here? Is it breqn
or is it the code from the above linked question which changes the sqrt sign that causes this alignment problem?