LaTeX 中的冰岛语、utf8 和 utf8x
首先,utf8和utf8x在
\usepackage[utf8]{inputenc}
\usepackage[utf8x]{inputenc}
LaTeX中使用时有什么区别?
其次,使用 LaTeX 写冰岛文文章需要哪些软件包?我发现:
\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
经过一番尝试后,我感觉代码的某些部分可能是多余的。即使使用上述软件包,
\begin{lstlisting}
...
\end{lstlisting}
在 Ubuntu 中通过 pdflatex 输出时,内部代码也不会用冰岛语字符呈现,尽管它可以在我朋友的计算机(运行 Debian)上运行。缺少什么?
First of all, what's the difference between utf8 and utf8x in
\usepackage[utf8]{inputenc}
\usepackage[utf8x]{inputenc}
when used in LaTeX?
Secondly, what packages are required when writing an article in Icelandic using LaTeX? I found:
\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
after experimenting a bit but I have a feeling some part of the code may be redundant. And even with them the aforementioned packages, the code inside
\begin{lstlisting}
...
\end{lstlisting}
isn't rendered with Icelandic characters when outputted through pdflatex
in Ubuntu, although it works on my friend's computer (who's running Debian). What's missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
[UTF8]
受到 LaTeX 团队的“支持”,涵盖了相当具体/有限的 unicode 输入字符范围。它仅定义那些已知可用于当前字体编码的符号。[UTF8x]
,据我所知,不再受支持,但涵盖了更广泛的输入符号。我建议仅在[UTF8]
不能满足您的需要时尝试它。其次,listings 包(以及大多数其他进行字符扫描的相关包)不支持 UTF8 输入。 (如果它在朋友的机器上运行,他们必须使用 8 位输入编码。)
listingsutf8
包为\lstinputlisting
提供了 UTF8 兼容的替代品,但不为主要的lstlisting
环境。不过,使用 XeLaTeX 可能会对您有所帮助。[UTF8]
is "supported" by the LaTeX team and covers a fairly specific/limited range of unicode input characters. It only defines those symbols that are known to be available with the current font encoding.[UTF8x]
, AFAIK, is no longer supported, but covers a much broader range of input symbols. I would recommend only trying it if[UTF8]
doesn't do what you need.Secondly, the listings package (and most other related packages that do character scanning) does not support UTF8 input. (If it's working on a friend's machine they must be using an 8-bit input encoding instead.) The
listingsutf8
package provides a UTF8-compatible replacement for\lstinputlisting
but not for the mainlstlisting
environment. Using XeLaTeX might help you here, however.