python-sphinx - 阻止 Sphinx 断字

标签 python-sphinx restructuredtext

我有一个与 this 类似的问题,除了 Sphinx 和 RST。也就是说,我想防止文本在行尾被连字符。

例如我想要这个:

This is my long sent-
ence.

成为:

This is my long
sentence.

我该怎么做?

最佳答案

断字由样式表 basic.css 实现在 Sphinx 主题“基本”中。

div.body p, div.body dd, div.body li, div.body blockquote {
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
}

您可以用自己的样式覆盖这些样式。请参阅我对 How do I customize Sphinx RtD Theme default search settings? 的回答

您的主题可能具有实现断字的 JavaScript 或其他样式。

有关 PDF 输出,请参阅 https://tex.stackexchange.com/a/5039

关于python-sphinx - 阻止 Sphinx 断字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49470740/

相关文章:

python - reStructuredText/Sphinx 中的图像网格

python - 狮身人面像 : Putting a code segment at the first line of an unordered list item

python - 在 Python 模块中使用部分构建 Sphinx autodoc 文档

python - 在 Sphinx 自动摘要中使用第一段而不是第一行

python - 如何使用一个只有函数的 .py 文件制作 Sphinx 文档?

image - 将 sphinx 指向构建目录中的图像

python - 有没有办法告诉 Sphinx 在不禁用 autodoc 的情况下不要运行模块?

python - 使用 Sphinx 的 sphinx-apidoc 实用程序从 python 代码自动生成文档

python - 狮身人面像/rST : using configuration values in include statements?