Skip to main content

Zotero for reStructuredText

Project description

Background

Zotero is a useful tool for managing citations.

zot4rst is an extension to the Python docutils package for including citations in reStructuredText documents.

zot4rst is developed under Linux, has been tested on Windows, and should run under Mac OS.

Installation

  1. Install Zotero.

  2. Download and install zotxt:

    https://bitbucket.org/egh/zotxt/downloads/zotxt.xpi

  3. Install zot4rst:

    sudo python setup.py install

Quickstart

See example/example.rst, and the generated example/example.pdf and example/example.html. Citation syntax is identical to pandoc.

zot4rst automatically maps citation keys (e.g., @DoeTitle2010) to entries in the zotero database. The key should be of the form @AuthorTitleDate. So, for the item:

John Doe, “Article,” Journal of Generic Studies, 2006.

You could use: @DoeArticle2006. This should be easy to use, but the reference needs to be unambiguous, which might be a problem if there are multiple items with the same author, title, and year. I am looking into ways to handle this better.

To include Zotero citations in a reStructuredText document, you must use the bundled zrst2* scripts, which have been modified to include support for zotero directives. These executables are installed using setup.py above. Currently, they are:

  • zrst2html

  • zrst2odt

  • zrst2pdf

  • zrst2pseudoxml

  • zrst2rst

Sphinx

To use in sphinx, simply add the zot4rst.sphinx extension to your conf.py file:

extensions = ['zot4rst.sphinx']

Pelican

To use in pelican (version 3.1 or later), add the following to your pelicanconf.py file:

PLUGINS = [‘zot4rst.pelican_plugin’,]

Details

Some details, in no particular order.

Note that zrst2rst will transform your citations into plain reStructuredText files without the Zotero extension. For example:

A citation group :xcite:`[see @item1 p. 34-35; also @item3 chap. 3]`.

will become:

A citation group (see Doe 2005, p. 34–35; also Doe and Roe 2007,
chap. 3).

and the bibliography will be fully expanded. This can be used to create RST files that will work without zot4rst.

If you use a footnote citation format, zot4rst will insert footnotes for you.

However, if you also use regular autonumbered footnotes in the same section or paragraph, the ordering will be wrong. So if you want to do this, you will need to put your citations in a footnote explicitly. For example:

Water is wet. [#]_ But there are those who dispute it. [#]_

.. [#] :xcite:`[See @item3]`.

.. [#] These people are wrong.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zot4rst-0.3.0.tar.gz (21.1 kB view details)

Uploaded Source

File details

Details for the file zot4rst-0.3.0.tar.gz.

File metadata

  • Download URL: zot4rst-0.3.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zot4rst-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cbc635d438e498ff6ef22446ee009461c975e36cf7667e249427ebd2f68ff424
MD5 8fb9b86025fd8a64f8890e95ccf4ca7d
BLAKE2b-256 16759b442c0920a0b4571393da7a17152467045618cc1db9c69a56d59f5fbe6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page