GeneralRedefine reserved character

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Andy32
Posts: 2
Joined: Wed Nov 30, 2011 6:17 pm

Redefine reserved character

Post by Andy32 »

Is it possible to do an equivalent of \renewcommand{\command}[args]{text}
for a reserved character such as the caret (^)? For example, if I want to reduce the space after every superscript, i.e. i would want a^b to be replaced by a^b\! systematically?

Many thanks

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
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

Redefine reserved character

Post by Stefan Kottwitz »

Hi Andy,

welcome to the board!

You could make ^ to an active character and then define a macro for it:

Code: Select all

\catcode`^=\active
\newcommand{^}[1]{{\sp{#1}\!}}
Stefan
LaTeX.org admin
Andy32
Posts: 2
Joined: Wed Nov 30, 2011 6:17 pm

Re: Redefine reserved character

Post by Andy32 »

Hey thanks glad to be here and that looks perfect!
Post Reply