Written by simon on September 14, 2008 – 3:29 pm
刚开始学latex,按照lshort的手册摸索中,在中文显示的地方卡住了
如下这段代码无法编译通过,出现的错误提示是:
! Package inputenc Error: Unicode char u 8:来 not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H for immediate help.
...
l.2 ...ak or to continue without it.}}{1}
? q
大致检查了一下,原因大概是要在 ableofcontents字段中读入section{来点中文测试哈}
而无法正常显示中文所导致的。如果将“来点中文测试哈”改为英文比如Chinese Test,则可以顺利pdflatex test.tex编译通过并在evince中正常显示。
但我若是将 ableofcontents字段改为
egin{CJK}{UTF8}{song}
%insert the table of contents
ableofcontents
end{CJK}
再编译,同样提示这样的错误。请问原因何在,如何避免?
test.tex的源代码见下:
documentclass[a4paper, 11pt]{article}
% define the title
author{Yanyuan Zhu}
usepackage{CJKutf8}
itle{My Test LaTeX{}}
egin{document}
% generates the title
maketitle
%insert the table of contents
ableofcontents
section{Some Interesting Words}
Well, and here begins my lovely article.
%usepackage{CJKutf8}
egin{CJK}{UTF8}{song}
section{来点中文测试哈}
大家好,我是中文测试部分的内容!
这句话是标点符号的测试。
end{CJK}
section{Good Bye World}
ldots{} and here it ends.
section{Itemize, Enumerate, and Description}
flushleft
egin{enumerate}
item You can mix the list environments to your taste:
egin{itemize}
item But it might start to look silly.
item[-] With a dash.
end{itemize}
item Therefore remember:
egin{description}
item[Stupid] things will not become smart because they are in a list.
end{description}
end{enumerate}
end{document}
Tags:
latex,
linuxPosted under
linux |
No Comments »