Working to find Latex error – Redefinition Problem
I have been trying-out the several ways of writing a vector symbol with harpoon above, - as described in several replies to an early post ref: how to set vector and tensor symbols with horizontal bars above
They all worked fine and I was simply experimenting, commenting out the various alternatives to see the effect of each - then suddenly started getting a compilation error:-
“! LaTeX Error: Command `\vec' already defined.”
Alas due to the ad hoc way I was trying out each vector symbol I am not quite sure how I managed to get this error. Simply undoing the last commented-out section should of course “fix it” – but that doesn’t seem to be the case! The strange thing is, that those different ways to draw that vector still appeared (correctly rendered) in the .pdf output. I must have added something to cause the redefinition error – but after much searching I cannot see what it is!
Resorted to looking for said symbol, \vec, in the \usepackage{} .sty files. And found, \vec it is defined in both amsmath.sty and fdsymbol.sty. The problem now is how to correct this situation?
Are such redefinitions (collisions) commonplace in a miktex build which presumably has many \usepackage{}? Or if not, how do each of the “identifiers” (excuse lack of correct terminology) maintain a unique presence in an overall .tex build? Do Tex systems have any methods in place to handle collisions of symbol names?
To summarize my questions:
1. how to correct this redefinition error
2. how should I proceed in future with regard to general TeX usage in relation to avoiding the redefinition problem in \usepackages
HERE IS THE ERROR INFORMATION
~~~~~~~~~~~~~~~~~~~~~~~~~
"C:\Program Files\MiKTeX 2.9\tex\latex\fdsymbol\fdsymbol.sty
! LaTeX Error: Command `\vec' already defined.
See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help
.... ...ccent{\vec}{\mathord}{largesymbols}{"84}
~~~~~~~~~~~~~~~~~~~~~~~~~
In fdsymbol.sty, line 1799 has:-
\DeclareMathAccent{\vec}{\mathord}{largesymbols}{"84}
Thank you
\documentclass{article} \usepackage{fdsymbol} \usepackage{amsmath} \begin{document} $\vec x$ \end{document}– Steven B. Segletes Apr 25 '16 at 15:03\let\macroname\relaxwhere\macronameis the redundant symbol. Then load the 2nd package, whose definition will prevail. – Steven B. Segletes Apr 25 '16 at 15:05auxfile and any other auxiliary files before recompilation will frequently correct the issue. – Steven B. Segletes Apr 25 '16 at 15:07