TransWikia.com

Help with bar accent

TeX - LaTeX Asked by Swashbuckl3r666 on June 4, 2021

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}}$

One Answer

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]{%
  mathpalettefixaccent@{{#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}cdotfixaccentbar{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.

Correct answer by egreg on June 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP