12

The question "Is there a way to do an "upside down" \widehat?" indicates that \widecheck is available in the mathabx package, but unfortunately, that package also changes the font style.

Can we define \widecheck by ourselves?

guanglei
  • 453
  • Are you on beamer? If not, please use this answer of the post you have linked to: http://tex.stackexchange.com/a/44277 . Why have you tagged [tag:latex3e]? – LaRiFaRi Jun 09 '15 at 11:28
  • See http://tex.stackexchange.com/questions/14386/importing-a-single-symbol-from-a-different-font for how to import just a single glyph from mathabx. – Steven B. Segletes Jun 09 '15 at 11:31
  • @StevenB.Segletes -- the answers in the two referenced questions are not materially different, although the one you reference is a bit more specific about why a font family must be "wasted". – barbara beeton Jun 09 '15 at 11:56

3 Answers3

10

You can import just \widecheck, but it makes sense to also import \widehat, to get similar symbols.

\documentclass{article}
\usepackage{amsmath}

\DeclareFontFamily{U}{mathx}{} \DeclareFontShape{U}{mathx}{m}{n}{<-> mathx10}{} \DeclareSymbolFont{mathx}{U}{mathx}{m}{n} \DeclareMathAccent{\widehat}{0}{mathx}{"70} \DeclareMathAccent{\widecheck}{0}{mathx}{"71}

\begin{document}

$\widehat{abc}+\widecheck{abc}$

$\widehat{abcde}+\widecheck{abcde}$

\end{document}

enter image description here

egreg
  • 1,121,712
4

I did not know if it would be this easy, but it turned out so. I took my revised answer at Really wide hat symbol for \reallywidehat and made two simple changes:

  1. I changed all occurences of "hat" to "check"

  2. I changed the final \stackon argument from \tmpbox to \scalebox{-1}{\tmpbox}.

That was it. Here it is:

\documentclass{article}
\usepackage{scalerel,stackengine}
\stackMath
\newcommand\reallywidecheck[1]{%
\savestack{\tmpbox}{\stretchto{%
  \scaleto{%
    \scalerel*[\widthof{\ensuremath{#1}}]{\kern-.6pt\bigwedge\kern-.6pt}%
    {\rule[-\textheight/2]{1ex}{\textheight}}%WIDTH-LIMITED BIG WEDGE
  }{\textheight}% 
}{0.5ex}}%
\stackon[1pt]{#1}{\scalebox{-1}{\tmpbox}}%
}
\parskip 1ex
\begin{document}

$\reallywidecheck{zbcdefghijklm}$

$\reallywidecheck{zbcdefghijk}$

$\reallywidecheck{zbcdefghi}$

$\reallywidecheck{zbcdefg}$

$\reallywidecheck{zbcde}$

$\reallywidecheck{zbc}$

$\reallywidecheck{zb}$

$x\cdot\reallywidecheck{a_1+a_2}\cdot y$

\end{document}

enter image description here

Best of all, it avoids the use of mathabx, which resets a lot of math symbols.

  • I've copied/pasted your code, and everything seems to be working nicely for the most part, but when I try to typeset and expression like "\reallywidehat{\chi}" it gives me an error that I'm missing a $. It only seems to work with Roman letters. What can I do to fix this issue? – Patch Aug 19 '19 at 03:04
  • @Patch When I take my above code and add the line, $\reallywidecheck{\chi}$, it works just fine. Remember, \chi is a math symbol and has to be invoked in math mode. – Steven B. Segletes Aug 19 '19 at 03:48
  • Yeah, it wasn't working for me even in the dollar signs. I can't figure it out. I ended up just copy/pasting the segment of "widecheck" code directly from mathabx. I didn't need a "really" wide one after all. – Patch Aug 19 '19 at 04:07
  • @Patch Make sure your package is up to date: scalerel 2016/12/29 v1.8 – Steven B. Segletes Aug 19 '19 at 04:17
4

pdfMsym provides wide accents (which can stretch arbitrarily), including \varwidecheck which may suit your needs:

\input pdfmsym
\pdfmsymsetscalefactor{10}

\begin{gather} \varwidecheck{abcdefgijk} \ \varwidecheck{abcdefg} \ \varwidecheck{abc} \end{gather}

varwidecheck demo

pdfMsym defines a macro \accent@skew which sets the skew of the accent from the left side of the material it is placed over, if you don't like this you can \def\accent@skew{0}. You can similarly play with \accent@raise (which sets the vertical difference between the accent and the material).

Slurp
  • 876