Fix latex sphinx's configuration (for pdf output)

Now pdf generation should work on RTD too.  You can reproduce their pdf build with:
```
cd doc/source/
sphinx-build -b latex -d _build/doctrees . _build/latex
cd _build/latex/
pdflatex -interaction=nonstopmode main.tex 
```

Unfortunately, to fix undefined references we should rerun pdflatex second time.  Not sure if RTD does this, but it seems - it doesn't, and that's a bug.