[IPython-dev] Removing "Out[]" prompts in nbconvert PDF output

Maximilian Albert maximilian.albert at gmail.com
Mon Mar 23 21:08:25 EDT 2015


2015-03-23 19:06 GMT+00:00 Matthias Bussonnier <bussonniermatthias at gmail.com
>:

>
> I guess you need to inherit the following block :
>
>
> ((* block execute_result scoped *))
>     ((*- for type in output.data | filter_data_type -*))
>         ((*- if type in ['text/plain']*))
>             ((( add_prompt(output.data['text/plain'] | escape_latex, cell,
> 'Out', 'outcolor') )))
>         ((* else -*))
> \texttt{\color{outcolor}Out[{\color{outcolor}((( cell.execution_count
> )))}]:}((( super() )))
>         ((*- endif -*))
>     ((*- endfor -*))
> ((* endblock execute_result *))
>
>
> form IPython/nbconvert/templates/latex/style_ipython.tplx
>
> And replace by what you wish.
>


Thanks for the suggestion! That's precisely what I tried, but the problem
seems to be that the call to super() somehow adds an additional Out[]
prompt. I'll try to dig deeper into this when I get the time (and/or make a
minimal example available so that it can easily be reproduced), but if
anyone has any quick ideas I'm happy to hear them.

Cheers,
Max

P.S.: I noticed I forgot to include the link to the StackOverflow question
I mentioned in my original email. Here it is:


http://stackoverflow.com/questions/19524554/suppress-code-in-nbconvert-ipython
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150324/8264ff70/attachment.html>


More information about the IPython-dev mailing list