[IPython-dev] Removing "Out[]" prompts in nbconvert PDF output
Matthias Bussonnier
bussonniermatthias at gmail.com
Mon Mar 23 15:06:17 EDT 2015
Hey !
Le 23 mars 2015 à 05:41, Maximilian Albert <maximilian.albert at gmail.com> a écrit :
> Hi all,
>
> I know this has been brought up a few times before on various forums, but I'm getting a bit lost in all the recent changes to nbconvert, templating, etc., and most of the info I can find online is somewhat out of date.
>
> Is there currently a way to convert a notebook to PDF which removes all the input code cells *and* omits the "Out[]" prompts in the converted output? Removing the input code cells is easy: the edited version of this answer [1] on StackOverflow works beautifully. However, the converted output still has the "Out[]" prompts. I tried to fiddle with the template but didn't manage to get rid of it. Am I missing something or is this currently not easily possible?
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.
You did it for input cells, so you should achieve it here :-)
> Many thanks,
> Max
>
> P.S.: It's already been a little while, but I'd like to extend a huge thanks to the dev team for their awesome work on the 3.0 release. Fantastic job, everyone!!
Thanks !
--
M
More information about the IPython-dev
mailing list