Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Sphinx from Hyphenating

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:

This is my long sent-
ence.

To be:

This is my long
sentence.

How do I do this?

like image 377
Benjamin Lee Avatar asked Nov 25 '25 20:11

Benjamin Lee


1 Answers

Hyphenation is implemented by the stylesheet basic.css in the Sphinx theme "basic".

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

You can override these styles with your own. See my answer to How do I customize Sphinx RtD Theme default search settings?

Your theme may have JavaScript or other styles that implement hyphenation.

For PDF output, see https://tex.stackexchange.com/a/5039

like image 100
Steve Piercy Avatar answered Nov 27 '25 23:11

Steve Piercy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!