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.

I would like to insert an hat accent on bold letters/symbols in math mode.

For latin letters, e.g. the q char, I insert this commands in my preamble

\newcommand{\paramhat}[1]{\boldsymbol{\hat{\textbf{#1}}}}
\newcommand{\param}[1]{\textbf{\text{#1}}}

And then \param{q} and \paramhat{q} in the text and everything work as expected.

But the question is: how to make this to work with greek letters/symbols?

I need to use it on a \theta symbol. I've tried $\boldsymbol{\hat{\theta}}$ but I think that the hat accent has slightly shifted to the right, as shown in the following image.

bold theta with hat accent

There is a way to move the hat accent slightly to the left?


Notes:

  • amsmath package loaded
  • euler font for math
  • \usepackage[T1]{fontenc}
  • \usepackage[utf8]{inputenc}
share|improve this question
    
Welcome to TeX.SX! –  Papiro Jun 20 '13 at 23:58
    
@Papiro thanks! :) –  leodido Jun 21 '13 at 1:02

3 Answers 3

up vote 4 down vote accepted

Plain TeX, and LaTeX, have a \skew macro which is described in the TeXBook.

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{eulervm}

\begin{document}

\begin{tabular}{ll}
Normal: & a$\boldsymbol{\hat{\theta}}$b \\
\textbackslash skew-.5:   & a$\boldsymbol{\skew{-.5}\hat\theta}$b \\
\textbackslash skew-1:   & a$\boldsymbol{\skew{-1}\hat\theta}$b \\
\end{tabular}

\end{document}

skew hat

with \usepackage[T1]{fontenc} the hat moves: it is lowered and shifted a bit to the left of its non-T1 position.

skew bis

share|improve this answer

It doesn't look shifted to me, but you can use \hskip:

\documentclass{article}

\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{euler}

\begin{document}

\Huge
\begin{tabular}{ll}
Normal: & a$\boldsymbol{\hat{\theta}}$b \\
.1pt:   & a$\hskip-.1pt\boldsymbol{\hat{\hskip.1pt\theta}}$b \\
1mm:    & a$\hskip-1mm\boldsymbol{\hat{\hskip1mm\theta}}$b
\end{tabular}

\end{document}

For me, this produces the following output: The example output

share|improve this answer
1  
note that the original question asks about theta using the euler font, in which the greek is upright. –  barbara beeton Jun 21 '13 at 15:45
    
@barbarabeeton It's the same principle, but you're right. I've edited the answer. –  Vedran Šego Jun 21 '13 at 16:12

This also works great for moving the hat in beamer when the math mode font is italicized. For my quantum mechanics work, I define:

\newcommand{\op}[1]{\skew{4}\hat{#1}}

Which puts the hats in the right place, not too far to the left, with the new command \op{H}. YMMV.

Hamiltonians: normal hat and shifted hat

share|improve this answer

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.