I stumbled accors \Vec{...} (notice the capitalised command). Since it is impossible to do case-sensitive searches on Google and SE, I have to ask: What does it do? Can I overwrite it? It seems to have the same effect as \vec{...}.
- 725
2 Answers
If I do
> ack '\\Vec[^f@t-]' /usr/local/texlive/2023/texmf-dist/tex/latex/
(the exclusion list in the regex is just to avoid false positives) the answer is
/usr/local/texlive/2023/texmf-dist/tex/latex/amsmath/amstex.sty
774:\gdef\Vec{\RIfM@\DN@{\mathaccent@{"017E }}\else
775: \DN@{\nonmatherr@\Vec}\fi\next@}
/usr/local/texlive/2023/texmf-dist/tex/latex/amsmath/amsmath-2018-12-01.sty
876:\def\Vec{\vec}
/usr/local/texlive/2023/texmf-dist/tex/latex/amsmath/amsmath.sty
902:\def\Vec{\vec}
/usr/local/texlive/2023/texmf-dist/tex/latex/lwarp/lwarp-amsmath.sty
156:\CustomizeMathJax{\let\Vec\vec}
So basically, the only package that defines \Vec is amsmath (amstex.sty is kept for backwards compatibility).
Why? If you look in amsmath.sty you'll see also \Acute, \Hat and so on for all math accents.
In the first versions of amsmath, the capitalized version was used to get stacked accents right, so you had to type
\Dot{\Hat{x}}
to get the right position of the accents. In later versions, the problem of stacking accents was solved in a different way (which adds a not so nice “feature”, but that's not the point), so the capitalized versions were redefined to be the same as the all-lowercase commands.
Using \Vec or \vec is exactly the same.
- 1,121,712
-
What is the not so nice “feature” added by the fix? (I had wondered about this, since I remembered using capitalisation for stacked accents, but it seems not to be recommended any more.) – LSpice Aug 09 '23 at 03:11
-
1@LSpice Nested accents may not work: https://tex.stackexchange.com/q/30327/4427 – egreg Aug 09 '23 at 08:58
TeX differentiates between uppercase and lowercase in general, so \vec is not the same as \Vec. In plain TeX, only \vec is defined, but the package amsmath defines \Vec as being the same as \vec ("for backward compatibility" as the manual states):
\def\Vec{\vec}
So, yes, if you mean the macro as it is defined by the amsmath package, it does exactly the same as \vec. And yes, in this case you could redefine it (after having loaded amsmath) without affecting the defintion of \vec. I am not sure whether redefining it is a good idea though, since this might break things where other packages rely on the fact that amsmath defines the capitalized macro to be the same as the non-capitalized one.
However, since you did not provide a minimal working example (MWE) the above is only a guess. There might also exist other packages or document classes that define \Vec in their own, different way, and it could be a problem to redefine this macro in this situation, of course.
- 48,848
-
1Thank you for your answer. Although your answer is also helpful, I think that @egreg's answer is more complete/correct in terms of the origin of
\Vec. – Gargantuar Apr 12 '23 at 13:06 -
1@Gargantuar Yes, I did not know about the history of this macro. – Jasper Habicht Apr 12 '23 at 13:07
\Vec(our course at least does it this way, instead of\Vect). – Gargantuar Apr 12 '23 at 13:04