等宽字体和 LuaLaTeX 的双引号

等宽字体和 LuaLaTeX 的双引号

我正在尝试设置以下最小文档:

\documentclass[a4paper,11pt]{article}
\usepackage{fontspec}
\setmonofont{Inconsolata}
\begin{document}
\begin{verbatim}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <title>An Example of a Web page</title>
</head>
<body>
    <p>This is an example of a Web page</p>
</body>
</html>
\end{verbatim}
\end{document}

我想保留文件中存在的 HTML 文本并使用 verbatim 环境。

我想要对称的打字机双引号,而不是印刷的右/左配对双引号。

当我使用 lualatex 编译上述文件时,我得到的是后者而不是前者。

我怎样才能得到我想要的东西?

=== 附录 1 ===

我从下面 Khaled Hosny 建议的博客文章链接下载了字体,解压缩,然后将其作为系统字体安装在我的 Linux 系统上。

fc-list | grep Inconsolata将字体显示为“Inconsolata-dz:style=dz”。

然后,我将上面文件中的单行 Inconsolata 更改为 Inconsolata-dz。

当我尝试使用 lualatex 进行编译时,它会过早终止并显示以下几行:

luaotfload | Updating the font names database:
luaotfload | Scanning TEXMF fonts...
luaotfload | Scanning OS fonts...
! Font \zf@basefont=name:Inconsolata-dz at 10pt not loadable: metric data not found or bad.
<to be read again> 
                   \scan_stop: 
l.3 \setmonofont{Inconsolata-dz}

答案1

我在这里得到的是 ASCII 双引号,但它在字体中画成卷曲的而不是笔直的,这是 Inconsolata 的一个已知(错误)特性,请查看此博客文章以获得带有直引号的修改版本。

相关内容