最后,您必须使用能够支持 utf 的编辑器。 (我不知道 Windows 上 utf 支持的状态,但 Linux 上任何合理的编辑器都应该没问题)。
Convert your document to utf8. LaTeX just reads your text as it is. If you want to use the utf8 input encoding, your document has to be encoded in utf8. This can usually be set by the editor. There is also the program iconv that is useful for converting files from iso encodings to utf.
In the end, you'll have to use an editor that is capable of supporting utf. (I have no idea about the status of utf support on windows, but any reasonable editor on linux should be fine).
That said, the TEX-based compiler invoked by latex doesn't really support variable-length encodings; it needs big libraries that tell it that certain bytes go together. Xelatex is Unicode-aware and works much better.
我使用带有特殊“过滤器”功能的 LED 编辑器。 它在自己的编辑器中用 ö 替换 \"{o},反之亦然,同时保留 tex 文件中的原始 \"{o}。 这使得在 LED 编辑器中查看时文本易于阅读,并且不需要特殊的软件包。 它也适用于参考书目文件。
I use LEd Editor with special "Filter" feature. It replaces \"{o} with ö and vice versa in its own editor, while maintaining original \"{o} in tex files. This makes text easily readable when viewed in LEd Editor and there is no need for special packages. It works with bibliography files too.
I have success with using the Chrome addon "Sharelatex". This online editor has great compability with most latex files, but it somewhat lacks configuration possibilities. www.sharelatex.com
发布评论
评论(7)
我不确定是否遇到了您的问题,但如果您使用 UTF-8 编码存储源代码,也许会有帮助。
我还在我的 LaTeX 源中使用
\usepackage[utf8]{inputenc}
并将文件存储为 UTF-8 文件,一切正常。I'm not sure whether I got your problem but maybe it helps if you store the source using a UTF-8 encoding.
I'm also using
\usepackage[utf8]{inputenc}
in my LaTeX sources and by storing the files as UTF-8 files everything works just peachy.将文件保存为 UTF8 格式。
使用以下 (UNIX) 命令验证文件格式:
您应该看到:
如果文件不是 UTF8,则使用
iconv
转换文件:Save your file in UTF8 format.
Verify the file format using the following (UNIX) command:
You should see:
Convert the file using
iconv
if it is not UTF8:\usepackage[utf8]{inputenc}
不适用于如下所示的书目条目:对于此条目,请使用
\usepackage[utf8x]{inputenc}
\usepackage[utf8]{inputenc}
will not work for a bibliographic entry such as this:For this entry use
\usepackage[utf8x]{inputenc}
将您的文档转换为 utf8。 LaTeX 只是按原样读取文本。 如果您想使用 utf8 输入编码,您的文档必须采用 utf8 编码。 这通常可以由编辑器设置。 还有一个程序
iconv
对于将文件从 iso 编码转换为 utf 非常有用。最后,您必须使用能够支持 utf 的编辑器。 (我不知道 Windows 上 utf 支持的状态,但 Linux 上任何合理的编辑器都应该没问题)。
Convert your document to utf8. LaTeX just reads your text as it is. If you want to use the utf8 input encoding, your document has to be encoded in utf8. This can usually be set by the editor. There is also the program
iconv
that is useful for converting files from iso encodings to utf.In the end, you'll have to use an editor that is capable of supporting utf. (I have no idea about the status of utf support on windows, but any reasonable editor on linux should be fine).
您需要 iconv 您的源。
也就是说,
latex
调用的基于 TEX 的编译器并不真正支持可变长度编码; 它需要大型库来告诉它某些字节组合在一起。 Xelatex 能够识别 Unicode,并且工作得更好。You needed to iconv your source.
That said, the TEX-based compiler invoked by
latex
doesn't really support variable-length encodings; it needs big libraries that tell it that certain bytes go together. Xelatex is Unicode-aware and works much better.我使用带有特殊“过滤器”功能的 LED 编辑器。 它在自己的编辑器中用 ö 替换 \"{o},反之亦然,同时保留 tex 文件中的原始 \"{o}。 这使得在 LED 编辑器中查看时文本易于阅读,并且不需要特殊的软件包。 它也适用于参考书目文件。
I use LEd Editor with special "Filter" feature. It replaces \"{o} with ö and vice versa in its own editor, while maintaining original \"{o} in tex files. This makes text easily readable when viewed in LEd Editor and there is no need for special packages. It works with bibliography files too.
我成功使用 Chrome 插件“Sharelatex”。 这个在线编辑器与大多数乳胶文件具有很好的兼容性,但它有点缺乏配置可能性。 www.sharelatex.com
I have success with using the Chrome addon "Sharelatex". This online editor has great compability with most latex files, but it somewhat lacks configuration possibilities. www.sharelatex.com