2

In ConTeXt, I want to lift a \hat slightly up, since \hat is too low and touches the variable. Now, this post is exactly what I want. It suggests:

\hat{\rule{0ex}{1.2ex}\mkern-3mu x}_{t+1}

However, ConTeXt seemingly doesn't recognize \rule. I don't understand the nature of \rule, and I can't find explanation in The TEXbook nor in TEX for the Impatient. Is \rule a LaTeX function? Where can I find the function definition, and how can I implement it using (perhaps) plain TEX and ConTeXt functions? Or are there other ways to achieve the result?

2 Answers2

2

enter image description here

\vphantom works in ConTeXt. You just need to use a character that has the height you want. In the example, < is used since it is slightly taller than x.

\define[1]\hihat{\hat{\vphantom{<}#1}}

\starttext

$\hat{x}_{t+1}\hihat{x}_{t+1}$

\stoptext
Sandy G
  • 42,558
2

In ConTeXt the command is named \blackrule instead of \rule. In contrast to LaTeX's \rule it follows the intuitive key-value syntax.

\starttext

$\hat{x}_{t+1}$
$\hat{\blackrule[width=0ex,height=1.2ex]\mkern-3mu x}_{t+1}$

\stoptext

enter image description here

Henri Menke
  • 109,596