如何以 UTF8 编译 LaTeX?

发布于 2024-07-30 09:05:09 字数 1456 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

你好,陌生人 2024-08-06 09:05:09

我不确定是否遇到了您的问题,但如果您使用 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.

素衣风尘叹 2024-08-06 09:05:09

将文件保存为 UTF8 格式。

使用以下 (UNIX) 命令验证文件格式:

file -bi filename.tex 

您应该看到:

text/x-tex; charset=utf-8

如果文件不是 UTF8,则使用 iconv 转换文件:

iconv --from-code=ISO-8859-1 --to-code=UTF-8 filename.txt > filename-utf.txt

Save your file in UTF8 format.

Verify the file format using the following (UNIX) command:

file -bi filename.tex 

You should see:

text/x-tex; charset=utf-8

Convert the file using iconv if it is not UTF8:

iconv --from-code=ISO-8859-1 --to-code=UTF-8 filename.txt > filename-utf.txt
陪你搞怪i 2024-08-06 09:05:09

\usepackage[utf8]{inputenc} 不适用于如下所示的书目条目:

@ARTICLE{Hardy2007,
author = {Ibn Taymiyyah, Aḥmad ibn ʿAbd al{-}Halīm},
title = {Naqḍ al{-}manṭiq},
shorttitle = {Naqḍ al-manṭiq},
editor = {Ḥamzah, Aḥmad},
publisher = {Maktabat a{l-}Sunnah},
address = {Cairo},
year = {1970},
sortname = {IbnTaymiyyaNaqdalmantiq},
keywords = { Logic, Medieval}} 

对于此条目,请使用 \usepackage[utf8x]{inputenc}

\usepackage[utf8]{inputenc} will not work for a bibliographic entry such as this:

@ARTICLE{Hardy2007,
author = {Ibn Taymiyyah, Aḥmad ibn ʿAbd al{-}Halīm},
title = {Naqḍ al{-}manṭiq},
shorttitle = {Naqḍ al-manṭiq},
editor = {Ḥamzah, Aḥmad},
publisher = {Maktabat a{l-}Sunnah},
address = {Cairo},
year = {1970},
sortname = {IbnTaymiyyaNaqdalmantiq},
keywords = { Logic, Medieval}} 

For this entry use \usepackage[utf8x]{inputenc}

极致的悲 2024-08-06 09:05:09

将您的文档转换为 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).

遗忘曾经 2024-08-06 09:05:09

您需要 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.

拥抱影子 2024-08-06 09:05:09

我使用带有特殊“过滤器”功能的 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.

寄离 2024-08-06 09:05:09

我成功使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文