No, LaTeX won't load geometry
a second time.
The first lines in the package are
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{geometry}[2010/09/12 v5.6 Page Geometry]
and their purpose is not only to announce the package.
Every time LaTeX loads a package, say foo.sty
, it does an important assignment:
\@namedef{[email protected]}{...}
where ...
stands for the contents of the optional argument to \ProvidesPackage
, if present; otherwise it's empty. What's important, though, is that
\[email protected]
is defined (it's not possible to access directly that macro). Moreover, it stores the options passed to the package in another macro
\[email protected]
What's the purpose of these macros? When
\usepackage[<options>]{foo}
is found, LaTeX first checks whether \[email protected]
is defined. If it isn't, it loads foo
with the given options. If it is, LaTeX doesn't load foo
and simply checks whether the option list given now is a subset of the option list it finds stored in \[email protected]
. If it is, LaTeX does nothing; otherwise it raises an error
! LaTeX Error: Option clash for package foo.
so the user is warned about the problem.
The only package that's allowed to be loaded multiple times is fontenc
. Of course a package could use the same trick as fontenc
, but this is strongly discouraged and no package I know of tries this devious behavior.
Some packages that are expected to be called by classes usually have a "setup" command, so that one can change the settings the class may have made without having to load the package with different options, which would be impossible. Examples are caption
and geometry
.
Some classes allow passing options to the package they load. For instance, one can say
\documentclass[xcolor={svgnames}]{beamer}
in order to pass the svgnames
option to xcolor
. When this isn't supported, there's always the possibility of saying, before \documentclass
,
\PassOptionsToPackage{<options>}{<package>}
where <package>
is the package we need to pass the <options>
to and is loaded by the class.
\RequirePackage
causes “option clash”