GeneralCommands confilct

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
drpartha
Posts: 43
Joined: Wed Dec 02, 2009 1:41 am

Commands confilct

Post by drpartha »

We often use several \usepackage in our documents. If there is a command say \partha defined in two packages, how does LaTeX find out or decide which \partha to use ? Does LaTeX give a error if there is such a conflict ? How do we find ou which two packages are conflicting ?

partha

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Commands confilct

Post by josephwright »

If the people who write the packages have used \newcommand, then an error will come up when the second definition is given. This is because \newcommand checks first to see if a definition exists before it does its work. On the other hand, if everything is done with \def then there will be no error: TeX is quite happy to overwrite definitions. Luckily, most people use \newcommand at least for user functions, so you should get errors in most clashing cases.
Joseph Wright
Post Reply