3

I am attempting to use a harpoon symbol in place of a \hat or \tilde on variables. Here is my code:

\documentclass{article} \newcommand{\leftrightharpoonup}{% \mathrel{\mathpalette\lrhup\relax}% } \newcommand{\lrhup}[2]{% \ooalign{$#1\leftharpoonup$\cr$#1\rightharpoonup$\cr}% } \newcommand\xmysymbol{\raisebox{-.7ex}{\includegraphics[height=2.2ex]{mysymbol}}} \newcommand\mysymbol{{\mathchoice{\xmysymbol}{\xmysymbol}{\hbox{\scriptsize\xmysymbol}}{\hbox{\tiny\xmysymbol}}}} \begin{document} $\sqrt{1+ \stackrel{\leftharpoonup}{\lambda}^2} \,\, \sqrt{1+ \tilde \lambda^2} $ $\sqrt{1+ \stackrel{\leftharpoonup}{\lambda^2}} $ \end{document} 

This produces the following image: enter image description here

I would like to be able to produce something similar to the middle square root. My two harpoon attempts place the harpoon too high and the exponent incorrectly. My harpoon code is thanks to this post, How to draw a left right harpoon up?

I also found this post which solves the issue of stackrel being too high, `\stackrel` but lower It seems though that they define a custom symbol to use the "hat" on one specific character. I would like to be able to use the harpoon as a "hat" on a variety of characters, not only \lambda, as I would \tilde. Thank you for any suggestions.

1 Answer 1

3

A possible solution would be to use the accents package.

\documentclass{article} \usepackage{accents} \newcommand*{\accentharpoon}[1]{\accentset{\leftharpoonup}{#1}} \begin{document} $\sqrt{1+ \tilde \lambda^2}$ $\sqrt{1+ \accentharpoon{\lambda}^2}$ \end{document} 
1
  • Thank you Vincent! Commented Mar 20, 2022 at 1:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.