Skip to content

Instantly share code, notes, and snippets.

@drjonnicholson
Last active April 23, 2016 16:22
Show Gist options
  • Save drjonnicholson/379b3ef274c8ba72e1a1 to your computer and use it in GitHub Desktop.
Save drjonnicholson/379b3ef274c8ba72e1a1 to your computer and use it in GitHub Desktop.
Templates, formats, and CSS I use with the Papercite plugin for Wordpress on my homepage (correct as of 2014-09-22).

Papercite Tweaks

This gist contains the templates, formats, and CSS I use with the Papercite plugin for Wordpress on my homepage (correct as of 2014-09-22). It lets users see formatted bibtex entries (using WP-Syntax plugin), abstracts and notes. Clicks on DOIs and PDFs are tracked using Google Analytics events.

Feedback welcome.

Files

  • mybibshow.tpl Goes into /papercite-data/tpl. Edit the URL at the end of the file to link to your main list of publications.
  • mybibtex.tpl Goes into /papercite-data/tpl.
  • myieee.tpl Goes into /papercite-data/formats. Put "myieee" in settings
  • style.css Can be included onto your site almost however you like, although I recommend not editing the style.css file in the plugin directory --- It will be lost when the plugin updates. I use Jetpack's custom CSS editor.
<h3>Selected Publications</h3>
@{group@
<div class="papercite">
@?groupkey@
<div class="papercite_heading">@groupkey@</div>
@;groupkey@
<ul class="papercite_bibliography papercite_bibcite @?groupkey@papercite_grouped@;groupkey@">
@{entry@
<li id="paperkey_@papercite_id@" class="papercite_entry">[@key@]
@?pdf@
<a href="@pdf@" title="Download PDF" class="papercite_link papercite_pdf" onclick="ga('send', 'event', 'publication', 'PDF', '@entrykey@');">
<img src="@WP_PLUGIN_URL@/papercite/img/pdf.png" alt="[PDF]"/>
</a>
@;pdf@
@?doi@
<a href="http://dx.doi.org/@doi@" title="Go to document" class="papercite_link papercite_doi" onclick="ga('send', 'event', 'publication', 'DOI', '@entrykey@');">
<img src="@WP_PLUGIN_URL@/papercite/img/external.png" width="10" height="10" alt="[DOI]" />
</a>
@;doi@
@#entry@<br/>
<div class="papercite_controls">
@?note@
<a href="javascript:void(0);" id="papercite_note_@papercite_id@" class="papercite_link papercite_toggle" title="Click to view notes">[Notes]</a>
@;note@
@?abstract@
<a href="javascript:void(0);" id="papercite_abstract_@papercite_id@" class="papercite_link papercite_toggle" title="Click to view abstract">[Abstract]</a>
@;abstract@
<a href="javascript:void(0);" id="papercite_@papercite_id@" class="papercite_link papercite_toggle" title="Click to view Bibtex">[BibTex]</a>
@?url@
<a href="@url@" class="papercite_link" title="External link for @title@ (@year@)">[Link]</a>
@;url@
</div>
@?note@
<aside id="papercite_note_@papercite_id@_block" class="papercite_note">
<header>Notes</header>
<notes>@note@</p>
</aside>
@;note@
@?abstract@
<aside id="papercite_abstract_@papercite_id@_block" class="papercite_abstract">
<header>Abstract</header>
<blockquote>@abstract@</blockquote>
</aside>
@;abstract@
<aside class="papercite_bibtex" id="papercite_@papercite_id@_block">
<header>BibTex</header>
<pre lang="BibTeX">@bibtex@</pre>
</aside>
</li>
@}entry@
</ul>
</div>
@}group@
See <a href="URL">all my publications</a>.
@{group@
<div class="papercite">
@?groupkey@
<div class="papercite_heading">@groupkey@</div>
@;groupkey@
<ul class="papercite_bibliography @?groupkey@papercite_grouped@;groupkey@">
@{entry@
<li>
@?pdf@
<a href="@pdf@" title="Download PDF" class="papercite_link papercite_pdf" onclick="ga('send', 'event', 'publication', 'PDF', '@entrykey@');">
<img src="@WP_PLUGIN_URL@/papercite/img/pdf.png" alt="[PDF]"/>
</a>
@;pdf@
@?doi@
<a href="http://dx.doi.org/@doi@" title="Go to document" class="papercite_link papercite_doi" onclick="ga('send', 'event', 'publication', 'DOI', '@entrykey@');">
<img src="@WP_PLUGIN_URL@/papercite/img/external.png" width="10" height="10" alt="[DOI]" />
</a>
@;doi@
@#entry@
<div class="papercite_controls">
@?note@
<a href="javascript:void(0)" id="papercite_note_@papercite_id@" class="papercite_link papercite_toggle" title="Click to view notes">[Notes]</a>
@;note@
@?abstract@
<a href="javascript:void(0)" id="papercite_abstract_@papercite_id@" class="papercite_link papercite_toggle" title="Click to view abstract">[Abstract]</a>
@;abstract@
<a href="javascript:void(0)" id="papercite_@papercite_id@" class="papercite_link papercite_toggle" title="Click to view Bibtex">[BibTex]</a>
@?url@
<a href="@url@" class="papercite_link" title="External link for @title@ (@year@)">[Link]</a>
@;url@
</div>
@?note@
<aside id="papercite_note_@papercite_id@_block" class="papercite_note">
<header>Notes</header>
<notes>@note@</p>
</aside>
@;note@
@?abstract@
<aside id="papercite_abstract_@papercite_id@_block" class="papercite_abstract">
<header>Abstract</header>
<blockquote>@abstract@</blockquote>
</aside>
@;abstract@
<aside class="papercite_bibtex" id="papercite_@papercite_id@_block">
<header>BibTex</header>
<pre lang="BibTeX">@bibtex@</pre>
</aside>
</li>
@}entry@
</ul>
</div>
@}group@
<formats>
<property name="titleCapitalization" value="0"/>
<property name="primaryCreatorFirstStyle" value="0"/>
<property name="primaryCreatorOtherStyle" value="0"/>
<property name="primaryCreatorInitials" value="0"/>
<property name="primaryCreatorFirstName" value="1"/>
<property name="otherCreatorFirstStyle" value="1"/>
<property name="otherCreatorOtherStyle" value="1"/>
<property name="otherCreatorInitials" value="0"/>
<property name="dayFormat" value="0"/>
<property name="otherCreatorFirstName" value="1"/>
<property name="primaryCreatorList" value="0"/>
<property name="otherCreatorList" value="0"/>
<property name="monthFormat" value="2"/>
<property name="editionFormat" value="1"/>
<property name="primaryCreatorListMore" value=""/>
<property name="primaryCreatorListLimit" value=""/>
<property name="dateFormat" value="1"/>
<property name="primaryCreatorListAbbreviation" value=""/>
<property name="otherCreatorListMore" value=""/>
<property name="runningTimeFormat" value="0"/>
<property name="primaryCreatorRepeatString" value=""/>
<property name="primaryCreatorRepeat" value="0"/>
<property name="otherCreatorListLimit" value=""/>
<property name="otherCreatorListAbbreviation" value=""/>
<property name="pageFormat" value="2"/>
<property name="editorSwitch" value="0"/>
<property name="editorSwitchIfYes" value=""/>
<property name="primaryCreatorSepFirstBetween" value=", "/>
<property name="primaryCreatorSepNextBetween" value=", "/>
<property name="primaryCreatorSepNextLast" value=", and "/>
<property name="otherCreatorSepFirstBetween" value=", "/>
<property name="otherCreatorSepNextBetween" value=", "/>
<property name="otherCreatorSepNextLast" value=", and "/>
<property name="primaryTwoCreatorsSep" value=" and "/>
<property name="otherTwoCreatorsSep" value=" and "/>
<property name="userMonth_1" value="Jan."/>
<property name="userMonth_2" value="Feb."/>
<property name="userMonth_3" value="Mar."/>
<property name="userMonth_4" value="Apr."/>
<property name="userMonth_5" value="May"/>
<property name="userMonth_6" value="June"/>
<property name="userMonth_7" value="July"/>
<property name="userMonth_8" value="Aug."/>
<property name="userMonth_9" value="Sept."/>
<property name="userMonth_10" value="Oct."/>
<property name="userMonth_11" value="Nov."/>
<property name="userMonth_12" value="Dec."/>
<property name="dateRangeDelimit1" value="-"/>
<property name="dateRangeDelimit2" value="/"/>
<property name="dateRangeSameMonth" value="1"/>
<format types="proceedings unpublished misc">
@?author@@author@, @;@@?title@&lt;span style=&quot;font-style: italic&quot;&gt;@title@&lt;/span&gt;@;@@?address@@address@: @;@@?publisher@@publisher@@;@@?year@, @year@@;@.
</format>
<format types="book">
@?author@@author@, @;@@?title@&lt;span style=&quot;font-style: italic&quot;&gt;@title@&lt;/span&gt;@;@@?edition@, @edition@ ed.@;@@?editor@, @editor@, @?#editor&gt;1@Eds@:editor@Ed@;editor@.@;@@?address||publisher||year||volume@, @:@@;@@?address@@address@: @;@@?publisher@@publisher@@;@@?year@, @year@@;@@?volume@, vol. @volume@@;@@?address||publisher||year||volume@.@:@@;@
</format>
<format types="inbook incollection">
@?author@@author@, @;@@?title@&quot;@title@@;@@?bookitle||edition||editor@,&quot; @:@.&quot; @;@@?bookitle@in &lt;span style=&quot;font-style: italic&quot;&gt;@bookitle@&lt;/span&gt;@;@@?edition@, @edition@ ed.@;@@?editor@, @editor@, @?#editor&gt;1@Eds@:editor@Ed@;editor@.@;@@?bookitle||edition||editor@, @:@@;@@?address@@address@: @;@@?publisher@@publisher@@;@@?year@, @year@@;@@?volume@, vol. @volume@@;@@?pages@, pages @pages@@;@.
</format>
<format types="article">
@?author@@author@, @;@@?title@@title@. @;@@?journal@&lt;em&gt;@journal@&lt;/em&gt;, @;@@?volume@@volume@@;@@?number@(@number@)@;@@?pages@:@pages@@;@@?year@, @year@@;@.
</format>
<format types="conference">
@?author@@author@, @;@@?title@@title@. @;@@?booktitle@In &lt;em&gt;@booktitle@&lt;/em&gt;, @;@@?series@@series@, @;@@?volume@volume @volume@, @;@@?pages@pages @pages@. @;@@?address@@address@. @;@@?publisher@@publisher@, @;@@?date@@date@ @;@@?year@@year@@;@.
</format>
<format types="inproceedings">
@?author@@author@, @;@@?title@&quot;@title@@;@@?booktitle||address@,&quot; @:@.&quot; @;@@?booktitle@in &lt;span style=&quot;font-style: italic&quot;&gt;@booktitle@&lt;/span&gt;@;@@?address@, @address@@;@@?booktitle||address@, @:@@;@@?date@@date@@;@@?year@ @year@@;@@?pages@, pages @pages@@;@.
</format>
<format types="phdthesis mastersthesis">
@?author@@author@, @;@@?title@&quot;@title@,&quot; @;@@?type@@type@ @;@@?entrytype=phdthesis||entrytype=mastersthesis@@?entrytype=phdthesis@PhD Thesis@;@@?entrytype=mastersthesis@Masters Thesis@;@@;@@?school@, @school@@;@@?address@, @address@@;@@?year@, @year@@;@.
</format>
<format types="techreport">
@?author@@author@, @;@@?title@&quot;@title@,&quot; @;@@?institution@@institution@@;@@?address@, @address@@;@@?type||number@, @:@@;@@?type@@type@ @;@@?number@@number@@;@@?type||number@, @:@@;@@?date@@date@ @;@@?year@@year@@;@.
</format>
<format types="#">
@?author@@author@, @;@@?title@&quot;@title@@;@@?journal||volume||number||pages||year@,&quot; @:@.&quot; @;@@?journal@&lt;span style=&quot;font-style: italic&quot;&gt;@journal@&lt;/span&gt;@;@@?volume@, vol. @volume@@;@@?number@, iss. @number@@;@@?pages@, pages @pages@@;@@?year@, @year@@;@@?journal||volume||number||pages||year@.@:@@;@
</format>
</formats>
div.papercite_heading {
font-weight: bold;
font-size: 1.2em;
}
ul.papercite_bibliography {
list-style-type: none;
padding-left: 1em;
}
ul.papercite_bibliography li {
margin-bottom: 1em;
}
ul.papercite_bibliography li a img {
margin: 0;
margin-left: 2px;
margin-right: 2px;
padding: 0;
border: 0;
display: inline;
vertical-align: text-bottom;
background-color: transparent;
}
ul.papercite_bibliography li a.papercite_pdf img {
width: 16px;
height: 16px;
}
ul.papercite_bibliography li a.papercite_doi img {
width: 10px;
height: 10px;
/* Adjust the padding to make the height of the image (10x10) equal to the PDF image (16x16) */
padding-top: 3px;
padding-bottom: 3px;
}
.papercite_link, .papercite_link:link, .papercite_link:visited {
text-decoration: none;
font-size: .8em;
}
.papercite_note, .papercite_abstract, .papercite_bibtex {
display: none;
margin: .5em;
padding: .5em;
border-radius: .5em;
background-color: #F0F0F0;
overflow: hidden;
}
.papercite_note header, .papercite_abstract header, .papercite_bibtex header {
font-weight: bold;
}
.papercite_note p, .papercite_abstract blockquote {
font-size: .8em;
margin: 0 1em;
padding: 0 1em;
}
.papercite_abstract blockquote p {
margin-bottom: 0;
}
.papercite_bibtex .wp_syntax {
margin: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment