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.

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

Is there a way in latex to change the vertical thickness (height) of the line generated by the \overline command?

\overline{\overline{A \vee B}} = \overline{\overline{A} \wedge \overline{B}}
share|improve this question
Here is that message again: eqnarray vs align – Werner Mar 27 '14 at 4:19
possible duplicate of The \bar and \overline commands – Peter Grill Mar 27 '14 at 4:20
@PeterGrill: The \bar and \overline commands is about the width of the line, not the height/thickness. – Heiko Oberdiek Mar 27 '14 at 4:22
@Werner: i dont know if i wrote it correctly, but i need change height of overline (vertical thickness) – Krab Mar 27 '14 at 4:22
up vote 16 down vote accepted


The default rule thickness θ is 0.4pt in TeX. An \overline formula is set as \vbox:

  • At the top is a kern of θ
  • The bar follows with thickness θ
  • The gap to the formula has height 3θ
  • The formula follows.

θ is taken from fontdimen 8 of math font family 3. Example:



Result TeX

As can be seen, also the gap between the line and the formula changes with the thickness of the line (even with factor 3).


LuaTeX makes the parameters configurable:

  • \Umathoverbarkern: the white space above the line
  • \Umathoverbarrule: line thickness
  • \Umathoverbarvgap: the gap between the line and the formula

These values can be set for all eight math styles. LuaTeX also makes the cramped styles available as:

  • \crampeddisplaystyle
  • \crampedtextstyle
  • \crampedscriptstyle
  • \crampedscriptscriptstyle

In cramped styles, used for formulas below bars (\overline, \sqrt, denominator in fractions), the exponents are set lower than usual.

LuaLaTeX adds a prefix luatex to LuaTeX's new primitives (to avoid name clashes). The following example sets \Umathoverbarrule in all eight styles:


  \csname luatexUmath#1\endcsname\displaystyle=#2\relax
  \csname luatexUmath#1\endcsname\luatexcrampeddisplaystyle=#2\relax
  \csname luatexUmath#1\endcsname\textstyle=#2\relax
  \csname luatexUmath#1\endcsname\luatexcrampedtextstyle=#2\relax
  \csname luatexUmath#1\endcsname\scriptstyle=#2\relax
  \csname luatexUmath#1\endcsname\luatexcrampedscriptstyle=#2\relax
  \csname luatexUmath#1\endcsname\scriptscriptstyle=#2\relax
  \csname luatexUmath#1\endcsname\luatexcrampedscriptscriptstyle=#2\relax

    \csname check@mathfonts\endcsname
    $\overline{abc}$ % additional space

Result LuaLaTeX

share|improve this answer
The \setumath works only for the second math (move the \test{6.4pt} to the begin to see, also your image shows that the first two lines have the same height). One has to call \check@mathfonts first. – Ulrike Fischer May 19 '15 at 10:22
@UlrikeFischer Thanks, answer updated by adding \check@mathfonts. – Heiko Oberdiek May 19 '15 at 14:28

Rather than trying to contend with the existing definition, one could design their own, using stacks. Here the 1.2\LMpt is the vertical offset above the item of the overline, and .4\LMpt is the rule thickness. As part of a \ThisStyle argument, an \LMpt is 1pt it \displaystyle and \textstyle, but proportionately reduced in \scriptstyle and \scriptscriptstyle, as shown in the MWE.

One may or may not wish to stack a \mathop around the definition.

\myoverline{\myoverline{A \vee B}} = \myoverline{\myoverline{A} \wedge
\myoverline{\myoverline{A \vee B}} = \myoverline{\myoverline{A} \wedge

enter image description here

For example, here, we change the offset to 1.4\LMpt, and the thickness to .6\LMpt:

enter image description here

share|improve this answer

The following answer is not a solution, but an easy trick suitable for some purposes (and not for all purposes). The \overbracket{} command in package mathtools has two arguments (rule thickness and bracket height):

\overbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉}

Suppose you set a rule thickness smaller than x pt. If you set the bracket height at -x pt then you get a line (values between 0 and minus the rule thickness also yield a line, but small anomalies could be visible at its extremes).

The solution is not strictly "correct", since the resulting line is slightly shorter than that of \overline{} and the distance between lines shall not be the same that in \overline{\overline{}}. But for some purposes the outcome can be similar enough.

In the following minimal working example two commands are defined: in \myov{} the thickness is set in the preamble; in \myovline{} there is an argument for it. I set the bracket height at -1pt because all the thicknesses in the MWE are below 1pt:

$$\overline{A \vee B} = \overline{\overline{A} \wedge \overline{A}}$$ % Default thickness = 0.4 pt
$$\myovline{A \vee B}{0.4pt} = \myovline{\myovline{A}{0.4pt} \wedge \myovline{A}{0.4pt}}{0.4pt}$$
$$\myovline{A \vee B}{0.6pt} = \myovline{\myovline{A}{0.8pt} \wedge \myovline{A}{0.8pt}}{0.8pt}$$
$$\myov{A \vee B} = \myov{\myov{A} \wedge \myov{A}}$$

enter image description here

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.