Math & ScienceHigher position of indexes with double underlining

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Higher position of indexes with double underlining

Post by Montag »

Hello,

is there a way to lift the indexes a bit up when the are put right next to a double underlined symbol?
doubleunderline-index.jpg
doubleunderline-index.jpg (28.09 KiB) Viewed 4577 times
Attachments
double-underline-index.tex
(297 Bytes) Downloaded 262 times
Last edited by Montag on Sat Jan 08, 2011 11:55 am, edited 1 time in total.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Higher position of indexes with double underlining

Post by frabjous »

If you wanted to make it so that the underlining didn't affect the placement of the scripts at all, you could use definitions using the \smash command:

Code: Select all

\newcommand{\uli}[1]{\smash{\underline{#1}}}
\newcommand{\dund}[1]{\smash{\underline{\underline{#1}}}}

Personally, I prefer to use the \uuline command from the ulem package for double underlining, and then you could use:

Code: Select all

\usepackage[normalem]{ulem}
\newcommand{\uli}[1]{\smash{\underline{#1}}}
\newcommand{\dund}[1]{\smash{\uuline{#1}}}

If, however, you like the lowering of the script for the single-underlining, but only wanted it lowered the same amount for double overlining, then it gets a little more complicated, e.g. (without ulem):

Code: Select all

\newcommand{\uli}[1]{\underline{#1}}
\newcommand{\dund}[1]{{\smash{\underline{\underline{#1}}}\vphantom{\underline{#1}}}}

Or with ulem:

Code: Select all

\usepackage[normalem]{ulem}
\newcommand{\uli}[1]{\underline{#1}}
\newcommand{\dund}[1]{{\smash{\uuline{#1}}\vphantom{\underline{#1}}}}
Take your pick!
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Re: Higher position of indexes with double underlining

Post by Montag »

Thank you, Frabjous. \smash it is, it comes with amsmath.


Out of curiousity, why do you prefer ulem's \uuline?
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Higher position of indexes with double underlining

Post by frabjous »

It's just more compact. For that matter I prefer its single \uline to the regular \underline, which I think draws the line too low, and it looks funny. But to each their own! Also, in text mode, the regular \underline prevents line breaks, if I remember right.
Post Reply