TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I represent a matrix in bold form throughout my paper, as $\bm B$. I need to add an overline to indicate a subtle transformation to this matrix. However the command $\overline{\bm{B}}$ does not seem to work. Dito with using $\bar$.

How to achieve a line on top of a bold matrix?

share|improve this question
Maybe embrace it: $\bar{\bm B}$ or $\overline{\bm B}$ – Steven B. Segletes Mar 21 at 13:08
\bar is too short, \overline too long, in my point of view – Christian Hupfer Mar 21 at 13:09
Please show us a full working example that generates the problem behavior. For what it's worth, \documentclass{article} \usepackage{bm} \begin{document} $\overline{\bm{B}}$ \end{document} would appear to generate a line above a bold B without any problems. – Mico Mar 21 at 13:10
@Mico: Does not work for me. I shall attach the example soon. – Bravo Mar 21 at 13:13
@Bravo - An expression such as "Does not work for me" is not at all helpful. Please be more specific. – Mico Mar 21 at 13:48
up vote 4 down vote accepted

After showing how \bar and \overline can be made to work by embracing the argument, I then introduce \overlinebold that scales with math style and perhaps looks better. It uses the width of the upright version of the letter, and offsets the overstoke by 3mu to account for the italics.

  $\SavedStyle\mkern3mu\overline{\phantom{\mathrm{#1}}}$\cr $\SavedStyle\bm #1$}}}
$\overline{\bm B}\quad \bar{\bm  B} \quad\overlinebold{B}$

$\scriptstyle \overline{\bm J}\quad \bar{\bm  J} \quad\overlinebold{J}$

$\scriptscriptstyle \overline{\bm M}\quad \bar{\bm  M} \quad\overlinebold{M}$

enter image description here

share|improve this answer

I suggest to use some markup command, say \mymatrix and the \closure command (by E. Gregorio (egreg), see the comprehensive symbol table) to provide a rule over the symbol which isn't to small or too wide.





share|improve this answer

Your Answer


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.