It's not uncommon that answers to questions use a package which itself loads another package. In that case, details of the answer might end up being opaque if the answer uses commands documented in the dependency, but not in the actually loaded package.
Some common cases where this is the case:
- various table packages that all load
array
- various packages that load
xcolor
and/orgraphicx
I suggest that we try to explicitly mention and load the dependencies in answer code if the answer uses commands from both the main package and the dependency.
Here's some answers of the sort I have in mind: (I didn't really want to pick on people so I didn't add specific answers in my original version of the question.)
- https://tex.stackexchange.com/a/39047/2693 This answer was what prompted my question in the first place. (The issue is much less obvious in the answers present state). Peter's initial answer just used the
collcell
package, but part of the answer used\newcolumntype
. In fact, Martin (author ofcollcell
) is explicit in his documentation about the use ofarray
, so in this particular case, there isn't too much of a problem. In it's current state, since there has been some discussion independently about thearray
package, so the problem doesn't really arise any more. - https://tex.stackexchange.com/a/23690/2693 Here the comment makes it clear that the OP didn't necessarily understand the syntax of
newcolumntype
; thebeamer
documentation won't help other than (presumably) a pointer toarray
.
Here's an answer of mine that does what I'm suggesting:
- https://tex.stackexchange.com/a/37240/2693
The solution here uses
\resizebox
which is agraphicx
command. Althoughbeamer
loadsgraphicx
it makes little sense to just usebeamer
in the solution, so I loadedgraphicx
explicitly with a comment in the code to that effect.
\resizebox
comes fromgraphicx
(which it actually doesn't, it comes fromgraphics
; not that it really matters). You have a comment "loaded by beamer, but included here for explicitness" there, which for some new users might be more confusing than helpful. IMHO, it would be better mentioning it in the normal text before: "You could wrap the table in\resizebox
from thegraphicx
package. This package is already loaded bybeamer
." (Also you still miss a%
in this answer; see my comment there)