Skip to content

Instantly share code, notes, and snippets.

@lmasikl
Created July 27, 2018 06:08
Show Gist options
  • Save lmasikl/7f190cb98570d39811c3c357f50f1295 to your computer and use it in GitHub Desktop.
Save lmasikl/7f190cb98570d39811c3c357f50f1295 to your computer and use it in GitHub Desktop.
import pathlib
c = get_config()
c.NbConvertApp.export_format = 'PDF'
c.TemplateExporter.template_path = ['.', str(pathlib.Path.cwd())]
c.Exporter.template_file = 'cyrillic'
((* set cell_style = 'style_python.tplx' *))
((* extends cell_style *))
((* block docclass *))
\documentclass{article}
((* endblock docclass *))
((* block packages *))
\usepackage{mathpazo}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
\else\Gin@nat@width\fi}
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=.8\maxwidth]{#1}}
\usepackage{caption}
\DeclareCaptionLabelFormat{nolabel}{}
\captionsetup{labelformat=nolabel}
\usepackage{adjustbox}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{geometry}
\usepackage{textcomp}
\AtBeginDocument{%
\def\PYZsq{\textquotesingle}
}
\usepackage{upquote}
\usepackage{eurosym}
\usepackage{mathtext}
\usepackage[mathletters]{ucs}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{amsmath,amsfonts}
\usepackage{amssymb}
\usepackage{fancyvrb}
\usepackage{grffile}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[inline]{enumitem}
\usepackage[normalem]{ulem}
((* endblock packages *))
default: run
run:
@pipenv run jupyter notebook --ip=0.0.0.0 --config=./jupyter_notebook_config.json
clean:
@find . -name 'doc.*' -not -name doc.ipynb -delete
convert:
@make clean
@pipenv run jupyter nbconvert --config config.py --to latex doc.ipynb
@pdflatex doc.tex
# @evince doc.pdf
.PHONY: default run convert clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment