MLC: 机器学习编译器
安装
conda env update -n mlc -f static/build.yml
conda activate mlc
pip install git+https://github.com/d2l-ai/d2l-book
构建
不进行评估的构建
将config.ini
中的eval_notebook = True
改为eval_notebook = False
。
构建HTML
d2lbook build html
构建PDF
# 安装依赖
sudo apt-get install texlive-full
sudo apt-get install librsvg2-bin
sudo apt-get install pandoc # 如果不起作用,请使用 conda install pandoc
# 构建PDF
d2lbook build pdf
PDF字体
wget https://raw.githubusercontent.com/d2l-ai/utils/master/install_fonts.sh
sudo bash install_fonts.sh
安装字体
wget -O source-serif-pro.zip https://www.fontsquirrel.com/fonts/download/source-serif-pro
unzip source-serif-pro -d source-serif-pro
sudo mv source-serif-pro /usr/share/fonts/opentype/
wget -O source-sans-pro.zip https://www.fontsquirrel.com/fonts/download/source-sans-pro
unzip source-sans-pro -d source-sans-pro
sudo mv source-sans-pro /usr/share/fonts/opentype/
wget -O source-code-pro.zip https://www.fontsquirrel.com/fonts/download/source-code-pro
unzip source-code-pro -d source-code-pro
sudo mv source-code-pro /usr/share/fonts/opentype/
wget -O Inconsolata.zip https://www.fontsquirrel.com/fonts/download/Inconsolata
unzip Inconsolata -d Inconsolata
sudo mv Inconsolata /usr/share/fonts/opentype/
sudo fc-cache -f -v