Add \nobreak inside \sphinxAtStartPar

Else, a non-hyphenatable long word as first word in a narrow column in a
longtable/tabular (with column type e.g. p{1cm} from tabularcolumns
directive) gets shifted downwards vertically in PDF output.

Memo:

1. I did not find other cases where such a vertical shift may occur (I
tried with deeply nested lists and artificial words such as 'A'*32) with
LaTeX mark-up produced by Sphinx,

2. but with the support of hlist directive via PR #8779 using multicols
environment, there is again this situation of downwards shift of
non-hyphenatable long first words.  But it occurs whether or not
\sphinxAtStartPar is used (\nobreak does not modify this).
This commit is contained in:
jfbu 2021-01-29 13:10:21 +01:00
parent d6e11b89e9
commit 17642a5e6b

View File

@ -412,7 +412,7 @@
\DisableKeyvalOption{sphinx}{mathnumfig}
% To allow hyphenation of first word in narrow contexts; no option,
% customization to be done via 'preamble' key
\newcommand*\sphinxAtStartPar{\hskip\z@skip}
\newcommand*\sphinxAtStartPar{\nobreak\hskip\z@skip}
% No need for the \hspace{0pt} trick (\hskip\z@skip) with luatex
\ifdefined\directlua\let\sphinxAtStartPar\@empty\fi
% user interface: options can be changed midway in a document!