1. 程式人生 > >ubuntu之jupyter notebook匯出pdf的方法

ubuntu之jupyter notebook匯出pdf的方法

在使用jupyter notebook執行完程式之後,想要把程式碼和結果儲存成pdf檔案,jupyter notebook自帶匯出pdf的功能,如圖所示

但是第一次執行的時候報錯,提示 nbconvert failed: Pandoc wasn't found. 如圖所示

解決方法是使用以下兩條指令安裝(注意是在ubuntu環境下執行的jupyter notebook)

sudo apt install pandoc
sudo apt install texlive-xetex

安裝完之後再按照第一步的步驟即可匯出pdf檔案