停止Sphinx连接

时间:2018-03-24 22:45:30

标签: python-sphinx restructuredtext

除了Sphinx和RST之外,我对this也有类似的问题。也就是说,我想阻止文本在行尾的连字符。

例如我想要这个:

This is my long sent-
ence.

成为:

This is my long
sentence.

我该怎么做?

2 个答案:

答案 0 :(得分:2)

连字符由Sphinx主题中的样式表basic.css实现"基本"。

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

答案 1 :(得分:0)

从@ steve-piercy读取指针后,我设法找到了解决该问题的方法。我需要在项目中自定义conf.py。我的conf.py具有以下设置:

# ...
# ...

# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    'papersize': 'a4paper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    'pointsize': '12pt',

    # Additional stuff for the LaTeX preamble.
    #
    'preamble': r'''
    \usepackage[none]{hyphenat}
    '''

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',

}

# ...
# ...

我正在使用Sphinx 1.8.2,MikTex 2.9和Strawberry Perl 5.28.1。 conf.py中的这一新更改将下载新的perl软件包。