Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've seen duplicated package inclusion multiple times in questions. I've looming memories of comments like "it's a really bad thing to do" (which I couldn't find).

I was wondering what are the drawbacks of doing something like this. Other than realisation like "I've deleted the \usepackage but my code still uses the package".

Example:

\usepackage{floatrow}
...
\usepackage{tikz,floatrow,hyperref}

What troubles can be caused that way other than "bad sourcecode"?

share|improve this question
10  
latex detects this and skips the second without loading it. Unless you have incompatible arguments, in which case you get an error. so it's not bad, it was designed that way as a feature, so you could have two packages each loading (say) color, and color only getting loaded once. –  David Carlisle Dec 3 '13 at 23:09
3  
In addition to what David said, if you give options to the second instance, you will invite trouble. ;-) –  Harish Kumar Dec 3 '13 at 23:14
1  
@HarishKumar you can use options on the second load so long as they are a subset of the options used the first time. –  David Carlisle Dec 3 '13 at 23:22
add comment

1 Answer

up vote 6 down vote accepted

LaTeX detects this and skips the second without loading it. Unless you have incompatible options, in which case you get an error. so it's not bad, it was designed that way as a feature, so you could have two packages each loading (say) color, and color only getting loaded once.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.