wshanks / lyz

LyZ is a plugin for Zotero, which is intended to make working with LyX/Zotero more pleasant.
GNU General Public License v3.0
108 stars 13 forks source link

LyZ

LyZ is a plugin for Zotero, which is intended to make working with LyX/Zotero more pleasant. The latest source code is available at GitHub. The latest stable release is available from the GitHub releases page.

Features

NOTE: As of version 4.0, LyZ is distributed from the GitHub releases page. New updates will not be published to the location checked by previous versions of LyZ (the Mozilla Add-ons page). To receive new LyZ updates, please update to the latest version of LyZ.

Installation and Settings

  1. Download the lyz .xpi file from the GitHub releases page.
  2. Install LyZ in Zotero by selecting Add-ons from the Tools menu and then clicking the gear icon in the Add-ons window, selecting "Install add-on from file" and selecting the lyz .xpi file.
  3. Open LyX and set LyXServer path (in LyX go to menu, Tools > Preferences... > Paths and set LyXServer pipe to): Windows users can use the default path setting in LyZ, i.e. \\.\pipe\lyxpipe. Linux and Mac users can use e.g. ~/.lyxpipe and change the LyZ settings accordingly.
  4. By default all characters are escaped, e.g. š becomes \v{s}. Set extensions.lyz.use_utf8 to true in about:config to avoid escaping (in case you need to use non-latin scripts such as Chinese).
  5. Open document in LyX.

NOTE for Firefox users: Firefox treats .xpi files as Firefox add-ons and tries to install them. To download:

  1. Right click on link
  2. Select 'Save Link As'
  3. Select a folder to save in
  4. Click 'Save'
  5. The file will now download

You can also download it either with a different browser or with a command-line tool like curl or wget.

Adding and inserting citations

  1. Open the LyX document you want to add a citation to and put the cursor at the point in the text at which you want the citation added.

  2. From Zotero, select a citation and either from the LyZ menu or from the context menu (right click on the citation) do “Cite in LyX”.

    When you try to insert a citation into a new document (i.e. document unknown to LyZ) you have to select a BibTeX database. You will be asked to either create a new database or choose a database you have created before (by LyZ). Type the database name (*.bib extension is automatically added if you don’t provide it) and press OK. The citation is added into the BibTeX database you have just created and inserted into the LyX document. Your citation should appear in LyX document now. Further citations are automatically added to this database.

  3. Insert the BibTeX database into the LyX document by adding a bibliography (Insert->List/TOC->BibTeX Bibliography...) and then selecting the newly created *.bib file as the database.

    • From the bibliography window (which appears when the bibliography is created and may be accessed by clicking on the bibliography), you may also select a BibTeX style file (*.bst). This file determines how your references will be formatted in the bibliography. Most TeX packages come with a large number of style files. Some journals (or other publishing entities) also provide their own style files. One good option is apalike2.
    • From Document->Settings->Bibliography, you may choose a citation style which determines how your citations will appear in the text. Natbib and Jurabib give more flexible citation styles than the default numerical option.
    • A helpful introduction to working with BibTeX and LyX is available from the LyX website.
  4. Insert additional citations

    • New citations can be added from Zotero as above.
    • Previously added citations can be either inserted through Zotero or through the LyX interface.
  5. If you modify the reference information of previously cited items in Zotero, use “Update BibTeX” from the LyZ menu to update the BibTeX database.

Custom BibTeX keys

Update BibTeX

Menu command “Update BibTex” will update BibTeX database of the active LyX document. Whatever changes made in Zotero will be reflected in the update, including BibTeX keys if the BibTeX key format or the relevant information (first author, title, year) have been changed.

When a single BibTeX database is shared among several authors, e.g. using version control system such as SVN and CVS, LyZ database is updated from local working copy of BibTeX database.

Only current LyX document will be updated. Multiple document update is implemented, but seems unreliable. Needs more testing…

Synchronization between LyX/BibTeX/LyZ

When Zotero reference is changed, BibTeX database as well as the LyX document can be updated. This is useful when nice BibTeX keys are used, such as ‘author year title’ and e.g. the title or the first author’s surname has been modified, which will result in modification of the BibTeX key. When the “Update BibTeX” is run, you should select to update the LyX document in case your modifications to Zotero references might affect your BibTeX keys. Before the update, a backup of the active LyX document is made (extension *.lyz). LyZ will save, close and then reopen your document.

Notes on usage

Problems, Ideas, Requests

Please follow these tips to find out the source of your problem:

Common Issues

Update BibTeX does not work

Some users have found that the Update BibTeX command stops working unexpectedly. One possible solution is to edit the lyz.sqlite file in the Zotero data directory directly and to remove any bibliography entries in it that look malformed (e.g. some of their fields are empty). To edit lyz.sqlite, a SQLite editor is needed. The sqlite-manager Firefox addon is a light-weight option. If you experience this issue and have any insight on what causes it, please contact the developer via GitHub (open a new issue or comment on one of the closed issues related to Update BibTeX).

Using a non-standard lyxpipe

On Windows the lyxpipe path (\\.\pipe\lyxpipe) is a special path and not a real file. You should not try to change this path to something else.

Compatibility note

Zotero 5.0 introduced numerous API changes. Versions 3.0.0 and higher of Lyz are compatible with Zotero 5.0 and greater. Versions 2.x and lower only support Zotero version 4 and earlier.

Current state of development

The current maintainer of LyZ is not the original creator and is not intimately familiar with the source code. He plans to update LyZ as necessary to maintain functionality with the latest releases of LyX and Zotero. He will also happily accept and merge code patches submitted by other users. He will try to help with other issues that users experience, but he doesn't make any promises about being able to make things work.

How to Contribute

  1. Star the repository on GitHub. The number of stars on GitHub is one of the most visible metrics for gauging the level of interest in project.
  2. Encourage others to use the project, either directly or by writing a blog post. Besides GitHub stars, the other metric for gauging interest in the project is the total number of downloads of the xpi.

Credits

Lyz was written by Petr Šimon. It is inspired by Lytero, which Petr wanted to improve, but he ended up starting from scratch. Hence the new name. Thanks to Dan Stillman and mronkko at zotero.org forum. Justin Wood for BOM and escaping suggestions and donation! It is currently maintained on GitHub by Will Shanks.

  1. Submit new features or translations. However, keep in mind that new features add to the maintenance burden of the project. So get in contact before putting a lot of time into a new feature.