Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Circumflexes looks too small and they are to close to the symbol in the PDF generated by XeLaTeX from UTF-8 source with Asana Math font for mathematics:

enter image description here

Source:

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage[math-style=ISO,bold-style=ISO,nabla=upright,partial=upright,vargreek-shape=unicode]{unicode-math}
\setmathfont{[Asana-Math]}

\newcommand*{\op}[1]{\hat{\mathup{#1}}}

\begin{document}

\begin{equation}
    \op{H} = \op{T} + \op{V} 
\end{equation}

\end{document}

I want to make circumflexes wider to be more clearly separated from the symbols underneath them, but \widehat is not an option since it produces circumflexes of variable size. The solution in How can I manually choose the size of a wide accent? (math mode) doesn't work for me. Seems like there is some incompatibility between the accents package and UTF-8 encoding.

I really like Asana Math, so I don't want to change the font.

share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Anke Apr 10 '13 at 9:05

2 Answers 2

up vote 3 down vote accepted

Maybe it might be worth a try to introduce two commands via the xparse package:

\DeclareDocumentCommand{\operator}{ s m }{
    \IfBooleanTF{#1}{
                    \widehat{#2}
            }{
                    \hat{#2}}
            }
    }

Then \operator{H} gives the "normal" output and \operator*{H} stretches the circumflex.

Maybe you want to look also at the following post: Really wide hat symbol where the scalerel package is used. You might think of defining a command with two inputs, the first one giving then the width of the hat, and the second as the character

Edit:

I think I have now a solution after looking at source2e.pdf and encguide.pdf.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage[math-style=ISO,bold-style=ISO,nabla=upright,partial=upright,vargreek-shape=unicode]{unicode-math}
\setmathfont{[Asana-Math]}
\DeclareSymbolFont{mylargesymbols}{OMX}{cmex}{m}{n}
\DeclareMathAccent{\mywidehat}{\mathord}{mylargesymbols}{"62}
\begin{document}
$\hat{\mathrm{H}} = \hat{\mathrm{T}} + \hat{\mathrm{V}} +\hat{abcdefgh}$

$ \widehat{\mathrm{H}} = \widehat{\mathrm{T}} + \widehat{\mathrm{V}} +\widehat{abcdefgh}$

$ \mywidehat{\mathrm{H}} = \mywidehat{\mathrm{T}} + \mywidehat{\mathrm{V}} +\mywidehat{abcdefgh}$
\end{document}

will give the following result

enter image description here

The hat still expands, but not so dramatic as case before.

share|improve this answer
    
Magnificent! :) –  Wildcat Apr 13 '13 at 6:43

[NOTE: Edit 1 for better vertical positioning; Edit 2 for "hat" not "wedge"] I don't have access to your particular fonts, so I address the problem for the default LaTeX font. You will have to reparameterize my solution. It involves using the scalerel package for stretching the \hat symbol (\char'136). I show the unmodified result and then the result for one parameters-set of stretches. Once you calibrate the three parameters for your font, lock those values into the definition. \Ht defines the vertical stretch; \Wd defines the horizontal stretch; and \Dp defines the vertical separation multiplier between letter and overhat.

\documentclass{article}
\usepackage{amsmath}
\usepackage{scalerel}
\usepackage{adjustbox}

\newlength\svarraycolsep
\newcommand\althat[1]{%
\renewcommand\arraystretch{\Dp}%
\setlength\svarraycolsep{\arraycolsep}%
\setlength\arraycolsep{0in}%
\begin{array}{c}%
  \vstretch{\Ht}{%
    \hstretch{\Wd}{%
      \trimbox{.15ex .75ex .15ex .2ex}{\scalerel*{\char'136}{\rule{1ex}{1ex}}}%
    }%
  }\\%
  #1\\%
\rule{1ex}{0ex}\\%
\end{array}%
\renewcommand\arraystretch{1.0}%
\setlength\arraycolsep{\svarraycolsep}%
}

\parindent 0in
\begin{document}

Hat:

\( \hat{\mathrm{H}} = \hat{\mathrm{T}} + \hat{\mathrm{V}} \)

Carat(char'136):


\def\Ht{1.8}
\def\Wd{4.5}
\def\Dp{.3}
\( \althat {\mathrm{H}} = \althat {\mathrm{T}} + \althat {\mathrm{V}} \)

\end{document}

enter image description here

share|improve this answer
    
But the \wedge is not the same character as the the one \hat gives out. –  jjdb Apr 11 '13 at 20:29
    
@jjdb I fixed the wedge issue by using \char'136 instead –  Steven B. Segletes Apr 12 '13 at 12:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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