Re: Options of packages loaded by modules/Lyx
2015-12-05 0:00 GMT+01:00 Scott Kostyshak : > > Note that if you feel like testing, we would be interested in your > feedback. See here for installers for our most recent development > version: > > ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.2/lyx-2.2.0alpha2/ > > Scott > Will certainly test it sooner or later.
Re: Options of packages loaded by modules/Lyx
On Fri, Dec 04, 2015 at 05:07:24PM +0100, David wrote: > Am 04.12.2015 um 17:00 schrieb Jürgen Spitzmüller: > > > > "trunk" is the development version of LyX, i.e. forthcoming LyX 2.2. > > > > With LyX 2.1.x, you cannot use the descirbed feature with the todonotes > > module, since it only works for packages "known" to LyX (and the todonotes > > packages is not known to LyX 2.1). Making a package "known" requires a > > change > > in the LyX source code. > > > > With LyX 2.2, you just need to copy the following to Document > Settings > > > Local Layout: > > > > PackageOptions todonotes myoptions > > > > Jürgen > > > > Thanks for the clarification, Jürgen. Im excited about Lyx 2.2 :) Note that if you feel like testing, we would be interested in your feedback. See here for installers for our most recent development version: ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.2/lyx-2.2.0alpha2/ Scott signature.asc Description: PGP signature
Re: Options of packages loaded by modules/Lyx
Am 04.12.2015 um 17:00 schrieb Jürgen Spitzmüller: > > "trunk" is the development version of LyX, i.e. forthcoming LyX 2.2. > > With LyX 2.1.x, you cannot use the descirbed feature with the todonotes > module, since it only works for packages "known" to LyX (and the todonotes > packages is not known to LyX 2.1). Making a package "known" requires a change > in the LyX source code. > > With LyX 2.2, you just need to copy the following to Document > Settings > > Local Layout: > > PackageOptions todonotes myoptions > > Jürgen > Thanks for the clarification, Jürgen. Im excited about Lyx 2.2 :)
Re: Options of packages loaded by modules/Lyx
Am Freitag 04 Dezember 2015, 16:48:48 schrieb David: > Sounds interesting. But what is trunk and how would I have to change the > todonotes module in order to enable loading via the features interface? "trunk" is the development version of LyX, i.e. forthcoming LyX 2.2. With LyX 2.1.x, you cannot use the descirbed feature with the todonotes module, since it only works for packages "known" to LyX (and the todonotes packages is not known to LyX 2.1). Making a package "known" requires a change in the LyX source code. With LyX 2.2, you just need to copy the following to Document > Settings > Local Layout: PackageOptions todonotes myoptions Jürgen
Re: Options of packages loaded by modules/Lyx
Am 04.12.2015 um 16:40 schrieb Jürgen Spitzmüller: > Am Dienstag 01 Dezember 2015, 15:04:07 schrieb Richard Heck: >> If so, then a PassOptionToPackage tag would be a very good idea. These >> could be output very early, yes? > > We have such a thing already: > > PackageOptions todonotes myoptions > > (only works in trunk, since the todonotes module from the wiki does not load > todonotes via LyX's features interface). > Sounds interesting. But what is trunk and how would I have to change the todonotes module in order to enable loading via the features interface?
Re: Options of packages loaded by modules/Lyx
Am Dienstag 01 Dezember 2015, 15:04:07 schrieb Richard Heck: > If so, then a PassOptionToPackage tag would be a very good idea. These > could be output very early, yes? We have such a thing already: PackageOptions todonotes myoptions (only works in trunk, since the todonotes module from the wiki does not load todonotes via LyX's features interface). Jürgen
Re: Options of packages loaded by modules/Lyx
On Mon, Nov 30, 2015 at 09:03:08PM +0100, David Rörich wrote: > Dear list, > Just a note that this was cross-posted here: http://tex.stackexchange.com/questions/280938/can-i-change-options-of-packages-loaded-by-a-lyx-module Scott signature.asc Description: PGP signature
Re: Options of packages loaded by modules/Lyx
Am 01.12.2015 um 20:41 schrieb Guillaume Munch: > > 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's clever ;)
Re: Options of packages loaded by modules/Lyx
> > Thanks for these interesting approaches, Richard! In this regard, it > would also be nice if one could point Lyx to module files that are > located outside ~/.lyx > This way I could save the module file together with my document (in a > git repo) and have it ready wherever I need it. > Or maybe an include tag does exist, something like IncludeFile path/to/myModulue.module End ?
Re: Options of packages loaded by modules/Lyx
Am 01.12.2015 um 20:36 schrieb Richard Heck: > On 11/30/2015 04:33 AM, David wrote: >> Dear list, >> >> 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 [1]. >> 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). 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 systems I use) >> >> What other options do I have? > Copy todonotes.module to todonotes2.module. Open it and make whatever > changes you > wish (I'd make some change to the first line and description so you know > which is which), > then reconfigure LyX so it is seen and use the modified version in this > paper. > > Alternatively, copy the contents of todonotes.module to Local Layout and > make your > changes there. Then remove the ToDo Notes module from the list of used > modules. > > Richard > Thanks for these interesting approaches, Richard! In this regard, it would also be nice if one could point Lyx to module files that are located outside ~/.lyx This way I could save the module file together with my document (in a git repo) and have it ready wherever I need it. Contrary to what I wrote before, passing the options as global options to the document class *does* work. On my first try, I didn't see the effect because I use the tikzexternalize package and todonotes renders its notes with Tikz. This prevented rerendering. David signature.asc Description: OpenPGP digital signature
Re: Options of packages loaded by modules/Lyx
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.
Re: Options of packages loaded by modules/Lyx
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!! >> 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 If so, then a PassOptionToPackage tag would be a very good idea. These could be output very early, yes? Richard
Re: Options of packages loaded by modules/Lyx
Dear David, Le 30/11/2015 10:22, David Rörich a écrit : (sorry if this is a double post) The lists now work again. 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... 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?
Re: Options of packages loaded by modules/Lyx
On 11/30/2015 04:33 AM, David wrote: > Dear list, > > 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 [1]. > 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). 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 systems I use) > > What other options do I have? Copy todonotes.module to todonotes2.module. Open it and make whatever changes you wish (I'd make some change to the first line and description so you know which is which), then reconfigure LyX so it is seen and use the modified version in this paper. Alternatively, copy the contents of todonotes.module to Local Layout and make your changes there. Then remove the ToDo Notes module from the list of used modules. Richard