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?

3

3 Answers 3

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

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.

4
  • 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, 2019 at 3: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. Aug 19, 2019 at 3: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, 2019 at 4:07
  • @Patch Make sure your package is up to date: scalerel 2016/12/29 v1.8 Aug 19, 2019 at 4: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).

You must log in to answer this question.

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