Everything is working like a charm.
I also included the Requires natbib, which forces the inclusion of natbib in
the UI.
That is, I force the inclusion of natbib then I say that I'm already
providing it. lol

The last thing I wasn't able to avoid is the \bibliographystyle command.
My package sets internally the \bibliographystyle.
Is there some feature to prevent the insertion of this command by LyX? Or to
force a specific style?


Cheers,
---
Diego Queiroz



2011/4/24 Diego Queiroz <[email protected]>

> Now I got it.
> Julien, your suggestion is really good.
>
> Actually, my workaround with a new format and a script to parse and change
> the file was really terrible.
>
> I was reading the documentation for "Provide" and it really appear to do
> what you said.
> If such a feature is provided (a way to remove the natbib package), I think
> it is a good workaround for now.
> And your suggestion to make two layouts is also applicable. I'll try it
> later.
>
> Thanks again.
>
> ---
> Diego Queiroz
>
>
>
> 2011/4/24 Julien Rioux <[email protected]>
>
>> On 24/04/2011 4:47 PM, Diego Queiroz wrote:
>>
>>> Ah, there's something specific. So, without touching the code, you could
>>>>
>>> fake to use natbib for the UI part, and reimplement natbib's commands as
>>> you
>>> do in your python script. Except that I would just do it in a .module
>>> file
>>> instead of a python script.
>>>
>>> I confess I never used modules in LyX, but they appear to fit my problem
>>> in
>>> some parts. Thanks for the suggestion.
>>>
>>>
>> There was a hint in your messages that you used your own .layout file. You
>> could also just put what I described in the previous message in this .layout
>> file and never touch modules. Its a lot of the same syntax.
>>
>>
>>  But I still have to handle the natbib package in some way: it really
>>> needs
>>> to be removed due to incompatibility.
>>>
>>
>> That's what "Provides natbib 1" would do. It prevents LyX from putting
>> "\usepackage{natbib}" in the .tex file. I haven't tested it, but I'm quite
>> convinced it would work after some tweaking.
>>
>>
>>  Actually, my script also detect if the user is using natbib with
>>> AuthorYear
>>> or Numeric citations and behave different in each case. Sadly, I think I
>>> can't do a thing like this with LyX modules.
>>>
>>>
>>>
>> OK, maybe you've hit one limitation of this approach. But you can still
>> workaround that by having two different modules, one for each style.
>>
>>
>>  Anyway, I still think my feature is good.
>>> I mean, instead of having a hardcoded mapping of natbib commands with the
>>> UI, we could handle this better with some external mapping of this
>>> package.
>>> What will extend the functionality to similar packages as well.
>>>
>>>
>>>
>> Oh, yes, definetely, you pointed at a genuine lack in LyX. I just was
>> providing a workaround that fit in LyX's current customization capability.
>> It's easier to ship a .layout or .module file to a friend who would like to
>> try it out than it is to set up the appropriate converters in their LyX
>> installation, I would think. In any case, if the python script works for
>> you, no need to touch it. It's a clever way to do it, too.
>>
>>  Cheers,
>>> ---
>>> Diego Queiroz
>>>
>>>
>>>
>> Cheers,
>> Julien
>>
>
>

Reply via email to