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
  • Which font are you using? I think that it should be possible to adjust the "height" of x using a font goodie file.
    – Aditya
    Mar 13, 2019 at 21:49
  • @Aditya TeX Gyre Pagella Math Mar 14, 2019 at 10:05

2 Answers 2

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

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

You must log in to answer this question.

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