PHPackages                             seboettg/citeproc-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. seboettg/citeproc-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

seboettg/citeproc-php
=====================

Full-featured CSL processor (https://citationstyles.org)

v2.7.1(3mo ago)761.2M—8.4%43[43 issues](https://github.com/seboettg/citeproc-php/issues)[7 PRs](https://github.com/seboettg/citeproc-php/pulls)16MITPHPPHP &gt;=7.3

Since Mar 18Pushed 3mo ago9 watchersCompare

[ Source](https://github.com/seboettg/citeproc-php)[ Packagist](https://packagist.org/packages/seboettg/citeproc-php)[ RSS](/packages/seboettg-citeproc-php/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (51)Used By (16)

Pilots and co-pilots wanted
===========================

[](#pilots-and-co-pilots-wanted)

I no longer have time for the maintenance and further development of citeproc-php. I am looking for a successor for the maintenance and further development of citeproc-php. Follow the discussion at [\#200](https://github.com/seboettg/citeproc-php/discussions/200).

citeproc-php
============

[](#citeproc-php)

[![Latest Stable Version](https://camo.githubusercontent.com/e64ce3c93cc9c1340fa1f1574ece822d83e0271c002de90f16968980515c4084/68747470733a2f2f706f7365722e707567782e6f72672f7365626f657474672f6369746570726f632d7068702f762f737461626c65)](https://packagist.org/packages/seboettg/citeproc-php)[![Total Downloads](https://camo.githubusercontent.com/c85800b21641ad081e6c6471e946999aec304f76c7947aa1ad5b28fe42ca91df/68747470733a2f2f706f7365722e707567782e6f72672f7365626f657474672f6369746570726f632d7068702f646f776e6c6f616473)](https://packagist.org/packages/seboettg/citeproc-php/stats)[![License](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://opensource.org/licenses/MIT)[![Build Status](https://camo.githubusercontent.com/8aee8f885955911309999f2fb2b569c660bccb623375bc21feb41de1ab4612e2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7365626f657474672f6369746570726f632d7068702f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/seboettg/citeproc-php/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/ccecf33ef6a65c249fec0d20d9868b38346d08f8b6f9a461e5cb5532b34a192f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7365626f657474672f6369746570726f632d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/seboettg/citeproc-php/code-structure/master/code-coverage/src/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e7a04a4fb7387305db9d43a8e926345f3fe5cc8e54a2908b922c88482bb69032/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7365626f657474672f6369746570726f632d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/seboettg/citeproc-php/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/a5ddcc922610f872c3b14742dd28f29aa0b3826f42c1b06b308af32760d3c1e6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7365626f657474672f6369746570726f632d7068702f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![PHP](https://camo.githubusercontent.com/4d27b79c5323edb7ecce463f09bbcc8ef528cc82fc7cfc9742bd6d957e6d6849/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e332d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/4d27b79c5323edb7ecce463f09bbcc8ef528cc82fc7cfc9742bd6d957e6d6849/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e332d677265656e2e7376673f7374796c653d666c6174)[![PHP](https://camo.githubusercontent.com/f311edf63b46f2f062e149b802370491a6ebcb01c6f7d51c154930b589f978c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/f311edf63b46f2f062e149b802370491a6ebcb01c6f7d51c154930b589f978c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342d677265656e2e7376673f7374796c653d666c6174)[![PHP](https://camo.githubusercontent.com/c0ad4915f2f47cd8f418003308e6a07d76bf0cd44c69f926a1975895922a93aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/c0ad4915f2f47cd8f418003308e6a07d76bf0cd44c69f926a1975895922a93aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302d677265656e2e7376673f7374796c653d666c6174)[![PHP](https://camo.githubusercontent.com/eee1a66126229bfd89f4002156ad094ffe78d241b67313f0f90ad9fd9edc3a65/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/eee1a66126229bfd89f4002156ad094ffe78d241b67313f0f90ad9fd9edc3a65/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312d677265656e2e7376673f7374796c653d666c6174)

citeproc-php is a full-featured CSL 1.0.1 processor that renders bibliographic metadata into HTML-formatted citations or bibliographies using CSL stylesheets. It supports both bibliographies and citations (except for [Citation-specific Options](http://docs.citationstyles.org/en/stable/specification.html#citation-specific-options)).

Citation Style Language CSL
---------------------------

[](#citation-style-language-csl)

The Citation Style Language (CSL) is an XML-based format to describe the formatting of citations, notes and bibliographies, offering:

- An open format
- Compact and robust styles
- Extensive support for style requirements
- Automatic style localization
- Infrastructure for style distribution and updating
- Thousands of freely available styles (Creative Commons BY-SA licensed)

For additional documentation of CSL visit .

Installing citeproc-php
-----------------------

[](#installing-citeproc-php)

The recommended way to install citeproc-php is through [Composer](https://getcomposer.org).

```
$ curl -sS https://getcomposer.org/installer | php
```

Add the following lines to your `composer.json` file in order to add required program libraries as well as CSL styles and locales:

```
{
    "name": "vendor-name/program-name",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "citation-style-language/locales",
                "version":"1.0.0",
                "source": {
                    "type": "git",
                    "url": "https://github.com/citation-style-language/locales.git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "citation-style-language/styles",
                "version":"1.0.0",
                "source": {
                    "type": "git",
                    "url": "https://github.com/citation-style-language/styles.git",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "citation-style-language/locales":"@dev",
        "citation-style-language/styles":"@dev",
        "seboettg/citeproc-php": "^2"
    }
}
```

Next, run the Composer command to install the latest stable version of citeproc-php and its dependencies:

```
$ php composer.phar install --no-dev
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

You can then later update citeproc-php using composer:

```
$ composer.phar update --no-dev
```

If you have trouble using composer you will find further information on .

How to use citeproc-php
-----------------------

[](#how-to-use-citeproc-php)

citeproc-php renders bibliographic metadata into HTML-formatted citations or bibliographies using a stylesheet that defines the citation rules.

### Get the metadata of your publications

[](#get-the-metadata-of-your-publications)

Create a project folder:

```
$ mkdir mycslproject
$ cd mycslproject
```

First, you need a JSON-formatted array of publication metadata. Many services support CSL exports, such as [BibSonomy](https://www.bibsonomy.org), [Zotero](https://www.zotero.org/), and [Mendeley](https://www.mendeley.com/). If you don't use any of these services, you can use the following test data as a starting point.

```
[
    {
        "author": [
            {
                "family": "Doe",
                "given": "James",
                "suffix": "III"
            }
        ],
        "id": "item-1",
        "issued": {
            "date-parts": [
                [
                    "2001"
                ]
            ]
        },
        "title": "My Anonymous Heritage",
        "type": "book"
    },
    {
        "author": [
            {
                "family": "Anderson",
                "given": "John"
            },
            {
                "family": "Brown",
                "given": "John"
            }
        ],
        "id": "ITEM-2",
        "type": "book",
        "title": "Two authors writing a book"
    }
]
```

Copy this into a file in your project root and name that file `metadata.json`.

### Build a first simple script

[](#build-a-first-simple-script)

```
