4

when I´m using \widehat{=} or \hat{=} i get an error. Also the pdf output isn´t formatted as it should be.

\textbf{foo:} for example \textit{city} \widehat{=} \textit{attribute} and\texit{new york} \widehat{=} \textit{object}.

enter image description here

It should look like this:

  • foo: for example cityattribute and new yorkobject.

What am I missing?

1
  • 2
    (1) welcome, (2) \widehat is a math construction so you need math mode, $\widehat{=} $ – daleif Dec 20 '16 at 11:53
4

Use \mathrel{\widehat{=}} to get the correct spacing around the relation symbol.

As already noted in the comments, the whole contructions only works in math mode, i.e., either inside a pair of $ signs, or in a mathematical environment like equation.

4

Since your symbol seems to be used in text mode, I suggest defining a macro, that makes easier inputting the text.

\documentclass{article}

\newcommand{\is}[2]{\textit{#1}$\;\widehat{=}\;$\textit{#2}}

\begin{document}

For example \is{city}{attribute} and
\is{New York}{object}.

\end{document}

enter image description here

3

Try this (\equalhat):

\documentclass{article}
\usepackage{scalerel,stackengine,amsmath}
\newcommand\equalhat{\mathrel{\stackon[1.5pt]{=}{%
  \stretchto{\scalerel*[\widthof{=}]{\wedge}{\rule{1ex}{3ex}}}{0.5ex}}}}

\begin{document}

$\equalhat$

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.