2

I'm using the notation of conjugated complex numbers, however, $\bar$ accent doesn't work well when summoning $\dfrac$ . What shall I do? enter image description here

$\dfrac{\bar{w}}{w} \cdot \bar{\dfrac{\bar{w}}{w}}$
2
  • 2
    I believe it's another instance of the annoying long-standing bug in nested accents. On the other hand, as a reader I'd be quite puzzled by something like \bar{\dfrac{\bar{w}}{w}}
    – egreg
    Commented Feb 18, 2021 at 9:55
  • 1
    Consider the use of \overline in the outer case, as in \overline{\left(\dfrac{\bar{w}}{w}\right)} Commented Feb 18, 2021 at 10:28

1 Answer 1

6

It's unfortunately a long-standing bug with nested accents in amsmath.

Here's a workaround, but the result is not that pretty, isn't it?

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newsavebox{\fixaccent@box}
\newcommand{\fixaccent}[2]{%
  \mathpalette\fixaccent@{{#1}{#2}}%
}
\newcommand{\fixaccent@}[2]{\fixaccent@@{#1}#2}
\newcommand{\fixaccent@@}[3]{%
  \begingroup
  \sbox{\fixaccent@box}{$\m@th#1#3$}%
  #2{\usebox{\fixaccent@box}}%
  \endgroup
}
\makeatother

\begin{document}

\[
\frac{\bar{w}}{w}\cdot\fixaccent\bar{\frac{\bar{w}}{w}}
\]

\end{document}

enter image description here

No reader will understand what the top bar refers to. Probably something like

enter image description here

obtained by

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\frac{\bar{w}}{w}\cdot\,\overline{\!\Bigl(\frac{\bar{w}}{w}\Bigr)\!}\,
\]

\end{document}

could more clearly convey the idea. But probably

enter image description here

would be better.

You must log in to answer this question.

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