I'm using a set of commands to define abstractions of mathematical notations that often occur during my thesis such as:


which would equal some distortion noise. This allows me to quickly change the notation throughout the document with just a change in one place and has proven invaluable so far. Now there is another command


which is supposed to put a hat over another symbol to denote it's estimated. Using this with single symbols is all fine but when using it with symbols that have a subscript, the following happens:


The left one is obtained by \Est{\DNoise} and the right one by \Est{n}_d which is possible but requires to break the pattern used throughout the document. The question is if there is a way to redefine \Est so that it produces the left result even when passed a variable with subscript.


2 Answers 2


A way to go is






$ \DNoise, \Est{\DNoise}, \Test{\DNoise}$

This produces this output


  • Seems to work perfectly and I've not yet found side effects. Thank you!
    – jan
    Commented Oct 1, 2013 at 10:28
  • @jan I am glad it helps, and I hope you won't go through side effects, but you never know... ;)
    – Ludovic C.
    Commented Oct 1, 2013 at 10:32
  • Unfortunately I found the first. Doing this on a vector which is
    – jan
    Commented Oct 1, 2013 at 12:53
  • 1
    That went out incomplete, some symbols are declared as vectors, i.e. \newcommand{\Rcvbits}{\boldsymbol{b_r}}, when applying the macro to those (\Test{\RcvBits}) the hat is placed in front of the first symbol and not over it.
    – jan
    Commented Oct 2, 2013 at 11:48
  • 1
    @jan Should the hat be bold too?
    – Ludovic C.
    Commented Oct 2, 2013 at 15:40

The quick and dirty way would be to separate the symbol from the sub-script

  • 1
    But that would still exclude using $\Est{\DNoise}$ ? The problem is that the document is containing expressions like this (also with different arguments than \DNoise) multiple times and fixing \Est would be easier that searching and replacing every single occurence.
    – jan
    Commented Oct 1, 2013 at 9:09

You must log in to answer this question.

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