TexLive支持中文問題

今天在用texlive+texstudio導入CJK包輸入中文時,出現了下面的錯誤
代碼:

\documentclass[11pt]{article}  %百分號表示註釋
\usepackage{CJK}               %引入CJK宏包
\begin{document}               %begin與end成對出現
	\begin{CJK}{UTF8}{song}        %應用CJK環境
		你好
	\end{CJK}
\end{document}

錯誤:

Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "texstudio_pXXLQW".tex

name = cyberb59, rootname = cyberb, pointsize = 59 mktexmf: empty or non-existent rootfile!

Cannot find font cyberb59 in map file(s).

kpathsea: Running mktexmf cyberb59.mf The command name is F:\texlive\2019\bin\win32\mktexmf Cannot find cyberb59.mf . I try ps2pk --> gsftopk --> ttf2pk --> hbf2gf. ps2pk cannot be used. I try gsftopk. gsftopk.exe cyberb59 657 gsftopk cannot be used. Next I try ttf2pk. ttf2pk.exe -q cyberb59 657 ttf2pk failed. Finally I try hbf2gf. hbf2gf.exe -q -p cyberb59 657 All trials failed.

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+57/600 --dpi 657 cyberb59 The command name is F:\texlive\2019\bin\win32\mktexpk kpathsea: Appending font creation commands to missfont.log.

Process exited with error(s)

解決方法一:

在\begin{document}之前,添加下面一行
\usepackage[UTF8]{ctex}

\documentclass[11pt]{article}  
\usepackage[UTF8]{ctex}
\begin{document}              
	\begin{CJK}{UTF8}{song}        
		你好
	\end{CJK}
\end{document}

解決方法二

\documentclass[UTF8]{ctexart}
\begin{document}
用 XeLaTeX 或者 pdfLaTeX 編譯,就能得到中文。推薦用 XeLaTeX 編譯。


不要使用 CJK 了。
\end{document}

參考方法:
Texlive+Texstudio支持中文的方法
【新人求助】在latex中調用CJK的時候,字體出錯。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章