##// END OF EJS Templates
Added option to remove title and center output
Added option to remove title and center output

File last commit:

r9950:d44416c0
r9950:d44416c0
Show More
latex_sphinx_base.tplx
389 lines | 13.7 KiB | text/plain | TextLexer
/ templates / tex / latex_sphinx_base.tplx
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 ((= NBConvert Sphinx-Latex Template
Jonathan Frederic
Added document level description and cleaned template up....
r9735
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 Purpose: Allow export of PDF friendly Latex inspired by Sphinx. Most of the
template is derived directly from Sphinx source.
Jonathan Frederic
Added document level description and cleaned template up....
r9735
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 Inheritance: null>display_priority>latex_base
Jonathan Frederic
Added document level description and cleaned template up....
r9735
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 Note: For best display, use latex syntax highlighting. =))
Jonathan Frederic
Added document level description and cleaned template up....
r9735
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((*- extends 'display_priority.tplx' -*))
Jonathan Frederic
Added basic Sphinx template....
r9734
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
% Declarations
%==============================================================================
Jonathan Frederic
Added a nice comment to explain the line splitting.
r9919 % In order to make sure that the input/output header follows the code it
Jonathan Frederic
Updated comments...
r9929 % preceeds, the needspace package is used to request that a certain
% amount of lines (specified by this variable) are reserved. If those
% lines aren't available on the current page, the documenter will break
% to the next page and the header along with accomanying lines will be
% rendered together. This value specifies the number of lines that
% the header will be forced to group with without a page break.
((*- set min_header_lines = 4 -*))
Jonathan Frederic
Added a nice comment to explain the line splitting.
r9919
Jonathan Frederic
Re-arrange imports, added some comments, general cleaning.
r9920 % This is the number of characters that are permitted per line. It's
% important that this limit is set so characters do not run off the
% edges of latex pages (since latex does not always seem smart enough
Jonathan Frederic
Updated comments...
r9929 % to prevent this in some cases.) This is only applied to textual output
Jonathan Frederic
Added notebook output formatting style
r9940 ((* if resources.sphinx.outputstyle == 'simple' *))
((*- set wrap_size = 85 -*))
((* elif resources.sphinx.outputstyle == 'notebook' *))
((*- set wrap_size = 70 -*))
((* endif *))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
% Header
%==============================================================================
Jonathan Frederic
Added basic Sphinx template....
r9734 ((* block header *))
Jonathan Frederic
Added Sphinx transformer....
r9772
Jonathan Frederic
Moved latex comments in to Jinja blocks so they show in the...
r9751 % Header, overrides base
Jonathan Frederic
Added Sphinx transformer....
r9772
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 % Make sure that the sphinx doc style knows who it inherits from.
\def\sphinxdocclass{(((parentdocumentclass)))}
Matthias BUSSONNIER
Do now wrap before converting md to latex...
r9809
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 % Declare the document class
Jonathan Frederic
Moved sphinx template related resources into Sphinx namespace
r9937 \documentclass[letterpaper,10pt,english]{((( resources.sphinx.texinputs )))/sphinx(((documentclass)))}
Matthias BUSSONNIER
Do now wrap before converting md to latex...
r9809
% Imports
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 \usepackage[utf8]{inputenc}
Matthias BUSSONNIER
Do now wrap before converting md to latex...
r9809 \DeclareUnicodeCharacter{00A0}{\\nobreakspace}
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 \usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{times}
\usepackage{import}
Jonathan Frederic
Moved sphinx template related resources into Sphinx namespace
r9937 \usepackage[((( resources.sphinx.chapterstyle )))]{((( resources.sphinx.texinputs )))/fncychap}
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 \usepackage{longtable}
Jonathan Frederic
Moved sphinx template related resources into Sphinx namespace
r9937 \usepackage{((( resources.sphinx.texinputs )))/sphinx}
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 \usepackage{multirow}
Jonathan Frederic
Enforce strict Sphinx style on headers and doc. attrib....
r9774 \usepackage{amsmath}
\usepackage{amssymb}
\usepackage{ucs}
\usepackage{enumerate}
Jonathan Frederic
Changed rule attachment logic....
r9928 % Used to make the Input/Output rules follow around the contents.
\usepackage{needspace}
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 % Pygments requirements
\usepackage{fancyvrb}
\usepackage{color}
Jonathan Frederic
Added notebook style input highlighting.
r9939
% Needed to box output/input
\usepackage{mdframed}
\usepackage{alltt}
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781
Jonathan Frederic
Re-arrange imports, added some comments, general cleaning.
r9920 % Used to load and display graphics
\usepackage{graphicx}
\graphicspath{ {figs/} }
Jonathan Frederic
Fixed image sizing problem...
r9942 \usepackage[export]{adjustbox} % To resize
Jonathan Frederic
Re-arrange imports, added some comments, general cleaning.
r9920
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 % For formatting output while also word wrapping.
\usepackage{listings}
Matthias BUSSONNIER
Do now wrap before converting md to latex...
r9809 \lstset{breaklines=true}
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 \lstset{basicstyle=\small\ttfamily}
Jonathan Frederic
Re-arrange imports, added some comments, general cleaning.
r9920
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 %Pygments definitions
Jonathan Frederic
Moved sphinx template related resources into Sphinx namespace
r9937 ((( resources.sphinx.pygment_definitions )))
Jonathan Frederic
Added notebook style input highlighting.
r9939
%Set pygments styles if needed...
((* if resources.sphinx.outputstyle == 'notebook' *))
\definecolor{nbframe-border}{rgb}{0.8,0.8,0.8}
\definecolor{nbframe-bg}{rgb}{0.95,0.95,0.95}
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 \definecolor{nbframe-prompt}{rgb}{0.05,0.05,0.3}
Jonathan Frederic
Added notebook style input highlighting.
r9939
Jonathan Frederic
Added notebook output formatting style
r9940 \newenvironment{ColorVerbatim}
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 {\begin{mdframed}[backgroundcolor=nbframe-bg, userdefinedwidth=1\linewidth, leftmargin=0.08\linewidth, linecolor=nbframe-border, linewidth=1pt, usetwoside=false]}
Jonathan Frederic
Added notebook style input highlighting.
r9939 {\end{mdframed}}
\renewenvironment{Verbatim}[1][\unskip]
{\begin{alltt}}
{\end{alltt}}
((* endif *))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781
Jonathan Frederic
Re-arrange imports, added some comments, general cleaning.
r9920 % Help prevent overflowing lines due to urls and other hard-to-break
% entities. This doesn't catch everything...
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 \sloppy
Jonathan Frederic
Enforce strict Sphinx style on headers and doc. attrib....
r9774
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 % Document level variables
Jonathan Frederic
filterOutLatex replaced with built in 'escape_tex' filter...
r9916 \title{((( nb.metadata.name | escape_tex )))}
Jonathan Frederic
Sphinx specific metadata now stored in _draft namespace.
r9918 \date{((( nb.metadata._draft.date | escape_tex )))}
\release{((( nb.metadata._draft.version | escape_tex )))}
\author{((( nb.metadata._draft.author | escape_tex )))}
\renewcommand{\releasename}{((( nb.metadata._draft.release | escape_tex )))}
Jonathan Frederic
Re-arrange imports, added some comments, general cleaning.
r9920
% TODO: Add option for the user to specify a logo for his/her export.
\newcommand{\sphinxlogo}{}
% Make the index page of the document.
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 \makeindex
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921
% Import sphinx document type specifics.
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 ((* block sphinxheader *))((* endblock sphinxheader *))
Jonathan Frederic
Made significant improvements to the Sphinx-Latex export...
r9736 ((* endblock header *))
Jonathan Frederic
Added basic Sphinx template....
r9734
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
% Body
%==============================================================================
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* block body *))
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 ((* block bodyBegin *))
Jonathan Frederic
Moved latex comments in to Jinja blocks so they show in the...
r9751 % Body
Jonathan Frederic
Got pdflatex to work on this empty sphinx styled template.
r9740
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 % Start of the document
\begin{document}
Jonathan Frederic
Added option to remove title and center output
r9950
((* if resources.sphinx.header *))
\maketitle
((* endif *))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943
((* block toc *))
Jonathan Frederic
Added option to remove title and center output
r9950 \tableofcontents
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 ((* endblock toc *))
Jonathan Frederic
Added basic Sphinx template....
r9734
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* endblock bodyBegin *))((( super() )))((* block bodyEnd *))
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746
\renewcommand{\indexname}{Index}
\printindex
Jonathan Frederic
Moved latex comments in to Jinja blocks so they show in the...
r9751
% End of document
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 \end{document}
((* endblock bodyEnd *))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* endblock body *))
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746 % Footer
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
Jonathan Frederic
Made significant improvements to the Sphinx-Latex export...
r9736 ((* block footer *))
((* endblock footer *))
Jonathan Frederic
Got both of the main template formats from sphinx rendering....
r9746
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
% Headings
%
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 % Purpose: Format pynb headers as sphinx headers. Depending on the Sphinx
% style that is active, this will change. Thus sphinx styles will
% override the values here.
Jonathan Frederic
Added region headers, to help visually separate elements...
r9921 %==============================================================================
Jonathan Frederic
Moved latex comments in to Jinja blocks so they show in the...
r9751 ((* block headingcell -*))
Jonathan Frederic
Changed rule attachment logic....
r9928 \
Jonathan Frederic
Process header cells....
r9749 ((*- if cell.level == 1 -*))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* block h1 -*))part((* endblock h1 -*))
Jonathan Frederic
Process header cells....
r9749 ((*- elif cell.level == 2 -*))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* block h2 -*))chapter((* endblock h2 -*))
Jonathan Frederic
Process header cells....
r9749 ((*- elif cell.level == 3 -*))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* block h3 -*))section((* endblock h3 -*))
Jonathan Frederic
Process header cells....
r9749 ((*- elif cell.level == 4 -*))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* block h4 -*))subsection((* endblock h4 -*))
Jonathan Frederic
Process header cells....
r9749 ((*- elif cell.level == 5 -*))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* block h5 -*))subsubsection((* endblock h5 -*))
Jonathan Frederic
Process header cells....
r9749 ((*- elif cell.level == 6 -*))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* block h6 -*))paragraph((* endblock h6 -*))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922
((= It's important to make sure that underscores (which tend to be common
in IPYNB file titles) do not make their way into latex. Sometimes this
causes latex to barf. =))
Jonathan Frederic
Changed rule attachment logic....
r9928 ((*- endif -*)){((( escape_underscores(cell.source | markdown2latex ) )))}
Jonathan Frederic
Moved latex comments in to Jinja blocks so they show in the...
r9751 ((*- endblock headingcell *))
Jonathan Frederic
Process header cells....
r9749
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
% Markdown
%
% Purpose: Convert markdown to latex. Here markdown2latex is explicitly
% called since we know we want latex output.
%==============================================================================
Jonathan Frederic
Enabled markdown blocks.
r9757 ((*- block markdowncell scoped-*))
Matthias BUSSONNIER
Do now wrap before converting md to latex...
r9809 ((( cell.source | markdown2latex )))
Jonathan Frederic
Enabled markdown blocks.
r9757 ((*- endblock markdowncell -*))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
% Rawcell
%
% Purpose: Raw text cells allow the user to manually inject document code that
% will not get touched by the templating system.
%==============================================================================
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((*- block rawcell *))
Jonathan Frederic
Fixed missing latex_transformer (rebase issue)...
r9803 ((( cell.source | wrap(wrap_size) )))
Jonathan Frederic
Moved header definitions into individual sphinx doc types....
r9761 ((* endblock rawcell -*))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
% Unknowncell
%
% Purpose: This is the catch anything unhandled. To display this data, we
% remove all possible latex conflicts and wrap the characters so they
% can't flow off of the page.
%==============================================================================
((* block unknowncell scoped*))
% Unsupported cell type, no formatting
((( cell.source | wrap | escape_tex )))
((* endblock unknowncell *))
%==============================================================================
% Input
%==============================================================================
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* block input *))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943
% Make sure that atleast 4 lines are below the HR
\needspace{((( min_header_lines )))\baselineskip}
Jonathan Frederic
Added notebook style input highlighting.
r9939 ((* if resources.sphinx.outputstyle == 'simple' *))
% Add a horizantal break, along with break title.
\vspace{10pt}
{\scriptsize Input}\\*
\rule[10pt]{\linewidth}{0.5pt}
\vspace{-25pt}
% Add contents below.
((( cell.input | highlight )))
((* elif resources.sphinx.outputstyle == 'notebook' *))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 \vspace{5pt}
{\color{nbframe-prompt}\textbf{In {[}((( cell.prompt_number ))){]}:}}\\*
\vspace{-2.6\baselineskip}
Jonathan Frederic
Added notebook output formatting style
r9940 \begin{ColorVerbatim}
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 \vspace{-0.5\baselineskip}
Jonathan Frederic
Added notebook style input highlighting.
r9939 ((( cell.input | highlight )))
\end{ColorVerbatim}
((* endif *))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* endblock input *))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
Jonathan Frederic
Localized code into jinja macros.
r9925 % Output_Group
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %
Jonathan Frederic
Localized code into jinja macros.
r9925 % Purpose: Make sure that only one header bar only attaches to the output
% once. By keeping track of when an input group is started
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
Jonathan Frederic
Changed rule attachment logic....
r9928 ((* block output_group *))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 ((* if cell.outputs.__len__() > 0 *))
((* if resources.sphinx.outputstyle == 'simple' *))
% If the first block is an image, minipage the image. Else
% request a certain amount of space for the input text.
((( iff_figure(cell.outputs[0], "\\begin{minipage}{1.0\\textwidth}", "\\needspace{" ~ min_header_lines ~ "\\baselineskip}") )))
% Add a horizantal break, along with break title.
\vspace{10pt}
{\scriptsize Output}\\*
\rule[10pt]{\linewidth}{0.5pt}
\vspace{-20pt}
% Add the contents of the first block.
((( render_output(cell.outputs[0]) )))
% Close the minipage.
((( iff_figure(cell.outputs[0], "\\end{minipage}", "") )))
% Add remainer of the document contents below.
((* for output in cell.outputs[1:] *))
Jonathan Frederic
Added notebook output formatting style
r9940 ((( render_output(output) )))
((* endfor *))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 ((* elif resources.sphinx.outputstyle == 'notebook' *))
%Skip one line down.
\vspace{1\baselineskip}
% Add document contents.
\begin{ColorVerbatim}
((* for output in cell.outputs *))
((( render_output(output) )))
((* endfor *))
\end{ColorVerbatim}
((* endif *))
Jonathan Frederic
Added notebook style input highlighting.
r9939 ((* endif *))
Jonathan Frederic
Localized code into jinja macros.
r9925 ((* endblock *))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
Jonathan Frederic
Localized code into jinja macros.
r9925 % Additional formating
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* block data_text *))
Jonathan Frederic
Changed rule attachment logic....
r9928 ((( custom_verbatim(output.text) )))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((* endblock *))
Jonathan Frederic
Localized code into jinja macros.
r9925 ((* block traceback_line *))
Jonathan Frederic
Changed rule attachment logic....
r9928 ((( line | indent| rm_ansi )))
Jonathan Frederic
Localized code into jinja macros.
r9925 ((* endblock traceback_line *))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
% Supported image formats
%==============================================================================
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((*- block data_png -*))
Jonathan Frederic
Changed rule attachment logic....
r9928 ((( insert_graphics(output.key_png) )))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((*- endblock -*))
((*- block data_svg -*))
Jonathan Frederic
Changed rule attachment logic....
r9928 ((( insert_graphics(output.key_svg) )))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((*- endblock -*))
Jonathan Frederic
Output latex in now placed in verbatim safe for latex.
r9947 ((*- block data_latex -*))
Jonathan Frederic
Added option to remove title and center output
r9950 ((( custom_verbatim(output.latex) )))
Jonathan Frederic
Output latex in now placed in verbatim safe for latex.
r9947 ((*- endblock -*))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 %==============================================================================
% Support Macros
%==============================================================================
Jonathan Frederic
Updated comments...
r9929
% Name: render_output
% Purpose: Renders an output block appropriately.
Jonathan Frederic
Changed rule attachment logic....
r9928 ((* macro render_output(output) -*))
Jonathan Frederic
Added prompt to ntoebook style,...
r9943 ((*- if output.output_type == 'pyerr' -*))
((*- block pyerr scoped *))
((( custom_verbatim(super()) )))
((* endblock pyerr -*))
((*- else -*))
Jonathan Frederic
Changed rule attachment logic....
r9928 ((*- block display_data scoped -*))
((( super() )))
((*- endblock display_data -*))
((*- endif -*))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 ((*- endmacro *))
Jonathan Frederic
Updated comments...
r9929 % Name: iff_figure
% Purpose: If the output block provided is a figure type, the 'true_content'
% parameter will be returned. Else, the 'false_content'.
((* macro iff_figure(output, true_content, false_content) -*))
Jonathan Frederic
Image output detection for pyout
r9944 ((*- set is_figure = false -*))
((*- for type in output | filter_data_type -*))
Jonathan Frederic
Fixed typo, remove extra jpeg
r9945 ((*- if type in ['pdf', 'svg', 'png', 'jpeg','html']*))
Jonathan Frederic
Image output detection for pyout
r9944 ((*- set is_figure = true -*))
((*- endif -*))
((*- endfor -*))
((* if is_figure -*))
Jonathan Frederic
Updated comments...
r9929 ((( true_content )))
((*- else -*))
((( false_content )))
((*- endif *))
((*- endmacro *))
% Name: custom_verbatim
% Purpose: This macro creates a verbatim style block that fits the existing
% sphinx style more readily than standard verbatim blocks.
Jonathan Frederic
Changed rule attachment logic....
r9928 ((* macro custom_verbatim(text) -*))
Jonathan Frederic
Added notebook output formatting style
r9940 \begin{alltt}
((( text | wrap(wrap_size) )))
Jonathan Frederic
Simplified custom verbaatim block, alltt used.
r9946 \end{alltt}
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 ((*- endmacro *))
Jonathan Frederic
Added option to remove title and center output
r9950 % Name: center_output
% Purpose: This macro centers the output if the output centering is enabled.
((* macro center_output(text) -*))
((* if resources.sphinx.center_output *)){\centering ((* endif *))((( text | wrap(wrap_size) )))
((* if resources.sphinx.center_output *))
}((* endif *))
((*- endmacro *))
Jonathan Frederic
Updated comments...
r9929 % Name: insert_graphics
% Purpose: This macro will insert an image in the latex document given a path.
Jonathan Frederic
Changed rule attachment logic....
r9928 ((* macro insert_graphics(path) -*))
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 \begin{center}
Jonathan Frederic
Fixed image sizing problem...
r9942 \includegraphics[max width=0.7\textwidth]{(((path)))}
Jonathan Frederic
Centeralized all "nbconvert sphinx block" logic (macros)...
r9922 \par
\end{center}
((*- endmacro *))
Jonathan Frederic
Updated comments...
r9929 % Name: escape_underscores
% Purpose: Underscores cause a problem in latex. It's important that we
% escape any underscores that appear.
Jonathan Frederic
Changed rule attachment logic....
r9928 ((* macro escape_underscores(text) -*))
Jonathan Frederic
Added HR, pygments, made HR attach to first n lines.
r9781 ((*- set text = text|replace("_","\\_") -*))
((( text )))
Jonathan Frederic
Removed extra line
r9948 ((*- endmacro *))