Stop Sphinx from Hyphenating

前端 未结 2 909
一向
一向 2021-01-21 01:52

I have a similar question to this, except for Sphinx and RST. Namely, I would like to prevent text from being hyphenated at the end of the line.

For example I want this:

2条回答
  •  盖世英雄少女心
    2021-01-21 02:53

    After reading pointers from @steve-piercy, I managed to find a solution for the problem. I need to customize conf.py in my project. My conf.py has the following settings:

    # ...
    # ...
    
    # -- 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',
    
    }
    
    # ...
    # ...
    

    I am using Sphinx 1.8.2, MikTex 2.9 and Strawberry Perl 5.28.1. This new change in conf.py will download new perl package(s).

提交回复
热议问题