Notes with sphinx

Notes from conferences, minutes from a teleconf, ideas, etc.

Set up docs directory and (see other post).

Add math support, to array ‘extension’ in, e.g. ‘sphinx.ext.pngmath’. Looks like

extensions = [

Edit index.rst.




.. toctree::
:maxdepth: 4

Mljet 2015


.. toctree::
:maxdepth: 4

Lausanne 2015

One rst file for each meeting. E.g. euclid-lausanne-2015.rst:



Jarle Brinchmann, legacy


Large number of WG (Milky Way, AGN, local Universe, extra-solar planets,
strong lensing, theory, cosmological simulations, SN + transients, galaxy
clusters, primeval universe)


.. bibliography:: astro.bib
:style: mystyle
:encoding: utf

astro.bib is bibtex file
:cited: only display cited references (other option :all:)
:style: see
encoding: utf, do not interpolate any latex special characters. Necessary if ‘%’ in url links, but
annoying for math mode in titles, LaTeX accents in names etc.

Need to add missing abbreviations to bibtex file, e.g.:

@string{apjs = “APJS”}

Further problems:
– missing title
– missing booktitle
– missing journal
pages = {3-}, needs to be {3-+} [error message does not show line in bibtex file!]

make html or make latexpdf
can take a long time for long (several hundred) bib entries.

# pybtex code following:
# and

from import Style
# Other styles: alpha, plain, unsrtalpha
from import (
join, field, optional, sentence, href )
from pybtex.plugin import register_plugin

class MyStyle(Style):

def format_web_refs(self, e):
# based on urlbst output.web.refs
# Adds adsurl with link
return sentence(capfirst=False) [
optional [ self.format_url(e) ],
optional [ self.format_adsurl(e) ],
optional [ self.format_eprint(e) ],
optional [ self.format_pubmed(e) ],
optional [ self.format_doi(e) ],

def format_url(self, e):
# based on urlbst format.url
return href [

def format_adsurl(self, e):
# based on urlbst format.url
return href [
‘ads link’

register_plugin(‘’, ‘mystyle’, MyStyle)



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s