Skip to content

Instantly share code, notes, and snippets.

@camerondavison
Last active March 6, 2018 19:44
Show Gist options
  • Save camerondavison/6ec5e8627c57b64e82c0630e7497b1c7 to your computer and use it in GitHub Desktop.
Save camerondavison/6ec5e8627c57b64e82c0630e7497b1c7 to your computer and use it in GitHub Desktop.

Hide Code Template

cat > /tmp/hidecode.tplx <<EOM
((*- extends 'article.tplx' -*))

((* block input_group *))
    ((*- if cell.metadata.get('nbconvert', {}).get('show_code', False) -*))
        ((( super() )))
    ((*- endif -*))
((* endblock input_group *))
EOM

Install mac tex, this is the light version, maybe worth installing the larger one http://tug.org/mactex/morepackages.html

Because we installed the light version, install a bunch of plugins.

sudo tlmgr update --self
sudo tlmgr install mathpazo
sudo tlmgr install courier
sudo tlmgr install palatino
sudo tlmgr install adjustbox
sudo tlmgr install collectbox
sudo tlmgr install ucs
sudo tlmgr install enumitem

And pandoc

brew install pandoc

nb convert to pdf, and open it

jupyter nbconvert --to pdf --template /tmp/hidecode.tplx ~/Code/jupyter-notebooks/model\ review/type\ curve\ comparison/encana-montney\ review.ipynb
open "~/Code/jupyter-notebooks/model review/type curve comparison/encana-montney review.pdf" 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment