> 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.

But I still have to handle the natbib package in some way: it really needs
to be removed due to incompatibility.
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.


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.


Cheers,
---
Diego Queiroz



2011/4/24 Julien Rioux <jri...@physics.utoronto.ca>

> On 24/04/2011 4:07 PM, Diego Queiroz wrote:
>
>> Oh, just to know how I am handling things right now:
>>
>> * I created a new format called "pdfLatex + ABNT"
>> * Then I created a new conversor "TeX>  pdfLatex + ABNT", that runs a
>> Python script that:
>> ---- removes package natbib
>> ---- include my package (eg. abntcite)
>> ---- insert some commands that maps natbib commands to abntcite commands
>> (eg, \newcommand{\citet}{\@ifstar\citeonline\citeonline}, where \citet is
>> natbib command and citeonline is the abntcite command).
>> ---- run pdfLatex
>> * I changed my default output to generate my new format (pdfLatex + ABNT)
>>
>> This way, when I work with my layout, I can use natbib freely (because its
>> support is good) and the script handle things for me.
>>
>> Of course this solution is not elegant, but it works me for now.
>> Specially because I am the main user of this layout. :-)
>>
>> ---
>> Diego Queiroz
>>
>>
>>
>> 2011/4/24 Diego Queiroz<queiroz.di...@gmail.com>
>>
>>  I'm puzzled what you mean here. People have successfully used biblatex
>>>>
>>> with LyX---though complete and proper support isn't there, to be sure.
>>> And
>>> there are other BibTeX styles, such as apalike, that require (or strongly
>>> prefer) some external package to be loaded (apalike.sty, in that case),
>>> which of course one can do from the preamble. What is different in this
>>> case?
>>>
>>> Well, I'll explain my case, but I'm sure it applies for other cases.
>>> My citation style package is not compatible with natbib (they crash when
>>> used together, probably because both reimplement \cite command), but it
>>> provides me several citation commands, that are similar to citet, citep,
>>> citeonline, citeauthor and others provided by natbib (but with other
>>> names,
>>> as well).
>>>
>>> Currently, when I include natbib, LyX gives me support to use all these
>>> commands. From the citation dialog I am able to select if I want the
>>> author
>>> enclosed in parenthesis, without them, only the name, the year, force the
>>> author full name, and so on. These are all features of natbib mapped in
>>> the
>>> LyX dialog (this is what I call hardcoded).
>>>
>>> AFAIK, there is no good way to handle these things without asking the
>>> user
>>> to do everything manually (disable natbib, include the package in the
>>> preamble and put all citation in ERT is always possible, but it is not a
>>> good solution).
>>>
>>>  LyX 2.0 allows customization of how entries are displayed in the
>>>> citation
>>>>
>>> dialog.
>>>
>>> What kind of customization? I'm really not aware of this feature.
>>> I'm also not sure we're talking about the same thing...
>>> Do you have a link for me?
>>>
>>>
>>> Cheers,
>>> ---
>>> Diego Queiroz
>>>
>>>
>>>
>>>
>>> 2011/4/24 Richard Heck<rgh...@comcast.net>
>>>
>>>  On 04/24/2011 03:06 PM, Diego Queiroz wrote:
>>>>
>>>>  I am currently working on a layout for use the ABNT style with LyX
>>>>> (ABNT
>>>>> stands for "Brazilian National Standards Organization").
>>>>>
>>>>> To achieve this, I have three things to handle:
>>>>> 1. The document style (*.sty)
>>>>> 2. The bibliography style (*.bst)
>>>>> 3. The citation style (*.sty)
>>>>>
>>>>> The first and second topics are easy, I can create a *.layout to handle
>>>>> my *.sty file and LyX can directly use my *.bst file to generate the
>>>>> bibliography.
>>>>>
>>>>> The problem resides with the citation style because currently LyX only
>>>>> supports natbib and jurabib.
>>>>> I think it would be great if we allow the creation of other citation
>>>>> styles. This way, when we add a citation LyX will know how to properly
>>>>> display them.
>>>>>
>>>>>  I'm puzzled what you mean here. People have successfully used biblatex
>>>>>
>>>> with LyX---though complete and proper support isn't there, to be sure.
>>>> And
>>>> there are other BibTeX styles, such as apalike, that require (or
>>>> strongly
>>>> prefer) some external package to be loaded (apalike.sty, in that case),
>>>> which of course one can do from the preamble. What is different in this
>>>> case?
>>>>
>>>>
>>>>  BTW, the citation style handler appear to be very hardcoded on LyX,
>>>> which
>>>>
>>>>> is also far from ideal.
>>>>>
>>>>>  It depends on which part of it you mean. LyX 2.0 allows customization
>>>>> of
>>>>>
>>>> how entries are displayed in the citation dialog, but not of how
>>>> citations
>>>> are displayed in the text. That is something we've been meaning to do
>>>> for a
>>>> while---basically, pull out the CiteEngine stuff and related code into
>>>> the
>>>> layouts---but there are a lot of things to do, and there are few people
>>>> to
>>>> do them.
>>>>
>>>> Richard
>>>>
>>>>
>>>>
>>>
>>
> 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.
>
> The .module would look something like
>
> #\DeclareLyXModule[abntcite.sty]{ABNT citations}
> #DescriptionBegin
> #Citations using the ABNT style.
> #DescriptionEnd
>
> Format 11
>
> Provides natbib 1
>
> AddToPreamble
>  \usepackage{abntcite}
>
>  \newcommand{\citet}{\@ifstar\citeonline\citeonline}
>  etc.
> EndPreamble
>
>
>

Reply via email to