As the title says. As a person who usually uses Notebook as a simulation platform, I would like to end the story as much as possible. It's unbearable to hit the formulas quickly. Therefore, create a slide using live_reveal, which is an extension of IPython Notebook. I got the permission of the boss of the laboratory, so I would like to announce it with a doy face.
Please check each one for installation method and easy usage. There should be some in Qiita as well.
This time, we have summarized the solutions for the cases that you actually used and had to solve.
Making presentation materials is fairly quick. All you have to do is cut and paste what you have written so far, put it together, and throw it into the cell. However, this alone will naturally cause problems.
This will probably be felt by everyone. Even though it is displayed beautifully on my browser, when I project it on a projector, various people point out that the characters are too small to see. If you zoom in using the browser function, the figure will also become larger this time, and it will not work.
This is relatively easy to solve.
Around line 14 of ~ / .ipython / nbextensions / livereveal / main.css
.reveal .slides {
text-align: left;
font-size: 190%; //160%
//width: 100% !important; //960px, 1366px
}
Edit as follows. Ignore the width section. The font-size was changed from 160% to 190%. By doing this, you can change the font size to the same size as when you enlarged it to 125% on the browser, and you can keep the size of objects other than characters.
In normal Notebook mode, it is displayed neatly in the center without doing anything, but in slide mode it is left-aligned. You also need to be careful about setting the width of the image. The simple solution is
<div align="center">
<img src=download1.png width=70% />
Figure 1.What a graph</div>
How to do it like this. If you do this, it will be displayed in the center ... I would like to say, but in reality it will be slightly shifted to the right.
I was very annoyed by this. The reason for this is that the area for displaying the execution number of each cell (such as "In [3]:") is taken to the left. Therefore, it is necessary to erase this area. If you google a little
You will find information such as. The above example shows how to turn off the input cell and prompt area when making a slide with nbconvert
. If I try this script as it is (without the <script>
tag, of course) and write it in ~ / .ipython / nbextensions / main.js
and reload it, the input cell and prompt area will certainly disappear. I will. However, this is a problem when editing or when you want to use it in other normal ways, so I would like to enable it only when displaying a slide show.
In IPython, a profile can be started by specifying a group of setting files, so you can see that one of them is to create a setting for slides like this one.
ipython profile create slide
If so, you can see that a new profile called "profile_slide" has been created under ~ / .ipython
.
Therefore, edit the contents of ~ / .ipython / profile_slide / static / custom / custom.js
as follows.
$([IPython.events]).on('app_initialized.NotebookApp', function(){
require(['nbextensions/livereveal/main'],function(livereveal){
// livereveal.parameters('theme', 'transition', 'fontsize', static_prefix);
// * theme can be: simple, sky, beige, serif, solarized
// (you will need aditional css for default, night, moon themes).
// * transition can be: linear, zoom, fade, none
livereveal.parameters('simple', 'fade');
console.log('Live reveal extension loaded correctly');
// http://hannes-brt.github.io/blog/2013/08/11/ipython-slideshows-will-change-the-way-you-work/
function hideElements(elements, start) {
for(var i = 0, length = elements.length; i < length;i++) {
if(i >= start) {
elements[i].style.display = "none";
}
}
}
var input_elements = document.getElementsByClassName('input');
hideElements(input_elements, 0);
var prompt_elements = document.getElementsByClassName('prompt');
hideElements(prompt_elements, 0);
});
});
If you edit it this way and reload the page, you'll see that the input cells and prompt area are no longer visible, as we did when we tried it earlier.
Now you can finally center the title text ...
That's right, it's annoying.
The way to forcibly erase is to use $ ('.reveal') in the definition of
buttonExitaround line 305 of
~ / .ipython / nbextensions / livereveal / main.jswhere these are defined. You can comment out the line that says .after (help_button);
with" //
". You can also comment out similar parts in the buttonExit
that are defined after that to hide these buttons every time.
Also, if you want to display or not display depending on the profile, as in the previous example, in the profile's custom.js
var buttonHelp_elements = document.getElementsByClassName('buttonHelp');
hideElements(buttonHelp_elements, 0);
var buttonExit_elements = document.getElementsByClassName('buttonExit');
hideElements(buttonExit_elements, 0);
You can add it as something that is not displayed. This way you can hide these buttons in certain profiles (for production).
This may also be helpful.
As a known issue, converting slides to pdf doesn't work. In the video below, the developer answers the question why it happened.
If you select "pdf export" from "print" in Firefox, it will try to convert to pdf including the area below. In Chrome, it's not that bad, but when you import a diagram, it exports a disappointing pdf with a number of small diagrams packed in the position you want it to zoom in.
One possible solution to this problem is to slide it with nbconvert and then convert it to pdf in your browser. However, the author stumbled on this nbconvert relatively, so in the end I took a screenshot of everything and put it together in one pdf with convert (← also refer to “IPython Notebook slides” (Forcibly) how to convert to pdf "). The point to keep in mind at this time is to match your PC to the screen size of the projector that you will actually use in your presentation before taking a screenshot. If you don't do this, you'll end up with wide slides when you put them together in a pdf later, or mass-produce slides with too large margins. Record the commands and tools you actually used for later study.
The screenshot is an application called shutter on linux and I took a screenshot of the selection. Save this one by one in one directory, being careful that the one with the youngest slide number becomes the one with the smaller number in the file name. Once all the slides have been saved, in that directory
convert -page 1024x768 -gravity Center *.jpg out.pdf
And run. As a result, all jpg image files are arranged in numerical order at 1024px in width and 768px in height (← resolution of the projector in the laboratory), and an out.pdf aligned in the center is created. All of them are treated as images, so it's cute that the file size becomes large. It is also cute that the characters are slightly blurred. It shouldn't stand out if you print it out and make it smaller! However, I don't think this is a good idea for the slides that you prepare as spares. It may be better to create a spare pdf file from scratch using PowerPoint quietly. And when this happens, there is a whisper that PowerPoint was good from the beginning ...
The content of the thesis is not relevant here, so I will not write it, but it is important that you can easily recreate it when there is a change. Therefore, even if you take the same scree shot and convert it to pdf, it is better to use it if it can be automated. Whether or not there is such time is another matter. It's an extension that's still under development, so there are a lot of bugs, but as a person who loves this feature and uses Notebook, I'll continue to use it. I'll definitely make it popular! (* ´ω ` *)
Recommended Posts