Extension:Bibtexio
From MediaWiki.org
|
Release status: experimental |
|
|---|---|
| Implementation | Extended syntax |
| Description | Implement automated bibtex-format bibliography page and in-text IEEE citation with bottom-of-page IEEE reference list. |
| Last Version | 0.1 |
| MediaWiki | 1.12 |
| License | GPL |
| Download | bibliography.tar.gz |
|
check usage (experimental) |
|
Contents |
[edit] Motivation
This extension solved these issues for me:
- Simple and quick to install with minimal configuration.
- bibtex format Bibliography page
- IEEE style in-text citation.
- IEEE style bottom-of-page references.
- I was unable to get the very nice-looking Extension:Bibwiki working in time for my grad work. Bibwiki conflicted with the File Indexer extension, which I use to keep track of some papers.
[edit] History
This extension was adapted from Extension:Bibliography by Thomas Pfeiffer, and then re-adapted by NikosFrangakis Extension_talk:Bibliography. Then re-adapted for my needs.
This extension is used on our internal department wiki. I'm re-publishing this without warranty. I don't guarantee that this php is secure in any way, since I'm not a PHP coder.
This code is a ugly because I code only out of necessity to meet my grad work needs. It could use your help. See To Do (or not To Do).
[edit] What can this extension do?
- In-text IEEE format citations using brackets, like this [1]
- In-text citations are auto-numbered. The first reference [1] then the second [2] and so on.
- Optionally print a list of auto-numbered references at the bottom of the page, in IEEE format.
- Bibliography information is stored on the Bibliography page in bibtex format.
- All fourteen (14) bibtex formats are supported.
- Automatic checking for fields required by bibtex to make sure you fill them in.
- Bibtex url field automatically converted to clickable link.
- Bibtex wikilink filed automatically converted to local file/image link - I link to uploaded papers in pdf format.
- All references are keyed on the Bibtex citation key. This allows you to re-use a reference over an over just by continuing to reference its citation key.
- All entries that have a value, even new ones you create for your own needs, will print in the Bibliography page.
- Add automatically-generated fields by editing $IP/extensions/bibliography/bibtex_fields.php
[edit] Quick Usage
- Unpack the file in the extensions directory. Add this to the bottom of your 'localsettings.php file.
require_once("$IP/extensions/bibliography/bibliography.php");
- Create a Bibliography page and put this at the bottom.
<bibexport />
- Go to the page where you want the references. Put this at the top:
<bibimport />
- Put this at the bottom:
<bibprint />
- Make some references on the page like this. Replace CitationKey with your bibtex-style citation key (no spaces). Don't duplicate keys, as there is no checking for duplicated citation keys.
<bib id='CitationKey' />
- Save page and click to create a new bibtex entry.
[edit] Long Usage
- Ensure bibliography is imported at the top of the page, before any references are made.
<bibimport />
- Create an in-text reference on the page like this
<bib id='CitationKey' />
. - Save the page.
- Since the reference you created doesn't exist, it will appear in red like this, [1].
- Mouseover the red [1] and the popup will offer to let you create a new bibtex entry.
- Also, you can have the references print at the bottom of the page. Just put this at the bottom of the page.
<bibprint />
- If you add the bibprint command and then save the page, you will see this at the bottom of the page

- Click on the type of bibtex reference you want in the mouseover or from the list at the bottom of the page. They will take you to the same place. For this example, I will click book. You will then see this automatically...

- To demonstrate the automatic required bibtex field checking, I will simply click save page. You will see this:

- To continue the example, I will enter the required information and three optional pieces of information like this. This will show you that the green boxes asking for required information don't appear in the source when you edit a page, and that they disappear when you fill them in. This will also show you that although the page source shows all bibtex fields, only the filled in ones (optional/ignored fields) are printed on the Bibliography page. Finally, the url and wikilink automatically become clickable.

- Then save page and you will see this. url will be an external URL, and wikilink links to a local server-side file. I use this to link journal articles in pdf format the we have written.

- Very important, you must add this line to the bottom of the bibliography page:
<bibexport />
- Finally, navigate back to your original page where you made the reference. The reference number will turn from red [1] to blue [1]. Also, the mouseover will contain quick information about the the reference, and the bottom of the page will have IEEE-style reference. Both will are automatically hyperlinked to the bibtex entry on the Bibliography page.

- One last option is to create a BibliographyPrint page to print all of your references in IEEE style all on one page. Add only one thing to the page:
<bibprint />
[edit] Download instructions
Download and unzip in your $IP/extensions directory. bibliography.tar.gz
- Warning - if you put it in any directory other than $IP/extensions/bibliography you will break this extension. It has some ugly hacks in it that need to be rooted out.
[edit] Installation
To install this extension, add the following to LocalSettings.php:
require_once("$IP/extensions/bibliography/bibliography.php");
Make sure the $IP/extensions/bibliography/bibliography.php directory is writable, because there is a hack using a tmp file in this directory (inherited with the codebase).
[edit] See also
- Extension:Bibliography by Thomas Pfeiffer
- Extension_talk:Bibliography by NikosFrangakis
[edit] To Do (or not To Do)
- When <bibimport /> is at the top of the page, line breaks (hitting enter) are sometimes not respected, i.e. text on multiple lines gets put on one line. Headings are always respected. My solution is in some places just to use html returns i.e. <br>
- References that are not completely filled out may not format properly.
- There is some issue with checking commas followed by periods in some situations (details of the IEEE format).
- The bibliography uses an tmp file placed in the $IP/extensions/bibliography directory. Shouldn't need a tmp file.
- Not all of the optional bibtex fields are made use of as they should, because...
- I haven't implemented a super-duper complete IEEE-style reference formatting. It's just barely good enough, and the formatting code needs work. As long as everything is filled out, they should look ok. I expect true IEEE-formatting to require more extensive logic than I've done.
- Citation keys are not checked for duplicates.
- The Bibliography page has a tendency to become one giant, long page and is not managed in any way, not even alphabetically. A tool here would be useful. It may be better to split citation keys into their own pages.
- There is a tendency to delete the <bibexport / from the bottom of the Bibliography page when deleting bibtex entries.
- The use of the <bibimport /> and <bibexport / and <bib id='citationkey' /> is a little kludgy. It would be nicer if they were automated some how.
- It would be nice if the formatting style (ACM, IEEE) were a selectable option.
