Browse Source
now under version control
hg/35a367e65a464cf6cdf277c73f977a6828b723fe/bookmarks/master
now under version control
hg/35a367e65a464cf6cdf277c73f977a6828b723fe/bookmarks/master

2 changed files with 224 additions and 0 deletions
@ -0,0 +1,115 @@ |
|||||
|
<?php /** default bibliography btyle of bibtexbrowser |
||||
|
|
||||
|
see [[http://www.monperrus.net/martin/bibtexbrowser/]] |
||||
|
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
this function transforms a $bibentry into an HTML string |
||||
|
* it is called by function bib2html if the user did not choose a specific style |
||||
|
* the default usable CSS styles are |
||||
|
* .bibtitle { font-weight:bold; } |
||||
|
* .bibbooktitle { font-style:italic; } |
||||
|
* .bibauthor { } |
||||
|
* .bibpublisher { } |
||||
|
*/ |
||||
|
function DefaultBibliographyStyle(&$bibentry) { |
||||
|
$title = $bibentry->getTitle(); |
||||
|
$type = $bibentry->getType(); |
||||
|
|
||||
|
// later on, all values of $entry will be joined by a comma
|
||||
|
$entry=array(); |
||||
|
|
||||
|
// title
|
||||
|
// usually in bold: .bibtitle { font-weight:bold; }
|
||||
|
$title = '<span class="bibtitle">'.$title.'</span>'; |
||||
|
if ($bibentry->hasField('url')) $title = ' <a href="'.$bibentry->getField("url").'">'.$title.'</a>'; |
||||
|
|
||||
|
|
||||
|
// author
|
||||
|
if ($bibentry->hasField('author')) { |
||||
|
$coreInfo = $title . ' <span class="bibauthor">('.$bibentry->formattedAuthors().')</span>';} |
||||
|
else $coreInfo = $title; |
||||
|
|
||||
|
// core info usually contains title + author
|
||||
|
$entry[] = $coreInfo; |
||||
|
|
||||
|
// now the book title
|
||||
|
$booktitle = ''; |
||||
|
if ($type=="inproceedings") { |
||||
|
$booktitle = 'In '.$bibentry->getField(BOOKTITLE); } |
||||
|
if ($type=="incollection") { |
||||
|
$booktitle = 'Chapter in '.$bibentry->getField(BOOKTITLE);} |
||||
|
if ($type=="inbook") { |
||||
|
$booktitle = 'Chapter in '.$bibentry->getField('chapter');} |
||||
|
if ($type=="article") { |
||||
|
$booktitle = 'In '.$bibentry->getField("journal");} |
||||
|
if (($type=="misc") && $bibentry->hasField("note")) { |
||||
|
$booktitle = $bibentry->getField("note");} |
||||
|
|
||||
|
//// we may add the editor names to the booktitle
|
||||
|
$editor=''; |
||||
|
if ($bibentry->hasField(EDITOR)) { |
||||
|
$editors = array(); |
||||
|
foreach ($bibentry->getEditors() as $ed) { |
||||
|
$editors[]=formatAuthor($ed); |
||||
|
} |
||||
|
$editor = implode(', ',$editors).', '.(count($editors)>1?'eds.':'ed.'); |
||||
|
} |
||||
|
if ($editor!='') $booktitle .=' ('.$editor.')'; |
||||
|
// end editor section
|
||||
|
|
||||
|
// is the booktitle available
|
||||
|
if ($booktitle!='') { |
||||
|
$entry[] = '<span class="bibbooktitle">'.$booktitle.'</span>'; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$publisher=''; |
||||
|
if ($type=="phdthesis") { |
||||
|
$publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); |
||||
|
} |
||||
|
if ($type=="mastersthesis") { |
||||
|
$publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); |
||||
|
} |
||||
|
if ($type=="bachelorsthesis") { |
||||
|
$publisher = 'Bachelor\'s thesis, '.$bibentry->getField(SCHOOL); |
||||
|
} |
||||
|
if ($type=="techreport") { |
||||
|
$publisher = 'Technical report, '.$bibentry->getField("institution"); |
||||
|
} |
||||
|
|
||||
|
if ($type=="misc") { |
||||
|
$publisher = $bibentry->getField('howpublished'); |
||||
|
} |
||||
|
|
||||
|
if ($bibentry->hasField("publisher")) { |
||||
|
$publisher = $bibentry->getField("publisher"); |
||||
|
} |
||||
|
|
||||
|
if ($publisher!='') $entry[] = '<span class="bibpublisher">'.$publisher.'</span>'; |
||||
|
|
||||
|
|
||||
|
if ($bibentry->hasField('volume')) $entry[] = "volume ".$bibentry->getField("volume"); |
||||
|
|
||||
|
|
||||
|
if ($bibentry->hasField(YEAR)) $entry[] = $bibentry->getYear(); |
||||
|
|
||||
|
$result = implode(", ",$entry).'.'; |
||||
|
|
||||
|
// some comments (e.g. acceptance rate)?
|
||||
|
if ($bibentry->hasField('comment')) { |
||||
|
$result .= " (".$bibentry->getField("comment").")"; |
||||
|
} |
||||
|
if ($bibentry->hasField('note')) { |
||||
|
$result .= " (".$bibentry->getField("note").")"; |
||||
|
} |
||||
|
|
||||
|
// add the Coin URL
|
||||
|
$result .= "\n".$bibentry->toCoins(); |
||||
|
|
||||
|
return $result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
?>
|
@ -0,0 +1,109 @@ |
|||||
|
<?php /** Bibtexbrowser style contributed by János Tapolcai |
||||
|
see: [[http://www.monperrus.net/martin/bibtexbrowser]] |
||||
|
|
||||
|
It looks like the IEEE transaction style. |
||||
|
|
||||
|
Add the following line in "bibtexbrowser.local.php" |
||||
|
<code> |
||||
|
include( 'bibtexbrowser-style-janos.php' ); |
||||
|
define('BIBLIOGRAPHYSTYLE','JanosBibliographyStyle'); |
||||
|
</code> |
||||
|
|
||||
|
[[http://www.monperrus.net/martin/bibtexbrowser-style-janos.php.txt]] |
||||
|
|
||||
|
*/ |
||||
|
function JanosBibliographyStyle(&$bibentry) { |
||||
|
$title = $bibentry->getTitle(); |
||||
|
$type = $bibentry->getType(); |
||||
|
|
||||
|
$entry=array(); |
||||
|
|
||||
|
// author
|
||||
|
if ($bibentry->hasField('author')) { |
||||
|
$entry[] = $bibentry->formattedAuthors(); |
||||
|
} |
||||
|
|
||||
|
// title
|
||||
|
$title = '"'.$title.'"'; |
||||
|
if ($bibentry->hasField('url')) $title = ' <a href="'.$bibentry->getField("url").'">'.$title.'</a>'; |
||||
|
$entry[] = $title; |
||||
|
|
||||
|
|
||||
|
// now the origin of the publication is in italic
|
||||
|
$booktitle = ''; |
||||
|
|
||||
|
if (($type=="misc") && $bibentry->hasField("note")) { |
||||
|
$booktitle = $bibentry->getField("note"); |
||||
|
} |
||||
|
|
||||
|
if ($type=="inproceedings") { |
||||
|
$booktitle = 'In '.$bibentry->getField(BOOKTITLE); |
||||
|
} |
||||
|
|
||||
|
if ($type=="incollection") { |
||||
|
$booktitle = 'Chapter in '.$bibentry->getField(BOOKTITLE); |
||||
|
} |
||||
|
|
||||
|
if ($type=="article") { |
||||
|
$booktitle = 'In '.$bibentry->getField("journal"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//// ******* EDITOR
|
||||
|
$editor=''; |
||||
|
if ($bibentry->hasField(EDITOR)) { |
||||
|
$editors = array(); |
||||
|
foreach ($bibentry->getEditors() as $ed) { |
||||
|
$editors[]=formatAuthor($ed); |
||||
|
} |
||||
|
$editor = implode(', ',$editors).', '.(count($editors)>1?'eds.':'ed.'); |
||||
|
} |
||||
|
|
||||
|
if ($booktitle!='') { |
||||
|
if ($editor!='') $booktitle .=' ('.$editor.')'; |
||||
|
$entry[] = '<i>'.$booktitle.'</i>'; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$publisher=''; |
||||
|
if ($type=="phdthesis") { |
||||
|
$publisher = 'PhD thesis, '.$bibentry->getField(SCHOOL); |
||||
|
} |
||||
|
|
||||
|
if ($type=="mastersthesis") { |
||||
|
$publisher = 'Master\'s thesis, '.$bibentry->getField(SCHOOL); |
||||
|
} |
||||
|
if ($type=="techreport") { |
||||
|
$publisher = 'Technical report, '.$bibentry->getField("institution"); |
||||
|
} |
||||
|
if ($bibentry->hasField("publisher")) { |
||||
|
$publisher = $bibentry->getField("publisher"); |
||||
|
} |
||||
|
|
||||
|
if ($publisher!='') $entry[] = $publisher; |
||||
|
|
||||
|
if ($bibentry->hasField('volume')) $entry[] = "vol. ".$bibentry->getField("volume"); |
||||
|
if ($bibentry->hasField('number')) $entry[] = 'no. '.$bibentry->getField("number"); |
||||
|
|
||||
|
if ($bibentry->hasField('address')) $entry[] = $bibentry->getField("address"); |
||||
|
|
||||
|
if ($bibentry->hasField('pages')) $entry[] = str_replace("--", "-", "pp. ".$bibentry->getField("pages")); |
||||
|
|
||||
|
|
||||
|
if ($bibentry->hasField(YEAR)) $entry[] = $bibentry->getYear(); |
||||
|
|
||||
|
$result = implode(", ",$entry).'.'; |
||||
|
|
||||
|
// some comments (e.g. acceptance rate)?
|
||||
|
if ($bibentry->hasField('comment')) { |
||||
|
$result .= " (".$bibentry->getField("comment").")"; |
||||
|
} |
||||
|
|
||||
|
// add the Coin URL
|
||||
|
$result .= "\n".$bibentry->toCoins(); |
||||
|
|
||||
|
return $result; |
||||
|
} |
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue