exacity / deeplearningbook-chinese

Deep Learning Book Chinese Translation
https://exacity.github.io/deeplearningbook-chinese
35.61k stars 9.12k forks source link

MacOS下面如何编译pdf #158

Open willzhqiang opened 6 years ago

willzhqiang commented 6 years ago

第一次编译出现

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "Adobe Song Std" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.6 ...mainfont[AutoFakeBold=true]{Adobe Song Std}

? ^C^D
! Emergency stop.
!...............................................

l.6 ...mainfont[AutoFakeBold=true]{Adobe Song Std}

No pages of output.
Transcript written on dlbook_cn.log.
make: *** [all] Error 1

我下载安装了,还是一直出错,重启也不行。我确信我安装了这个字体。 另外,如果不想用这个字体,哪里更改呢?

SwordYork commented 6 years ago

出错信息就是字体缺失,可以直接把字体文件放在当前目录。字体可以在dlbook_cn.tex里改。

XiangyunHuang commented 6 years ago

ctexbook类中追加选项fontset = fandol 如下

\documentclass[twoside,nofonts,fancyhdr,openany,UTF8,fontset = fandol]{ctexbook}

再注释如下三行

% \setCJKmainfont[AutoFakeBold=true]{Adobe Song Std}
% \setCJKsansfont{Fandol Hei}
% \setCJKmonofont{Adobe Fangsong Std}

fandol 字体可以如下方式安装

tlmgr install fandol

BTW,编译出来的没有图片和参考文献

SwordYork commented 6 years ago

@XiangyunHuang 本来就没有图片和参考文献,详见readme。https://github.com/exacity/deeplearningbook-chinese#%E6%B3%A8%E6%84%8F

XiangyunHuang commented 6 years ago

@SwordYork 了解,我的意思是不如用你们提供的pdf,自己编译还略显麻烦哈

SwordYork commented 6 years ago

@XiangyunHuang 明白,尝试编译一下也是好的。

Louis-udm commented 6 years ago

如何打开这种lex文件?为何我在mac os下用texstudio打开后全部都是错误呢?

SwordYork commented 6 years ago

@Louis-udm 主文件是dlbook_cn.tex,其他文件不能单独编译。具体是什么错误?

Louis-udm commented 6 years ago

@SwordYork 嗯,打开的就是dlbook_cn.tex,我是在mac os下的tex studio,编译一堆错,我选前面几行给你们看看: Undefined control sequence. \setCJKmainfont Missing \begin{document}. \setCJKmainfont[ Undefined control sequence. \setCJKsansfont Undefined control sequence. \setCJKmonofont Undefined control sequence. \include{math_symbol} Undefined control sequence. \include{math_symbol} Package inputenc Error: Unicode char 单 (U+5355)(inputenc) not set up for use with LaTeX. ...n$ & $n$行$n$列的\gls{identity_matrix} Package inputenc Error: Unicode char 位 (U+4F4D)(inputenc) not set up for use with LaTeX. ...n$ & $n$行$n$列的\gls{identity_matrix} Package inputenc Error: Unicode char 矩 (U+77E9)(inputenc) not set up for use with LaTeX. ...n$ & $n$行$n$列的\gls{identity_matrix} Package inputenc Error: Unicode char 阵 (U+9635)(inputenc) not set up for use with LaTeX. ...n$ & $n$行$n$列的\gls{identity_matrix} Package inputenc Error: Unicode char 单 (U+5355)(inputenc) not set up for use with LaTeX. ...��含于上下文的\gls{identity_matrix} Package inputenc Error: Unicode char 位 (U+4F4D)(inputenc) not set up for use with LaTeX. ...��含于上下文的\gls{identity_matrix}

futianfan commented 6 years ago

@Louis-udm 目测是缺了字体吧。搜一下下载应该就没问题。

SwordYork commented 6 years ago

@Louis-udm 也可能是utf8编码问题,你那边可能默认是GBK,改一下tex studio设置试试。

Louis-udm commented 6 years ago

请教是哪个字体?

Louis-udm commented 6 years ago

@SwordYork 我确认过tex studio的设置是utf8,也如@XiangyunHuang 下载安装了字体,还是报错