# Making underscore persistent in LaTeX math mode (for long subscripts) [duplicate]

This question already has an answer here:

Is there at all a way to make underscores and carets persistent in LaTeX math mode? What I mean, is to be able to write several-character sub/superscripts without using curly brackets. Could LaTeX maybe understand that a white space determines the end of my sub/superscript?

A quick example. I'd like to have something like

x_ij y_ij


Compile to the same result as

x_{ij}y_{ij}


I understand that this is probably not a really reliable thing, but I'm looking to take notes faster during class!

Many thanks

## marked as duplicate by Werner math-mode StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Sep 20 '16 at 21:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

## migrated from stackoverflow.comSep 20 '16 at 18:12

This question came from our site for professional and enthusiast programmers.

• No, it's not reliable. You're very likely to forget a space when typing something like Let $x_i$ be the least... which would lead to a long string of weird errors. It would be easier something like x_ij_ so the subscript is delimited by another _ – egreg Sep 20 '16 at 18:17
• Related, if not equal: tex.stackexchange.com/q/96080/21930. – Manuel Sep 20 '16 at 19:40

## 1 Answer


\end{document}

• May be more robust is this other solution by David. I just remembered that I had asked the same question some time ago. – Manuel Sep 20 '16 at 19:41