Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • I would personally say that it is bad. ^{-1} is directly readable by others and yourself in the future. It is not worth having a new command to save just a few keystrokes(in my opinion). \inv could collide with other things that comes from packages or what you do yourself elsewhere or in the future. Commented Nov 10, 2020 at 12:39
  • I am not sure that your question can be answered!? There will be a lot of opinions, but maybe no definitive answer. Commented Nov 10, 2020 at 12:40
  • 13
    To the contrary! It is good practice, if you have a lot of inverses to type, for instance group theory material, with maybe an average of more than one inverse per line. You could also define some editor shortcut, but that depends on the editor. A possible improvement could be \newcommand{\inv}[1][1]{^{-#1}}, so you can type a\inv but also a\inv[2] for a^{-2}. Anyway, as you see, this is mostly a question of opinion.
    – egreg
    Commented Nov 10, 2020 at 12:45
  • 1
    @V.Ch. Further extensions only really make sense for specific purposes that depend on your context. For instance, if you want to be able to take \inv of a' as in my answer, you could use the xparse package to allow this. For instance, you could add an optional star so that a\inv* produces a^{\prime -1}.
    – Gaussler
    Commented Nov 10, 2020 at 13:46
  • 1
    @V.Ch. See my updated answer. ;-)
    – Gaussler
    Commented Nov 10, 2020 at 19:52