2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jupyter の出力のみを pdf にエクスポートする方法

2
Posted at

概要

jupyter のノートブックの出力のみ(すなわちコード以外)をpdfに出力します.

jupyter notebook, jupyter lab どちらも同じ手順です.

手順

1.pdfに変換したいノートブックを作る

2.File > Download as > HTML で.htmlファイルをダウンロード
(Jupyter Labの場合,File > Export Notebook As > Export Notebook to HTML
3.ダウンロードしたhtmlファイルをブラウザで開く(以下, ChromeかFirefoxを想定します)
4.F12で開発ツール(デベロッパーツール)を開く
5.コンソール(Consoleタブから開ける)で以下のコードを実行する

document.querySelectorAll("div.input").forEach(function(a){a.remove()})

Screenshot from 2020-12-02 18-04-35.png

6.ブラウザの印刷機能でpdfを出力する.

以上です.

参照

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?