1

For something like \hat{w} or \vec{v} is it possible to set the background color for just the accent, i.e., the background of w and v would be normal, but the circumflex and vector symbol would be highlighted?

I'm trying this on KaTeX, where most of the styling is handled by HTML commands; however, I'm interested in any tex-based solutions.

Rax Adaam
  • 1,747
  • 1
    Did you see this question: https://tex.stackexchange.com/q/46701/47927 ? – Jasper Habicht Nov 08 '21 at 16:40
  • @JasperHabicht thanks, I hadn't seen that one, in my searches; however, I had tried an analogous approach with KaTeX's \htmlStyle{background-color:...} which didn't work. I'll have to have a closer look at the solutions to see if any could be generalized to a bg colour. Thanks for taking the time to link a similar question! – Rax Adaam Nov 08 '21 at 17:02

1 Answers1

2

This in some ways does what you are asking for, but may be more suitable to talk you out of this.

\documentclass{article}
\usepackage{accents} 
\usepackage{contour} 
\begin{document}
$\accentset{\contourlength{0.2pt}\contour{blue}{\ensuremath{\rightarrow}}}{a}$
\end{document}

enter image description here

  • Not quite what I'm looking for, but this could be a viable alternative -- thanks for taking the time to share! Didn't know we could do this & love discovering new options. – Rax Adaam Nov 08 '21 at 17:04