Lyx/Kile integration

1,625 views
Skip to first unread message

Demetrio Girardi

unread,
Feb 21, 2008, 1:55:19 PM2/21/08
to zoter...@googlegroups.com
Attached is an extension which should make Zotero work better with
Lyx/Latex (I've been told it works with Kile too).

What it does:

- The BibTeX key format can be customized via GUI (the actual code comes
from the patch at
http://groups.google.com/group/zotero-dev/msg/95ff39b7c05968a0)

- There's an option to override the default key adding a tag in the
format 'key=BibTeX_key' to an item. I know, this is ugly -- using notes
may be a better idea, but I hope neither will be needed in a future
version of Zotero.

- "Save" button (to avoid the need to re-export a lot of times)

- Finally, a "push to LyX" button.

Known problems:

- The code is a mess. I patched and modified the BibTeX translator and
I'm using it outside the Translate object. Things shouldn't be done this
way, but with my limited experience I could find no other way to do some
of the stuff above. Hopefully a future Zotero release will have both key
customization and a key field, so that all this won't be needed anymore
and I could use Zotero.Translate instead.

- Obviously, keys generated from the extension (those that get pushed to
Lyx) are not compatible with those generated by Zotero's standard export
function.

- When Firefox is restarted, the BibTeX files where data was being
stored are forgotten, and must be set again.


I'd like to publish the extension somewhere, but I have no website of my
own and sourceforge/mozdev seem overkill for such a tiny project,
considered that I don't think I'll have much time to work on it anymore.
Do you have suggestions about this?

Regards,
- Demetrio Girardi

lytero.xpi

jamesh

unread,
Feb 21, 2008, 2:25:58 PM2/21/08
to zotero-dev
Thank you, Demetrio. This is a great beginning, and very functional
right now. Right now mozdev might be overkill, but as long as the
code is available, others can use and improve it, and using an
established site like mozdev would provide a central place for any
improvements and bugfixes. Such a useful plugin (even for the
relatively small number of people who need a academic citation program
like zotero and use lyx / kile) would be more active than the
thousands of even smaller or totally inactive projects on mozdev,

Thanks again!

On Feb 21, 1:55 pm, Demetrio Girardi <dement...@gmail.com> wrote:
> Attached is an extension which should make Zotero work better with
> Lyx/Latex (I've been told it works with Kile too).
>
> What it does:
>
> - The BibTeX key format can be customized via GUI (the actual code comes
> from the patch athttp://groups.google.com/group/zotero-dev/msg/95ff39b7c05968a0)
>
> - There's an option to override the default key adding a tag in the
> format 'key=BibTeX_key' to an item. I know, this is ugly -- using notes
> may be a better idea, but I hope neither will be needed in a future
> version of Zotero.
>
> - "Save" button (to avoid the need to re-export a lot of times)
>
> - Finally, a "push to LyX" button.
>
> Known problems:
>
> - The code is a mess. I patched and modified the BibTeX translator and
> I'm using it outside the Translate object. Things shouldn't be done this
> way, but with my limited experience I could find no other way to do some
> of the stuff above. Hopefully a future Zotero release will have both key
> customization and a key field, so that all this won't be needed anymore
> and I could use Zotero.Translate instead.
>
> - Obviously, keys generated from the extension (those that get pushed to
> Lyx) are not compatible with those generated by Zotero's standard export
> function.
>
> - When Firefox is restarted, the BibTeX files where data was being
> stored are forgotten, and must be set again.
>
> I'd like to publish the extension somewhere, but I have no website of my
> own and sourceforge/mozdev seem overkill for such a tiny project,
> considered that I don't think I'll have much time to work on it anymore.
> Do you have suggestions about this?
>
> Regards,
> - Demetrio Girardi
>
> lytero.xpi
> 29KDownload

Chun-Chung Chen

unread,
Apr 15, 2009, 5:04:20 PM4/15/09
to Demetrio Girardi, zoter...@googlegroups.com, c...@u.washington.edu
Thanks for the nice little plugin. I am using it with zotero 1.5b2 and
found that: 1. I need to change "Zotero.Utilities.prototype.strToDate"
in lytero.js to "Zotero.Utilities.Translate.prototype.strToDate" for
it to work. 2. the buttons for LyX only appear on the first window
when Firefox starts and missing from new browser windows opened
subsequently. Also, for the lyxpipe path, while "$HOME" does not work,
you can use the tilde "~" instead.

Chun-Chung Chen

On Feb 21 2008, 2:55 pm, Demetrio Girardi <dement...@gmail.com> wrote:
> Attached is an extension which should make Zotero work better with
> Lyx/Latex (I've been told it works with Kile too).
>
> What it does:
>
> - The BibTeX key format can be customized via GUI (the actual code comes

> from the patch athttp://groups.google.com/group/zotero-dev/msg/95ff39b7c05968a0)


>
> - There's an option to override the default key adding a tag in the
> format 'key=BibTeX_key' to an item. I know, this is ugly -- using notes
> may be a better idea, but I hope neither will be needed in a future
> version of Zotero.
>
> - "Save" button (to avoid the need to re-export a lot of times)
>
> - Finally, a "push to LyX" button.
>
> Known problems:
>
> - The code is a mess. I patched and modified the BibTeX translator and
> I'm using it outside the Translate object. Things shouldn't be done this
> way, but with my limited experience I could find no other way to do some
> of the stuff above. Hopefully a future Zotero release will have both key
> customization and a key field, so that all this won't be needed anymore
> and I could use Zotero.Translate instead.
>
> - Obviously, keys generated from the extension (those that get pushed to
> Lyx) are not compatible with those generated by Zotero's standard export
> function.
>
> - When Firefox is restarted, the BibTeX files where data was being
> stored are forgotten, and must be set again.
>
> I'd like to publish the extension somewhere, but I have no website of my
> own and sourceforge/mozdev seem overkill for such a tiny project,
> considered that I don't think I'll have much time to work on it anymore.
> Do you have suggestions about this?
>
> Regards,
>   - Demetrio Girardi
>

>  lytero.xpi
> 29KViewDownload

linming

unread,
Apr 20, 2009, 1:49:29 AM4/20/09
to zotero-dev
hi,

I modify the original code to satisfy my need:

1) change "Zotero.Utilities.prototype.strToDate" in lytero.js to
"Zotero.Utilities.Translate.prototype.strToDate" for
it to work with zotero 1.5b2. Thanks Chun-Chung Chen.

2) change "cite-insert" to "self-insert" in lytero.js, for I like to
insert bibtex key instead of the whole "\cite" command in LyX. I don't
know much about programming in firefox, so is there anyone having a
better solution?

Kevin Brubeck Unhammer

unread,
May 24, 2009, 6:24:39 AM5/24/09
to zotero-dev
I vote for putting it on mozdev until Zotero gets real LyX
integration...

On Apr 20, 7:49 am, linming <linmin...@gmail.com> wrote:
> hi,
>
> I modify the original code to satisfy my need:
>
> 1) change "Zotero.Utilities.prototype.strToDate" in lytero.js to
> "Zotero.Utilities.Translate.prototype.strToDate" for
> it to work with zotero 1.5b2.  Thanks Chun-Chung Chen.

Couldn't there be an if-check for version so users don't have to
change javascript on their own?

best regards,
Kevin B. Unhammer

Dan Stillman

unread,
May 24, 2009, 6:33:54 AM5/24/09
to zoter...@googlegroups.com
On 5/24/09 6:24 AM, Kevin Brubeck Unhammer wrote:
On Apr 20, 7:49 am, linming <linmin...@gmail.com> wrote:
  
hi,

I modify the original code to satisfy my need:

1) change "Zotero.Utilities.prototype.strToDate" in lytero.js to
"Zotero.Utilities.Translate.prototype.strToDate" for
it to work with zotero 1.5b2.  Thanks Chun-Chung Chen.
    
Couldn't there be an if-check for version so users don't have to
change javascript on their own?

I haven't looked at the Lytero code, but from privileged code strToDate() is available at Zotero.Date.strToDate in all versions of Zotero.
Reply all
Reply to author
Forward
0 new messages