((*- extends 'article.tplx' -*))

((* block h1 -*))\section((* endblock h1 -*))
((* block h2 -*))\subsection((* endblock h2 -*))
((* block h3 -*))\subsubsection((* endblock h3 -*))
((* block h4 -*))\paragraph((* endblock h4 -*))
((* block h5 -*))\subparagraph((* endblock h5 -*))


((* block abstract *))
\tableofcontents
((* endblock abstract *))

%or?
%((* block toc *))\tableofcontents((* endblock toc *))


%===============================================================================
% My custom output style
%===============================================================================
% A custom cell style that places code in a simple verbatim and prints "Input #"
% and "Output #" cell prompts.

((*- block in_prompt -*))
((*- endblock in_prompt -*))

((*- block input -*))
%
\begin{lstlisting}
((( cell.source )))
\end{lstlisting}
((*- endblock input -*))

% ok

%but may be this?

%((*- block output_prompt -*))
%((*- endblock output_prompt -*))


((* block author *))
\author{J.-F. Bercher}
((* endblock author *))

((* block title *))
\title{ }
((* endblock title *))

((* block packages *))
((( super() )))
    \usepackage{listings} % Used to define pretty listings for code sections [jfb]
    \usepackage{float}   
((* endblock packages *))

%or -- both work
((* block header *))
((( super() )))
%\usepackage{foo}
((* endblock *))


((* block commands *))
    % Prevent overflowing lines due to hard-to-break entities
    \sloppy
    % Setup hyperref package
    \hypersetup{
    breaklinks=true, % so long urls are correctly broken across lines
	pdftitle={\@title},
	pdfauthor={\@author},
	colorlinks=true, % color links 
	breaklinks=true, % enable to break long links
	urlcolor= blue,  % color for external links
	linkcolor= blue, % color for external links
	citecolor=blue,  
	bookmarksopen=false,
	pdftoolbar=false,
	pdfmenubar=false,
%      hidelinks
      }
    % Slightly bigger margins than the latex defaults
    \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
    %listings configuration

\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
	\lstset{
language=Python,
commentstyle=\color{mygreen},
keywordstyle=\color{blue},
stringstyle=\color{mymauve},
xleftmargin= 1cm,
xrightmargin= 1cm,
showstringspaces=false,
	   breaklines=true,
	   texcl=false,
%	   basicstyle=\ttfamily,
frame=single,
frameround=tttt,
framesep=10pt,
%framexleftmargin=10pt,
%framexrightmargin =10pt,
%frameshape={RYRYNYYYY}{yny}{yny}{RYRYNYYYY} 
        inputencoding=utf8,
        extendedchars=true,
        literate=%
        {é}{{\'{e}}}1
        {è}{{\`{e}}}1
        {ê}{{\^{e}}}1
        {ë}{{\¨{e}}}1
        {É}{{\'{E}}}1
        {Ê}{{\^{E}}}1
        {û}{{\^{u}}}1
        {ù}{{\`{u}}}1
        {à}{{\`{a}}}1
        {ç}{{\c{c}}}1
        {Ç}{{\c{C}}}1
        {î}{{\^{i}}}1
        {Î}{{\^{I}}}1
}
((* endblock commands *))

((* block predoc *))
    ((*- if nb['metadata']['latex_envs']['latex_user_defs'] == True -*))
        ((= if user's latex_defs.tex were used in notebook, also loads them =))
\input{latexdefs.tex} 
   ((*- endif -*))
((( super() )))
((* endblock predoc *))

% Display latex

((* block data_latex -*))
    ((*- if output.latex.startswith('$'): -*)) 
        ((= Replace $ symbols with more explicit, equation block. =))
        \begin{equation}
        ((( output.latex | strip_dollars )))
        \end{equation}
    ((*- else -*))
        ((( output.latex )))
    ((*- endif -*))
((* endblock data_latex *))



((* block bibliography *))
%\bibliographystyle{ieetran}
%\bibliography{Thesis}
((* endblock bibliography *))

((*- block data_png -*))
     ((( draw_figure_with_caption(output,'image/png',cell) )))
((*- endblock -*))
((*- block data_jpg -*))
     ((( draw_figure_with_caption(output,'image/jpeg',cell) )))
((*- endblock -*))
((*- block data_svg -*))
     ((( draw_figure_with_caption(output,'image/svg+xml',cell) )))
((*- endblock -*))
((*- block data_pdf -*))
     ((( draw_figure_with_caption(output,'application/pdf',cell) )))
((*- endblock -*))

% Draw a figure using the graphicx package.
((*- macro draw_figure_with_caption(output,mimetype,cell) -*))
((*- set filename = output.metadata.filenames[ mimetype ] | posix_path -*))
((*- if cell.metadata.widefigure: -*))
    ((*- set wscale = 0.9 -*))
    ((*- set hscale = 0.4 -*))
((*- else -*))
    ((*- set wscale = 0.7 -*))
    ((*- set hscale = 0.3 -*))
((*- endif -*))
((*- block figure scoped *))
\begin{figure}
    \begin{center}
        \adjustimage{max size={((( wscale )))\linewidth}{((( hscale )))\paperheight}}{((( filename )))}
    \end{center}
((*- if output.metadata.caption: *))
    \caption{((( output.metadata.caption )))}
((*- endif *))
((*- if output.metadata.label: *))      
    \label{((( output.metadata.label )))}
((*- endif *))
\end{figure}
((*- endblock figure -*))
((*- endmacro *))




%============================================================
((= This line selects the cell style. =))
%((* set cell_style = 'style_bw_python.tplx' *))
((* set cell_style = 'style_python.tplx' *))




