Lately I have been setting up a local MediaWiki installation to organize and document my research (see previous posts which relate to installing MediaWiki on Windows). An essential feature is of course documentation, and nise presents a nice solution by combining two extensions, Biblio and Bibtex.
This solution allows you to use the BibTex citations from a manager such as Mendeley or JabRef in both the MediaWiki citations and LaTex citations.
I integrated the two similarly to how nise has, but with a modification on matching Bibtex entries, using a regular expression instead of a string match.
- Install Biblio and Bibtex extensions
- Open Biblio.php and location the function render_biblio
Define the following within the function (just under the two global's works)
$bibtexx = new BibTex();
Find "$text = $this->get($ref,
'text');" further down in the function and add the following just below it.
if(preg_match("/@[a-zA-Z]+/",
$text, $matches)){
$bibtexx->BibTex($text);
$text = $bibtexx->html();
}
The example by
nise will now work as intended
#localref local reference
#[[Literature]]
#somebook @book{Alexander1979,
Author = {Christopher Alexander},
Publisher = {Oxford University Press},
Title = {The Timeless Way of Building},
Year = {1979}}
#someusualbook MySelf. "Me Myself and I". Self.
#x ...
The difference with what was originally done is the Regular Expression match. Since a BibTex entry starts with @type, we test for @[someword].