Skip to content
Finn Årup Nielsen edited this page Jan 11, 2018 · 34 revisions

Tex bibliography

cat > hellocitation.tex <<EOF
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{Hello, Citation}
\author{Finn Årup Nielsen}
\begin{document}
\maketitle
Hello, Citation \cite{Q21133507},
and \cite{10.1186/S13321-016-0161-3}.
\bibliographystyle{unsrt}
\bibliography{hellocitation}
\end{document}
EOF

pdflatex hellocitation.tex
python -m scholia.tex write-bib-from-aux hellocitation.aux
bibtex hellocitation
pdflatex hellocitation.tex
pdflatex hellocitation.tex

Scholia link

You can get a Scholia link on the left panel in Wikidata if you have an account there. A Javascript file, say User:Fnielsen/scholia-link.js, may be setup:

( function( mw, $ ) {
	// Partially from https://www.wikidata.org/wiki/User:Ls1g/recoin-core.js
    'use strict';
    
	console.log('scholia-link loaded');

	// Magnus Manske's check for item
	// https://www.wikidata.org/wiki/User:Magnus_Manske/missing_props.js
    if ( mw.config.get('wgNamespaceNumber') != 0 ) return ;
	if ( mw.config.get('wgAction') != 'view' ) return ;
	var entityID = mw.config.get( 'wbEntityId' );
	
	function init() 
	{
        $('#p-tb').find('ul').append('<li><a href="https://tools.wmflabs.org/scholia/' + entityID + '">Scholia</a></li>')
	}	
		
		
	$( function () {
		mw.hook( 'wikipage.content' ).add( init );
	});

	} ( mediaWiki, jQuery ) );

The Javascript file can be included by adding a line in your commons.js file, e.g., User:Fnielsen/common.js:

// importScript( 'User:Fnielsen/scholia-link.js' );  // Said to be an old format
mw.loader.load('//www.wikidata.org/w/index.php?title=User:Fnielsen/scholia-link.js&action=raw&ctype=text/javascript');

Updates for wmflabs

Login to login.tools.wmflabs.org

become scholia
source ~/www/python/venv/bin/activate
cd ~/www/python/scholia ; git pull
pip install -rrequirements.txt
webservice2 uwsgi-python restart  # Wait and pray
tail -f ~/uwsgi.log  # look at web log
Clone this wiki locally