Text FormattingBar above and below character

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
AdiJAIN1129
Posts: 3
Joined: Sun Aug 30, 2015 11:24 pm

Bar above and below character

Post by AdiJAIN1129 »

Hi, so I need to be able to put a bar both above and below the same character. I know I can use \bar{X} to put a bar above X and use accents to put one below, but what will allow me to have a bar over the letter and a bar below the same letter?

Thanks!

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Bar above and below character

Post by cgnieder »

Welcome to the LaTeX community!

Do you need text accents or math accents?

Code: Select all

\documentclass{article}

\begin{document}

Text: \b{v} \={v} \b{\={v}}

Math: $\underline{v}$ $\bar{v}$ $\underline{\bar{v}}$

\end{document}
There's also \underbar but its contents are placed in text mode so it's not suitable for mathmode.

There's also the accents package for a math underbar (and other things):

Code: Select all

\documentclass{article}
\usepackage{accents}
\begin{document}

Math: $\underaccent{\bar}{v}$ $\underaccent{\bar}{\bar{v}}$

\end{document}
Regards
site moderator & package author
AdiJAIN1129
Posts: 3
Joined: Sun Aug 30, 2015 11:24 pm

Re: Bar above and below character

Post by AdiJAIN1129 »

Ah, I didn't realize you could combine the use of underaccent and bar like that. That's perfect, thanks!
Post Reply