|
|
((= Simple input/output style =))
|
|
|
|
|
|
((*- extends 'latex_base.tplx' -*))
|
|
|
|
|
|
|
|
|
% Custom packages
|
|
|
((* block packages *))
|
|
|
((( super() )))
|
|
|
|
|
|
\usepackage{needspace} % Make prompts follow contents
|
|
|
((* endblock packages *))
|
|
|
|
|
|
% Custom definitions
|
|
|
((* block definitions *))
|
|
|
((( super() )))
|
|
|
|
|
|
% Pygments definitions
|
|
|
((( resources.latex.pygment_definitions )))
|
|
|
|
|
|
\newlength{\promptspace}
|
|
|
\setlength{\promptspace}{4\baselineskip} % Space needed to start a new
|
|
|
% input/output
|
|
|
((* endblock definitions *))
|
|
|
%===============================================================================
|
|
|
% Input
|
|
|
%===============================================================================
|
|
|
|
|
|
((*- block in_prompt scoped -*))
|
|
|
((( draw_prompt('Input') )))
|
|
|
((*- endblock in_prompt -*))
|
|
|
|
|
|
((*- block input_group scoped -*))
|
|
|
(((- super() )))
|
|
|
\vspace{-2em}
|
|
|
((* endblock input_group -*))
|
|
|
|
|
|
((* block input scoped *))
|
|
|
((( cell.input | highlight2latex )))
|
|
|
((* endblock input *))
|
|
|
|
|
|
%===============================================================================
|
|
|
% Output
|
|
|
%===============================================================================
|
|
|
|
|
|
((*- block output_prompt scoped -*))
|
|
|
((( draw_prompt('Output') )))
|
|
|
((*- endblock output_prompt -*))
|
|
|
|
|
|
((*- block output_group scoped -*))
|
|
|
(((- super() )))
|
|
|
\vspace{-2em}
|
|
|
((* endblock output_group -*))
|
|
|
|
|
|
%==============================================================================
|
|
|
% Support Macros
|
|
|
%==============================================================================
|
|
|
|
|
|
% Name: draw_prompt
|
|
|
% Purpose: Renders an output/input prompt for notebook style pdfs
|
|
|
((* macro draw_prompt(prompt) *))
|
|
|
% Add a horizantal break, along with break title.
|
|
|
\needspace{\promptspace}
|
|
|
\br\br
|
|
|
{\scriptsize ((( prompt )))}
|
|
|
\br
|
|
|
\rule[10pt]{\linewidth}{0.5pt}
|
|
|
\vspace{-2.5em}
|
|
|
((* endmacro *))
|
|
|
|