5

In Lyx, is it possible to change package options of packages that are loaded by modules? Specifically, I tried to set the options of the todonotes package which I use in conjunction with the TODO Notes module. This module loads the package without passing any options to it. Specifically, it adds

\RequirePackage{todonotes}

to the preamble.

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 and this answer). 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.

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 machines I use)

What other options do I have?

Deve
  • 604
  • Maybe \AtBeginDocument{\PassOptionsToPackage{…}}. Another solution to prevent such clashes generally consists in writing the options as options for the document class. Not knowing what are these options, the class will propose them to every loaded package. – Bernard Dec 01 '15 at 11:33
  • @Bernard Thx for your reply. AtBeginDocument does not work in my case but passing the options to the doc class does. I had tried this but had the tikzexternalize package in effect which prevented a rerendering of the Todo notes. – Deve Dec 01 '15 at 13:17
  • Just a note that this question was cross-posted here: https://www.mail-archive.com/lyx-users@lists.lyx.org/msg102186.html – scottkosty Dec 01 '15 at 22:48
  • reposted (because mailing list was not working) at https://www.mail-archive.com/lyx-users@lists.lyx.org/msg102187.html and at https://www.mail-archive.com/search?l=mid&q=565C2350.3010802%40inue.uni-stuttgart.de – scottkosty Dec 01 '15 at 23:07

1 Answers1

5

Buried in the discussion on the LyX forum at https://www.mail-archive.com/lyx-users@lists.lyx.org/msg102234.html there seems to be an answer if you're using LyX 2.2 or higher. Place into Document > Settings > Local Layout:

PackageOptions todonotes myoptions

This has worked for me in LyX 2.2.0 to set the notes background color to a pastel green:

PackageOptions todonotes backgroundcolor=green!40