[tex-eplain] Incorporating url.sty
geolsoft at mail.ru
geolsoft at mail.ru
Tue Aug 23 16:57:59 CEST 2005
On Tue, Aug 23, 2005 at 04:16:38PM +0200, Karl Berry wrote:
> Do we end up calling the
> macro which actually executes the option for the package? Or are we
> constructing a list that we pass when we input color.sty, as if we were
> really doing
> \usepackage[option1,option2]{color}
No, it is more like saving in some macro the code which has
to be executed in order to set an option, and later call
that macro upon call to \pkgoptions{...}{...}. I might be
wrong, but I figured that LaTeX packages do something like
this for every option they support:
\DeclareOption{hyphens}{\def\do at url@hyp{\do\-}}
By default, miniltx.tex just makes
\let\DeclareOption\@gobbletwo
so all option declarations go to waste. Instead, we
(re)define \DeclareOption to take the name of the option
(the first parameter), to construct a macro name using this
name (pkgoptions at PACKAGENAME@hyphens), and to define this
macro to the code (the second parameter). Later on, after
the package will have been loaded, the user might call
\pkgoptions{option}{pkg} to have that macro called and the
option applied.
> (And BTW isn't xcolor better than and compatible with color?)
I don't know, I've never heard of it. It is not even on my
system. I am very backwards in this respect, I have a
Debian, and quite an old one :-O
> BTW, why the first parameter to \pkgoptions is optional?
> Does this call make any sense: \pkgoptions{url}?
>
> No, it doesn't make sense. I was just thinking "\usepackage" syntax in
> my head.
Then, I think, if we don't make it optional, we should
change the order, too:
\pkgoptions{PKG}{OPTION}
instead of
\pkgoptions{OPTION}{PKG}
--
Best regards,
Oleg Katsitadze
More information about the tex-eplain
mailing list