In [5]:
%%writefile ref.bib

@Article{PER-GRA_2007,
  Author         = {Perez, Fernando and Granger, Brian E.},
  Title          = {{IP}ython: a {S}ystem for {I}nteractive {S}cientific
                 {C}omputing},
  Journal        = {{C}omput. {S}ci. {E}ng.},
  Volume         = {9},
  Number         = {3},
  Pages          = {21-29},
  month          = may,
  year           = 2007,
  url            = "http://ipython.org",
}


Overwriting ref.bib

In [ ]:


In [7]:
%%writefile section2.tex

%This is the section that contains the image.

\subsection{Part2}

This is the second section of your new \LaTeX document.

We also plot the graphs of $\frac{sin(5x)}{10}+0.5$ and $sin(x^2)$ for no reason.

\begin{figure}[H]
\centering
\includegraphics[width = \textwidth]{figure.png}
\caption{\emph{Here is your figure, all neat in \LaTeX.}}
\end{figure}


Overwriting section2.tex

In [9]:
%%writefile abstract.tex

\begin{abstract}
This is the poor man's solution  to integrating all of your shit into one dynamic document.
\end{abstract}


Overwriting abstract.tex

In [15]:
%%writefile test2.tex

\documentclass[a4paper,11pt]{article} %This is the standard Latex article template
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{graphicx}    % This is for the image, not sure if it is required, but its there none the less
\usepackage{float}       % This is for placing the image at a specific location
\usepackage[left=1.2cm,right=1.2cm,top=0cm,bottom=0cm]{geometry}

\title{\LaTeX from Ipython notebooks}
\author{PA Marais}

\begin{document}

\maketitle

\input{abstract}
%\input{section1}
\input{section2}

\nocite{PER-GRA_2007}
\bibliographystyle{unsrt}
\bibliography{ref}

\end{document}


Overwriting test2.tex

In [16]:
%%bash

#use pandoc to convert section one to tex code from markdown
#pandoc -f markdown -t latex section1.txt -o section1.tex 

#run the standard bibtex and pdflatex commands to generate your final pdf

bibtex test2
pdflatex test2.tex
xdg-open test2.pdf


This is BibTeX, Version 0.99d (TeX Live 2016/dev)
The top-level auxiliary file: test2.aux
I found no \citation commands---while reading file test2.aux
I found no \bibdata command---while reading file test2.aux
I found no \bibstyle command---while reading file test2.aux
(There were 3 error messages)
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2016/dev) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2015/01/01> patch level 2
Babel <3.9m> and hyphenation patterns for 2 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)))
(/usr/share/texlive/texmf-dist/tex/latex/lm/lmodern.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/share/texlive/texmf-dist/tex/latex/float/float.sty)
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (./test2.aux)
(/usr/share/texlive/texmf-dist/tex/latex/lm/t1lmr.fd)
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(/usr/share/texlive/texmf-dist/tex/latex/lm/ot1lmr.fd)
(/usr/share/texlive/texmf-dist/tex/latex/lm/omllmm.fd)
(/usr/share/texlive/texmf-dist/tex/latex/lm/omslmsy.fd)
(/usr/share/texlive/texmf-dist/tex/latex/lm/omxlmex.fd) (./abstract.tex)
(./section2.tex

LaTeX Warning: File `figure.png' not found on input line 12.


! Package pdftex.def Error: File `figure.png' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.12 ...degraphics[width = \textwidth]{figure.png}
                                                  
? No pages of output.
Transcript written on test2.log.