Math & Science\overline{f}+ \overline{g}

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
avoyance
Posts: 13
Joined: Sun Feb 13, 2011 1:53 am

\overline{f}+ \overline{g}

Post by avoyance »

\overline{f}+ \overline{g}

the resulting overlines for f and g are not of the same height.
How can I eligently made the equal?

(of course I can raisebox by a few pt. the number is by trial-and-error)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

\overline{f}+ \overline{g}

Post by localghost »

Use an invisible math strut to get even placed lines.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\newcommand*{\oline}[1]{\overline{#1\mathstrut}}

\begin{document}
  $\oline{f}+\oline{g}$      % good

  $\overline{f}+\oline{g}$   % bad
\end{document}
As you can see from the above code, you have to use the new command exclusively. Otherwise the lines are not placed properly above different strings.


Best regards and welcome to the board
Thorsten
Post Reply