Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style_simple.tplx #12

Open
bgrant opened this issue Sep 14, 2015 · 4 comments
Open

style_simple.tplx #12

bgrant opened this issue Sep 14, 2015 · 4 comments

Comments

@bgrant
Copy link

bgrant commented Sep 14, 2015

Where can I find style_simple.tplx, as mentioned here:

https://github.com/ipython/nbconvert-examples/tree/master/latex_cell_style

?

I don't seem to see it in the source tree for any of the major IPython releases.

@Siggenx
Copy link

Siggenx commented Sep 17, 2015

In this folder for Anaconda distribution:

home/anaconda3/lib/python3.4/site-packages/IPython/nbconvert/templates/latex

But this:

((* set cell_style = 'style_python.tplx' *))

Is where you set the style in your template.

@cpieringer
Copy link

I have Anaconda 3, but that style_simple.tplx is missing. Where can I find more details how to write a notebook template?

@Siggenx
Copy link

Siggenx commented Sep 24, 2015

Seems like style_simple.tplx it got removed in commit 930d72c697f4e61ee2c43feb60dfe9d27b46dab5 (23 Sep 2013) in the ipython repository. At that time it looked like this:

((= 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 -*))
    \par\vspace{-1\baselineskip}
    ((( draw_prompt('Input') )))
((*- endblock in_prompt -*))

((*- block input_group scoped -*))
    (((- super() )))
    \par\vspace{-2\baselineskip}
((* 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() )))
    \par\vspace{-1\baselineskip}
((* 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 *))

Please note that this is old and will not work, but the jinja2 elements should be there.

On

http://nbconvert.readthedocs.org/en/latest/customizing.html#template-structure

can you find info on how a template is structured. These examples should definitely be updated.

@cpieringer
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants