# Ensuring non-italicization of a character [duplicate]

I would like square brackets to never be italicized, even in a \textit environment. That is, I would like to type [ but have it always replaced with \textup{[}, and similarly for the right bracket. Apparently \newunicodechar doesn't work for the standard ASCII characters.

Is there some other way?

## marked as duplicate by cfr, Milo, Phelype Oleinik, Troy, Stefan PinnowAug 2 '18 at 4:21

• It’d be pretty straightforward to support \textit{\bracket{foo} bar}, but are you looking to make [ and ] active characters and not have the other versions available at all? – Davislor Jul 14 '18 at 19:37