[PYTHON] [Small story] Easy way to convert Jupyter to PDF

Introduction

When I saved the Jupyter notebook I wrote in HTML and browsed it on my iPhone, the formula I wrote in Tex did not display well. So when I tried to save as PDF, it seemed that standard PDF output could not be used if Japanese was included.

Of course, there are various solutions, but it's a little difficult. Qiita: Download Japanese Jupyter Notebook as PDF Qiita: Convert from Jupyter notebook to pdf [mac]

solution

There is a problem that the layout is slightly broken, but the quick way is to export Jupyter as HTML and convert it to PDF by printing from the browser. The procedure using Google Chrome is shown below.

  1. Save Jupyter as HTML with "File"-> "Export Notebook As ..."-> "Export Notebook to HTML". exportHTML.png

  2. Open the HTML file in your browser. Click Print. print.png

  3. Change the destination to "Save to PDF" and click "Save". PDF_print.png

result

Japanese and Tex are also displayed properly. pdf.png

Summary

~~ How was it ~~

Recommended Posts

[Small story] Easy way to convert Jupyter to PDF
Convert jupyter to py
An easy way to create an import module with jupyter
Easy way to rename files
Convert PDF to Documents by OCR
Easy way to customize Python import
Convert A4 PDF to A3 every 2 pages
Convert from pdf to txt 2 [pyocr]
Easy to use Jupyter notebook (Python3.5)
Convert PDF to image with ImageMagick
Easy way to enter and execute AtCoder test cases in Jupyter Notebook
[HOW TO] Easy way to debug when generating PDF files with PHP etc.
[Small story] How to save matplotlib graphs in a batch with Jupyter
Convert from PDF to CSV with pdfplumber
Convert PDF attached to email to text format
Convert PDF files to PNG files with GIMP
Let's make jupyter lab easy to use
Convert PDF to image (JPEG / PNG) with Python
Easy way to plot HR diagram using astroquery
Easily convert Jupyter Notebooks to blogs with fastpages
Easy way to load CPU / memory on Linux
Batch convert PSD files in directory to PDF
An easy way to call Java from Python
Convert to HSV
Convert jupyter notebook .ipynb files to python executable .py files
Easy way to check the source of Python modules
Beginners try to convert Word files to PDF at once
[Python] Convert PDF text to CSV page by page (2/24 postscript)
Easy way to scrape with python using Google Colab
Convert the image in .zip to PDF with Python