Latex magic to make \ref work with text