Output is not wide enough when converting Ipython notebook to a reveal slide show

I'm plotting the head of some dataframes in my notebook, and they fit just fine to the notebook width. But when converting to slides with the reveal.js, the tables are being cut in the middle.

Is there a way to make the width of the resulted slide-show the same as the width of the notebook? Or any other why to make sure the cell output of the notebook will be fully presented in the slides?

Answers


To avoid parsing the HTML afterwards, a more streamlined solution would be to make a copy of the reveal template,

make the changes to the template such as below, more details on configuration options can be found on reveal.js#presentation-size.

Reveal.initialize({

...

// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 960,
height: 700,  

});

and then save it into your jupyter templates path (you can find it by typing jupyter --path)

for example, on linux you can put it in ~/.local/share/jupyter/templates

save it as slides_wide.tpl

then you can call nbconvert using:

jupyter nbconvert --template slides_wide.tpl --to slides yournotebook.ipynb

Here is how to fix it:

on cmd - create the presentation html by:

ipython nbconvert --to slides yournotebook.ipynb that will create an html file. open the html file and go to the reveal.initilize() section. In it, enter the desired width of the presentation such that it will fit the width of the dataframe, e.g.:

Reveal.initialize({

    ...

    // The "normal" size of the presentation, aspect ratio will be preserved
    // when the presentation is scaled to fit different resolutions. Can be
    // specified using percentage units.
    width: 960,
    height: 700,  

});

Need Your Help

Canot click button with Python with Selenium

python html selenium input selenium-webdriver

I am trying to click a button that brings up a dialogue box to select a file. inspecting the element it looks like its an input rather than a button. Either way I cannot click it with:

ASP.NET MVC MEMBERSHIP

asp.net asp.net-mvc membership

I have just created a user in ASP.NET MVC ,and i want to insert him into Membership table. How can i do that? , because i can`t insert into Membership_Users