Le 01/12/2015 20:04, Richard Heck a écrit :
On 12/01/2015 02:41 PM, Guillaume Munch wrote:
Dear David,

Adding another \usepackage[myOptions]{todonotes} to my preamble causes
an options clash. I tried to

*) Set the options globally by passing them to the document class (as
suggested by LaTex). No error, but also no effect.
*) Use \PassOptionsToPackage. No error, but also no effect. I think this
command must be used *before* loading the package, which I can't do as
the module's preamble additions are done *before* the user's additions.

There's a dirty, but quite general hack that I have often used in the
past. In "class options", add:

   ]{myClass}\PassOptionsToPackage{myOptions}{todonotes}%

I'd be happy to hear about a better solution...

That really is a hack!!

Yeah sorry about that.

(Please please do not attempt anything at preventing such things because
I have no alternative for the moment.)


A possible solution would be to change the module itself. But I don't
like this solution much because it would have a system wide effect where
I only want it to affect the document. (Also, I don't want to change the
moule on all systems I use.)


It is possible to redefine insets in "Local Format". I'm curious as
well to hear whether something can be done there to pass new package
options. If not, would it make sense to implement a
PassOptionToPackage layout command?

What happens if you just do:

     AddToPremable
         \PassOptionsToPackage...
     EndPreamble

in local layout? I'll guess it may not work, since this line will be
output too late....

Yes, it's too late.


If so, then a PassOptionToPackage tag would be a very good idea. These
could be output very early, yes?

I do like the idea of a PassOptionToPackage tag.

But in regards to my hack, I could completely get rid of it only if we
had an AddToEarlyPreamble section the adds lines before the
LyX-generated preamble.

Some options like \zoomfactor even want to be output before the document
class, and I think some command had also to be moved to before the
documentclass recently. Maybe we need a general solution for such issues.

Reply via email to