Using the answer to the question moving the bar on hbar (copy/paste and tweaking the parameters, and replacing mathchar'26 by the shorter mathchar'55), I was able to create a barred q. Unfortunately, this symbol behaves badly when I use \qbar as an index.

I use the font package eulervm:
\documentclass[11pt]{scrartcl}
\usepackage{eulervm}
\usepackage{mathtools}
\makeatletter
\newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}}
\newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}}
\makeatother
\newcommand{\qbar}{\ensuremath{\mathrlap{\raisemath{-3.2}{\hspace*{3.2pt}
{\mathchar'55\mkern-9mu}}}q}}
\begin{document}
{\Huge$\qbar$} \qquad $\qbar$ \qquad $U_{\qbar}$
\end{document}
What code should I use to get the same symbol in both cases? I also noticed that I had to reconfigure the paramters in the definition of \qbar for this question, presumably there was some interaction with the other packages or options... This is first time I'm attempting to create a symbol in this fashion. If you know of better ways, or can provide me with a resource that explains how to do this in general, that would be great too!





q's are out. – Oct 27 '14 at 22:12mathtoolsmust have been what mixed it up in the first place. – Olivier Bégassat Oct 27 '14 at 22:15-3.2is not a valid first argument for\raisemath: it needs a length not a number. With your edit the code does not compile again giving the error! Illegal unit of measure (pt inserted).– Oct 27 '14 at 22:22