GeneralMultiple lines in mathematical formula

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pittopitto
Posts: 2
Joined: Mon Oct 15, 2007 12:45 am

Multiple lines in mathematical formula

Post by pittopitto »

Hello, I have a little problem. I need to build a special mathematical formula that contains multiple overlines or underlines, but in this format:

Code: Select all

---------
       ---------
AA     BB     CC
That is if, for example I have three variables AA, BB and CC, I need to put one line on AA and BB and another line on BB and CC.

How can I do that in LaTeX?

Thanks a lot

pitto

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
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Multiple lines in mathematical formula

Post by gmedina »

I don't know if there is a package that directly allows you to achieve what you want, but below I include a possible solution:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\newlength{\expWidth}
\settowidth{\expWidth}{AABB}
\[
 \overset{\rule{\expWidth}{0.5pt}\hfill}{AA\overline{BBCC}}
\]
\end{document}
Basically, I used \overline to draw a line from BB to CC and then \overset to place a line from AA to BB.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply