Skip to content
Discussion options

You must be logged in to vote

Thanks for the mwe. For some reason the output uses the LaTeX "tilde" which is mark-up for a non-breakable space:

{\sphinxbfcode{\sphinxupquote{this~is~a~very~long~string~that~is~supposed~to~have~some~sort~of~line\sphinxhyphen{}wrapping~when~it~gets~too~long~but~instead~it~just~goes~off~the~page.}}}

I had never seen tildes in Sphinx LaTeX output, but one learns at all ages.

This works as workaround, add it to conf.py:

latex_elements = {
    'preamble': r"""
\let\orisphinxbreaksviaactive\sphinxbreaksviaactive
\def\sphinxbreaksviaactive{\orisphinxbreaksviaactive\def~{ }}
""",
}

When time permits I will look closer into it to check when Sphinx LaTeX outputs such "tildes" more generally and…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@cahash00
Comment options

@jfbu
Comment options

jfbu Aug 5, 2025
Collaborator

Answer selected by cahash00
@jfbu
Comment options

jfbu Aug 5, 2025
Collaborator

@AA-Turner
Comment options

@jfbu
Comment options

jfbu Aug 5, 2025
Collaborator

@jfbu
Comment options

jfbu Aug 5, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants