Timeline for Is it bad practice to replace a^{-1} with a user-defined command?
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 11, 2021 at 10:06 | history | edited | Gaussler | CC BY-SA 4.0 |
Updated the answer to fit with the syntax of version 0.500
|
Nov 11, 2020 at 6:24 | history | edited | Gaussler | CC BY-SA 4.0 |
deleted 4 characters in body
|
Nov 11, 2020 at 6:24 | comment | added | Gaussler | @V.Ch. The Declare variant overrides any previous definitions. I guess I should have used the New variant. Updating the answer with this. | |
Nov 10, 2020 at 22:00 | comment | added | Hilbert Jr. |
@Gaussler I'm trying to get the same thing working with NewDocumentCommand, but it's not working so far \NewDocumentCommand{\inv}{s 0{#1}}{\IfValueTF{#1}{^{\prime-#2}}{^{-#2}}} .
|
|
Nov 10, 2020 at 21:54 | comment | added | Hilbert Jr. | @Gaussler thanks for the updated answer! Is there a difference between DeclareDocumentCommand and NewDocumentCommand in xparse? | |
Nov 10, 2020 at 21:53 | vote | accept | Hilbert Jr. | ||
Nov 10, 2020 at 19:52 | history | edited | Gaussler | CC BY-SA 4.0 |
added 1034 characters in body
|
Nov 10, 2020 at 14:30 | comment | added | Mico |
See also difference between \prime and ' in math mode
|
|
Nov 10, 2020 at 14:23 | comment | added | Gaussler |
In fact, a' is equivalent to a^{\prime} . Knuth made it this way precisely so that you can type a^{\prime 2} to get a'². You should never write a\prime , however, as this will put a giant prime to the right of your a .
|
|
Nov 10, 2020 at 14:21 | comment | added | Hilbert Jr. |
Incidentally, is there a difference between a' and a\prime ? I've been using the former this whole time, but I'm noticing people using the latter in this thread.
|
|
Nov 10, 2020 at 13:32 | comment | added | Gaussler |
@V.Ch. You have a valid point. My keyval-based approach makes the most sense when writing papers with complicated constructions like \mathcal{C}_{/X}^{\mathrm{op}} or \mathcal{D}^{b,\ge0}(X) . Then I find it blessing to be able to instead write something like \catC[over=\vX,op] and \der[bounded,positive degree]{\vX} . But that is entirely a matter of taste, of course. ;-)
|
|
Nov 10, 2020 at 13:26 | comment | added | Hilbert Jr. | The double superscript error is kind of a dealbreaker, but I have to say that your method looks unnecessarily complicated to me (it could be simply because I'm new to LaTeX and this is actually considered normal). | |
Nov 10, 2020 at 13:09 | history | edited | Gaussler | CC BY-SA 4.0 |
added 25 characters in body
|
Nov 10, 2020 at 12:59 | history | answered | Gaussler | CC BY-SA 4.0 |