I've been using Sphinx for sometime to document the source code and I decided to generate a PDF this time rather the HTML and I faced a lot of missing dependencies, the article will show how to handle that on Ubuntu 16.04/20.04.
First, to generate a pdf in sphinx use
The following steps for Ubuntu 18.04
sudo apt install latexmk
Adding some recommeded packages and fonts
sudo apt-get install texlive-latex-recommended texlive-fonts-recommended texlive texlive-science texlive-formats-extra