Fix #8780: long words in narrow columns may not be hyphenated

This is done by adding '\hskip0pt\relax\n' whenever a paragraph starts.
This commit is contained in:
jfbu 2021-01-29 00:24:44 +01:00
parent 7f63c5442e
commit 185a2d27fe
28 changed files with 269 additions and 244 deletions

View File

@ -109,6 +109,7 @@ Bugs fixed
:confval:`numfig` is not True :confval:`numfig` is not True
* #8442: LaTeX: some indexed terms are ignored when using xelatex engine * #8442: LaTeX: some indexed terms are ignored when using xelatex engine
(or pdflatex and :confval:`latex_use_xindy` set to True) with memoir class (or pdflatex and :confval:`latex_use_xindy` set to True) with memoir class
* #8780: LaTeX: long words in narrow columns may not be hyphenated
Testing Testing
-------- --------

View File

@ -12,17 +12,13 @@ The following is a list of deprecated interfaces.
.. tabularcolumns:: |>{\raggedright}\Y{.4}|>{\centering}\Y{.1}|>{\centering}\Y{.12}|>{\raggedright\arraybackslash}\Y{.38}| .. tabularcolumns:: |>{\raggedright}\Y{.4}|>{\centering}\Y{.1}|>{\centering}\Y{.12}|>{\raggedright\arraybackslash}\Y{.38}|
.. |LaTeXHyphenate| raw:: latex
\hspace{0pt}
.. list-table:: deprecated APIs .. list-table:: deprecated APIs
:header-rows: 1 :header-rows: 1
:class: deprecated :class: deprecated
:widths: 40, 10, 10, 40 :widths: 40, 10, 10, 40
* - Target * - Target
- |LaTeXHyphenate|\ Deprecated - Deprecated
- (will be) Removed - (will be) Removed
- Alternatives - Alternatives

View File

@ -1161,7 +1161,9 @@ class LaTeXTranslator(SphinxTranslator):
# (first one is label node) # (first one is label node)
pass pass
else: else:
self.body.append('\n') # the \hskip0pt\relax is to allow hyphenation of first word of
# a paragraph in narrow contexts such as in a table cell
self.body.append('\\hskip0pt\\relax\n')
def depart_paragraph(self, node: Element) -> None: def depart_paragraph(self, node: Element) -> None:
self.body.append('\n') self.body.append('\n')

View File

@ -1,13 +1,14 @@
\hskip0pt\relax
Equation without a label. Equation without a label.
\begin{equation*} \begin{equation*}
\begin{split}E = mc^2\end{split} \begin{split}E = mc^2\end{split}
\end{equation*} \end{equation*}\hskip0pt\relax
Equation with label. Equation with label.
\begin{equation}\label{equation:equations:test} \begin{equation}\label{equation:equations:test}
\begin{split}E = hv\end{split} \begin{split}E = hv\end{split}
\end{equation} \end{equation}\hskip0pt\relax
Second equation without label. Second equation without label.
\begin{equation*} \begin{equation*}
\begin{split}c^2 = a^2 + b^2\end{split} \begin{split}c^2 = a^2 + b^2\end{split}
\end{equation*} \end{equation*}\hskip0pt\relax
Equation with label \eqref{equation:equations:test} is important. Equation with label \eqref{equation:equations:test} is important.

View File

@ -1,10 +1,10 @@
\label{\detokenize{complex:complex-spanning-cell}} \label{\detokenize{complex:complex-spanning-cell}}\hskip0pt\relax
table having … table having …
\begin{itemize} \begin{itemize}
\item {} \item {} \hskip0pt\relax
consecutive multirow at top of row (1\sphinxhyphen{}1 and 1\sphinxhyphen{}2) consecutive multirow at top of row (1\sphinxhyphen{}1 and 1\sphinxhyphen{}2)
\item {} \item {} \hskip0pt\relax
consecutive multirow at end of row (1\sphinxhyphen{}4 and 1\sphinxhyphen{}5) consecutive multirow at end of row (1\sphinxhyphen{}4 and 1\sphinxhyphen{}5)
\end{itemize} \end{itemize}
@ -16,26 +16,30 @@ consecutive multirow at end of row (1\sphinxhyphen{}4 and 1\sphinxhyphen{}5)
\hline \hline
\sphinxmultirow{3}{1}{% \sphinxmultirow{3}{1}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}} \begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
&\sphinxmultirow{3}{2}{% &\sphinxmultirow{3}{2}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}} \begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
& &\hskip0pt\relax
cell1\sphinxhyphen{}3 cell1\sphinxhyphen{}3
&\sphinxmultirow{3}{4}{% &\sphinxmultirow{3}{4}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}} \begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
\hskip0pt\relax
cell1\sphinxhyphen{}4 cell1\sphinxhyphen{}4
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
&\sphinxmultirow{2}{5}{% &\sphinxmultirow{2}{5}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}} \begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
\hskip0pt\relax
cell1\sphinxhyphen{}5 cell1\sphinxhyphen{}5
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
@ -43,12 +47,13 @@ cell1\sphinxhyphen{}5
\\ \\
\cline{3-3}\sphinxtablestrut{1}&\sphinxtablestrut{2}&\sphinxmultirow{2}{6}{% \cline{3-3}\sphinxtablestrut{1}&\sphinxtablestrut{2}&\sphinxmultirow{2}{6}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}} \begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
\hskip0pt\relax
cell2\sphinxhyphen{}3 cell2\sphinxhyphen{}3
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
&\sphinxtablestrut{4}&\sphinxtablestrut{5}\\ &\sphinxtablestrut{4}&\sphinxtablestrut{5}\\
\cline{5-5}\sphinxtablestrut{1}&\sphinxtablestrut{2}&\sphinxtablestrut{6}&\sphinxtablestrut{4}& \cline{5-5}\sphinxtablestrut{1}&\sphinxtablestrut{2}&\sphinxtablestrut{6}&\sphinxtablestrut{4}&\hskip0pt\relax
cell3\sphinxhyphen{}5 cell3\sphinxhyphen{}5
\\ \\
\hline \hline

View File

@ -4,47 +4,51 @@
\centering \centering
\begin{tabulary}{\linewidth}[t]{|T|T|T|} \begin{tabulary}{\linewidth}[t]{|T|T|T|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header3 header3
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
&\sphinxmultirow{2}{5}{% &\sphinxmultirow{2}{5}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{3}} \begin{varwidth}[t]{\sphinxcolwidth{1}{3}}
\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
& &\hskip0pt\relax
cell1\sphinxhyphen{}3 cell1\sphinxhyphen{}3
\\ \\
\cline{1-1}\cline{3-3}\sphinxmultirow{2}{7}{% \cline{1-1}\cline{3-3}\sphinxmultirow{2}{7}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{3}} \begin{varwidth}[t]{\sphinxcolwidth{1}{3}}
\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
&\sphinxtablestrut{5}& &\sphinxtablestrut{5}&\hskip0pt\relax
cell2\sphinxhyphen{}3 cell2\sphinxhyphen{}3
\\ \\
\cline{2-3}\sphinxtablestrut{7}&\sphinxstartmulticolumn{2}% \cline{2-3}\sphinxtablestrut{7}&\sphinxstartmulticolumn{2}%
\sphinxmultirow{2}{9}{% \sphinxmultirow{2}{9}{%
\begin{varwidth}[t]{\sphinxcolwidth{2}{3}} \begin{varwidth}[t]{\sphinxcolwidth{2}{3}}
\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}% }%
\sphinxstopmulticolumn \sphinxstopmulticolumn
\\ \\
\cline{1-1} \cline{1-1}\hskip0pt\relax
cell4\sphinxhyphen{}1 cell4\sphinxhyphen{}1
&\multicolumn{2}{l|}{\sphinxtablestrut{9}}\\ &\multicolumn{2}{l|}{\sphinxtablestrut{9}}\\
\hline\sphinxstartmulticolumn{3}% \hline\sphinxstartmulticolumn{3}%
\begin{varwidth}[t]{\sphinxcolwidth{3}{3}} \begin{varwidth}[t]{\sphinxcolwidth{3}{3}}
\hskip0pt\relax
cell5\sphinxhyphen{}1 cell5\sphinxhyphen{}1
\par \par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}% \vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|l|l|} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|l|l|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -26,19 +26,19 @@ header2
\endfoot \endfoot
\endlastfoot \endlastfoot
\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[r]{|l|l|} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[r]{|l|l|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -26,19 +26,19 @@ header2
\endfoot \endfoot
\endlastfoot \endlastfoot
\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,9 +4,9 @@
\sphinxthelongtablecaptionisattop \sphinxthelongtablecaptionisattop
\caption{caption for longtable\strut}\label{\detokenize{longtable:id1}}\\*[\sphinxlongtablecapskipadjust] \caption{caption for longtable\strut}\label{\detokenize{longtable:id1}}\\*[\sphinxlongtablecapskipadjust]
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -15,9 +15,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -28,19 +28,19 @@ header2
\endfoot \endfoot
\endlastfoot \endlastfoot
\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|*{2}{\X{1}{2}|}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|*{2}{\X{1}{2}|}}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -27,24 +27,24 @@ header2
\endlastfoot \endlastfoot
\begin{itemize} \begin{itemize}
\item {} \item {} \hskip0pt\relax
item1 item1
\item {} \item {} \hskip0pt\relax
item2 item2
\end{itemize} \end{itemize}
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -2,11 +2,11 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|*{3}{\X{1}{3}|}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|*{3}{\X{1}{3}|}}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header3 header3
\\ \\
\hline \hline
@ -15,11 +15,11 @@ header3
\multicolumn{3}{c}% \multicolumn{3}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header3 header3
\\ \\
\hline \hline
@ -31,23 +31,23 @@ header3
\endlastfoot \endlastfoot
\sphinxstyletheadfamily \begin{itemize} \sphinxstyletheadfamily \begin{itemize}
\item {} \item {} \hskip0pt\relax
instub1\sphinxhyphen{}1a instub1\sphinxhyphen{}1a
\item {} \item {} \hskip0pt\relax
instub1\sphinxhyphen{}1b instub1\sphinxhyphen{}1b
\end{itemize} \end{itemize}
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
instub1\sphinxhyphen{}2 instub1\sphinxhyphen{}2
& &\hskip0pt\relax
notinstub1\sphinxhyphen{}3 notinstub1\sphinxhyphen{}3
\\ \\
\hline\sphinxstyletheadfamily \hline\sphinxstyletheadfamily \hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
& &\hskip0pt\relax
cell2\sphinxhyphen{}3 cell2\sphinxhyphen{}3
\\ \\
\hline \hline

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|*{2}{\X{1}{2}|}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|*{2}{\X{1}{2}|}}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -30,17 +30,17 @@ header2
\begin{sphinxVerbatimintable}[commandchars=\\\{\}] \begin{sphinxVerbatimintable}[commandchars=\\\{\}]
\PYG{n}{hello} \PYG{n}{world} \PYG{n}{hello} \PYG{n}{world}
\end{sphinxVerbatimintable} \end{sphinxVerbatimintable}
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|\X{30}{100}|\X{70}{100}|} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|\X{30}{100}|\X{70}{100}|}
\hline\noalign{\phantomsection\label{\detokenize{longtable:namedlongtable}}\label{\detokenize{longtable:mylongtable}}}% \hline\noalign{\phantomsection\label{\detokenize{longtable:namedlongtable}}\label{\detokenize{longtable:mylongtable}}}%
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -26,22 +26,22 @@ header2
\endfoot \endfoot
\endlastfoot \endlastfoot
\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline
\end{longtable}\sphinxatlongtableend\end{savenotes} \end{longtable}\sphinxatlongtableend\end{savenotes}
\hskip0pt\relax
See {\hyperref[\detokenize{longtable:mylongtable}]{\sphinxcrossref{mylongtable}}}, same as {\hyperref[\detokenize{longtable:namedlongtable}]{\sphinxcrossref{\DUrole{std,std-ref}{this one}}}}. See {\hyperref[\detokenize{longtable:mylongtable}]{\sphinxcrossref{mylongtable}}}, same as {\hyperref[\detokenize{longtable:namedlongtable}]{\sphinxcrossref{\DUrole{std,std-ref}{this one}}}}.

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|\X{30}{100}|\X{70}{100}|} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|\X{30}{100}|\X{70}{100}|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -27,24 +27,24 @@ header2
\endlastfoot \endlastfoot
\begin{itemize} \begin{itemize}
\item {} \item {} \hskip0pt\relax
item1 item1
\item {} \item {} \hskip0pt\relax
item2 item2
\end{itemize} \end{itemize}
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -2,9 +2,9 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|c|c|} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|c|c|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -13,9 +13,9 @@ header2
\multicolumn{2}{c}% \multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\ {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
@ -26,19 +26,19 @@ header2
\endfoot \endfoot
\endlastfoot \endlastfoot
\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,24 +4,24 @@
\centering \centering
\begin{tabulary}{\linewidth}[t]{|T|T|} \begin{tabulary}{\linewidth}[t]{|T|T|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -8,24 +8,24 @@
\sphinxaftertopcaption \sphinxaftertopcaption
\begin{tabulary}{\linewidth}[t]{|T|T|} \begin{tabulary}{\linewidth}[t]{|T|T|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,30 +4,30 @@
\centering \centering
\begin{tabular}[t]{|*{2}{\X{1}{2}|}} \begin{tabular}[t]{|*{2}{\X{1}{2}|}}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline\begin{itemize} \hline\begin{itemize}
\item {} \item {} \hskip0pt\relax
item1 item1
\item {} \item {} \hskip0pt\relax
item2 item2
\end{itemize} \end{itemize}
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,31 +4,31 @@
\centering \centering
\begin{tabular}[t]{|*{3}{\X{1}{3}|}} \begin{tabular}[t]{|*{3}{\X{1}{3}|}}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header3 header3
\\ \\
\hline\sphinxstyletheadfamily \begin{itemize} \hline\sphinxstyletheadfamily \begin{itemize}
\item {} \item {} \hskip0pt\relax
instub1\sphinxhyphen{}1a instub1\sphinxhyphen{}1a
\item {} \item {} \hskip0pt\relax
instub1\sphinxhyphen{}1b instub1\sphinxhyphen{}1b
\end{itemize} \end{itemize}
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
instub1\sphinxhyphen{}2 instub1\sphinxhyphen{}2
& &\hskip0pt\relax
notinstub1\sphinxhyphen{}3 notinstub1\sphinxhyphen{}3
\\ \\
\hline\sphinxstyletheadfamily \hline\sphinxstyletheadfamily \hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
& &\hskip0pt\relax
cell2\sphinxhyphen{}3 cell2\sphinxhyphen{}3
\\ \\
\hline \hline

View File

@ -4,14 +4,14 @@
\centering \centering
\begin{tabulary}{\linewidth}[t]{|T|} \begin{tabulary}{\linewidth}[t]{|T|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1\sphinxhyphen{}par1 cell1\sphinxhyphen{}1\sphinxhyphen{}par1
\hskip0pt\relax
cell1\sphinxhyphen{}1\sphinxhyphen{}par2 cell1\sphinxhyphen{}1\sphinxhyphen{}par2
\hskip0pt\relax
cell1\sphinxhyphen{}1\sphinxhyphen{}par3 cell1\sphinxhyphen{}1\sphinxhyphen{}par3
\\ \\
\hline \hline

View File

@ -4,26 +4,26 @@
\centering \centering
\begin{tabular}[t]{|*{2}{\X{1}{2}|}} \begin{tabular}[t]{|*{2}{\X{1}{2}|}}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline
\begin{sphinxVerbatimintable}[commandchars=\\\{\}] \begin{sphinxVerbatimintable}[commandchars=\\\{\}]
\PYG{n}{hello} \PYG{n}{world} \PYG{n}{hello} \PYG{n}{world}
\end{sphinxVerbatimintable} \end{sphinxVerbatimintable}
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -5,29 +5,29 @@
\phantomsection\label{\detokenize{tabular:namedtabular}}\label{\detokenize{tabular:mytabular}}\nobreak \phantomsection\label{\detokenize{tabular:namedtabular}}\label{\detokenize{tabular:mytabular}}\nobreak
\begin{tabular}[t]{|\X{30}{100}|\X{70}{100}|} \begin{tabular}[t]{|\X{30}{100}|\X{70}{100}|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline
\end{tabular} \end{tabular}
\par \par
\sphinxattableend\end{savenotes} \sphinxattableend\end{savenotes}
\hskip0pt\relax
See {\hyperref[\detokenize{tabular:mytabular}]{\sphinxcrossref{\DUrole{std,std-ref}{this}}}}, same as {\hyperref[\detokenize{tabular:namedtabular}]{\sphinxcrossref{namedtabular}}}. See {\hyperref[\detokenize{tabular:mytabular}]{\sphinxcrossref{\DUrole{std,std-ref}{this}}}}, same as {\hyperref[\detokenize{tabular:namedtabular}]{\sphinxcrossref{namedtabular}}}.

View File

@ -4,30 +4,30 @@
\centering \centering
\begin{tabular}[t]{|\X{30}{100}|\X{70}{100}|} \begin{tabular}[t]{|\X{30}{100}|\X{70}{100}|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline\begin{itemize} \hline\begin{itemize}
\item {} \item {} \hskip0pt\relax
item1 item1
\item {} \item {} \hskip0pt\relax
item2 item2
\end{itemize} \end{itemize}
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,24 +4,24 @@
\raggedright \raggedright
\begin{tabular}[t]{|\X{30}{100}|\X{70}{100}|} \begin{tabular}[t]{|\X{30}{100}|\X{70}{100}|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,24 +4,24 @@
\centering \centering
\begin{tabulary}{\linewidth}[t]{|c|c|} \begin{tabulary}{\linewidth}[t]{|c|c|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -4,24 +4,24 @@
\raggedleft \raggedleft
\begin{tabulary}{\linewidth}[t]{|T|T|} \begin{tabulary}{\linewidth}[t]{|T|T|}
\hline \hline
\sphinxstyletheadfamily \sphinxstyletheadfamily \hskip0pt\relax
header1 header1
&\sphinxstyletheadfamily &\sphinxstyletheadfamily \hskip0pt\relax
header2 header2
\\ \\
\hline \hline\hskip0pt\relax
cell1\sphinxhyphen{}1 cell1\sphinxhyphen{}1
& &\hskip0pt\relax
cell1\sphinxhyphen{}2 cell1\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell2\sphinxhyphen{}1 cell2\sphinxhyphen{}1
& &\hskip0pt\relax
cell2\sphinxhyphen{}2 cell2\sphinxhyphen{}2
\\ \\
\hline \hline\hskip0pt\relax
cell3\sphinxhyphen{}1 cell3\sphinxhyphen{}1
& &\hskip0pt\relax
cell3\sphinxhyphen{}2 cell3\sphinxhyphen{}2
\\ \\
\hline \hline

View File

@ -730,13 +730,14 @@ def test_footnote(app, status, warning):
'\\end{footnote}') in result '\\end{footnote}') in result
assert '\\begin{footnote}[3]\\sphinxAtStartFootnote\nnamed\n%\n\\end{footnote}' in result assert '\\begin{footnote}[3]\\sphinxAtStartFootnote\nnamed\n%\n\\end{footnote}' in result
assert '\\sphinxcite{footnote:bar}' in result assert '\\sphinxcite{footnote:bar}' in result
assert ('\\bibitem[bar]{footnote:bar}\ncite\n') in result assert ('\\bibitem[bar]{footnote:bar}\\hskip0pt\\relax\ncite\n') in result
assert '\\sphinxcaption{Table caption \\sphinxfootnotemark[4]' in result assert '\\sphinxcaption{Table caption \\sphinxfootnotemark[4]' in result
assert ('\\hline%\n\\begin{footnotetext}[4]\\sphinxAtStartFootnote\n' assert ('\\hline%\n\\begin{footnotetext}[4]\\sphinxAtStartFootnote\n'
'footnote in table caption\n%\n\\end{footnotetext}\\ignorespaces %\n' 'footnote in table caption\n%\n\\end{footnotetext}\\ignorespaces %\n'
'\\begin{footnotetext}[5]\\sphinxAtStartFootnote\n' '\\begin{footnotetext}[5]\\sphinxAtStartFootnote\n'
'footnote in table header\n%\n\\end{footnotetext}\\ignorespaces \n' 'footnote in table header\n%\n\\end{footnotetext}\\ignorespaces '
'VIDIOC\\_CROPCAP\n&\n') in result '\\hskip0pt\\relax\n'
'VIDIOC\\_CROPCAP\n&\\hskip0pt\\relax\n') in result
assert ('Information about VIDIOC\\_CROPCAP %\n' assert ('Information about VIDIOC\\_CROPCAP %\n'
'\\begin{footnote}[6]\\sphinxAtStartFootnote\n' '\\begin{footnote}[6]\\sphinxAtStartFootnote\n'
'footnote in table not in header\n%\n\\end{footnote}\n\\\\\n\\hline\n' 'footnote in table not in header\n%\n\\end{footnote}\n\\\\\n\\hline\n'
@ -776,7 +777,7 @@ def test_reference_in_caption_and_codeblock_in_footnote(app, status, warning):
assert ('This is a reference to the code\\sphinxhyphen{}block in the footnote:\n' assert ('This is a reference to the code\\sphinxhyphen{}block in the footnote:\n'
'{\\hyperref[\\detokenize{index:codeblockinfootnote}]' '{\\hyperref[\\detokenize{index:codeblockinfootnote}]'
'{\\sphinxcrossref{\\DUrole{std,std-ref}{I am in a footnote}}}}') in result '{\\sphinxcrossref{\\DUrole{std,std-ref}{I am in a footnote}}}}') in result
assert ('&\nThis is one more footnote with some code in it %\n' assert ('&\\hskip0pt\\relax\nThis is one more footnote with some code in it %\n'
'\\begin{footnote}[11]\\sphinxAtStartFootnote\n' '\\begin{footnote}[11]\\sphinxAtStartFootnote\n'
'Third footnote in longtable\n') in result 'Third footnote in longtable\n') in result
assert ('\\end{sphinxVerbatim}\n%\n\\end{footnote}.\n') in result assert ('\\end{sphinxVerbatim}\n%\n\\end{footnote}.\n') in result
@ -816,13 +817,15 @@ def test_latex_show_urls_is_inline(app, status, warning):
assert ('\\sphinxhref{http://sphinx-doc.org/~test/}{URL including tilde} ' assert ('\\sphinxhref{http://sphinx-doc.org/~test/}{URL including tilde} '
'(http://sphinx\\sphinxhyphen{}doc.org/\\textasciitilde{}test/)') in result '(http://sphinx\\sphinxhyphen{}doc.org/\\textasciitilde{}test/)') in result
assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{URL in term} ' assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{URL in term} '
'(http://sphinx\\sphinxhyphen{}doc.org/)}] \\leavevmode\nDescription' in result) '(http://sphinx\\sphinxhyphen{}doc.org/)}] '
'\\leavevmode\\hskip0pt\\relax\nDescription' in result)
assert ('\\item[{Footnote in term \\sphinxfootnotemark[6]}] ' assert ('\\item[{Footnote in term \\sphinxfootnotemark[6]}] '
'\\leavevmode%\n\\begin{footnotetext}[6]\\sphinxAtStartFootnote\n' '\\leavevmode%\n\\begin{footnotetext}[6]\\sphinxAtStartFootnote\n'
'Footnote in term\n%\n\\end{footnotetext}\\ignorespaces \n' 'Footnote in term\n%\n\\end{footnotetext}\\ignorespaces '
'Description') in result '\\hskip0pt\\relax\nDescription') in result
assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{Term in deflist} ' assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{Term in deflist} '
'(http://sphinx\\sphinxhyphen{}doc.org/)}] \\leavevmode\nDescription') in result '(http://sphinx\\sphinxhyphen{}doc.org/)}] '
'\\leavevmode\\hskip0pt\\relax\nDescription') in result
assert '\\sphinxurl{https://github.com/sphinx-doc/sphinx}\n' in result assert '\\sphinxurl{https://github.com/sphinx-doc/sphinx}\n' in result
assert ('\\sphinxhref{mailto:sphinx-dev@googlegroups.com}' assert ('\\sphinxhref{mailto:sphinx-dev@googlegroups.com}'
'{sphinx\\sphinxhyphen{}dev@googlegroups.com}') in result '{sphinx\\sphinxhyphen{}dev@googlegroups.com}') in result
@ -867,16 +870,16 @@ def test_latex_show_urls_is_footnote(app, status, warning):
'{URL in term}\\sphinxfootnotemark[9]}] ' '{URL in term}\\sphinxfootnotemark[9]}] '
'\\leavevmode%\n\\begin{footnotetext}[9]\\sphinxAtStartFootnote\n' '\\leavevmode%\n\\begin{footnotetext}[9]\\sphinxAtStartFootnote\n'
'\\sphinxnolinkurl{http://sphinx-doc.org/}\n%\n' '\\sphinxnolinkurl{http://sphinx-doc.org/}\n%\n'
'\\end{footnotetext}\\ignorespaces \nDescription') in result '\\end{footnotetext}\\ignorespaces \\hskip0pt\\relax\nDescription') in result
assert ('\\item[{Footnote in term \\sphinxfootnotemark[11]}] ' assert ('\\item[{Footnote in term \\sphinxfootnotemark[11]}] '
'\\leavevmode%\n\\begin{footnotetext}[11]\\sphinxAtStartFootnote\n' '\\leavevmode%\n\\begin{footnotetext}[11]\\sphinxAtStartFootnote\n'
'Footnote in term\n%\n\\end{footnotetext}\\ignorespaces \n' 'Footnote in term\n%\n\\end{footnotetext}\\ignorespaces '
'Description') in result '\\hskip0pt\\relax\nDescription') in result
assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{Term in deflist}' assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{Term in deflist}'
'\\sphinxfootnotemark[10]}] ' '\\sphinxfootnotemark[10]}] '
'\\leavevmode%\n\\begin{footnotetext}[10]\\sphinxAtStartFootnote\n' '\\leavevmode%\n\\begin{footnotetext}[10]\\sphinxAtStartFootnote\n'
'\\sphinxnolinkurl{http://sphinx-doc.org/}\n%\n' '\\sphinxnolinkurl{http://sphinx-doc.org/}\n%\n'
'\\end{footnotetext}\\ignorespaces \nDescription') in result '\\end{footnotetext}\\ignorespaces \\hskip0pt\\relax\nDescription') in result
assert ('\\sphinxurl{https://github.com/sphinx-doc/sphinx}\n' in result) assert ('\\sphinxurl{https://github.com/sphinx-doc/sphinx}\n' in result)
assert ('\\sphinxhref{mailto:sphinx-dev@googlegroups.com}' assert ('\\sphinxhref{mailto:sphinx-dev@googlegroups.com}'
'{sphinx\\sphinxhyphen{}dev@googlegroups.com}\n') in result '{sphinx\\sphinxhyphen{}dev@googlegroups.com}\n') in result
@ -913,13 +916,13 @@ def test_latex_show_urls_is_no(app, status, warning):
'Footnote inside footnote\n%\n\\end{footnotetext}\\ignorespaces') in result 'Footnote inside footnote\n%\n\\end{footnotetext}\\ignorespaces') in result
assert '\\sphinxhref{http://sphinx-doc.org/~test/}{URL including tilde}' in result assert '\\sphinxhref{http://sphinx-doc.org/~test/}{URL including tilde}' in result
assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{URL in term}}] ' assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{URL in term}}] '
'\\leavevmode\nDescription') in result '\\leavevmode\\hskip0pt\\relax\nDescription') in result
assert ('\\item[{Footnote in term \\sphinxfootnotemark[6]}] ' assert ('\\item[{Footnote in term \\sphinxfootnotemark[6]}] '
'\\leavevmode%\n\\begin{footnotetext}[6]\\sphinxAtStartFootnote\n' '\\leavevmode%\n\\begin{footnotetext}[6]\\sphinxAtStartFootnote\n'
'Footnote in term\n%\n\\end{footnotetext}\\ignorespaces \n' 'Footnote in term\n%\n\\end{footnotetext}\\ignorespaces '
'Description') in result '\\hskip0pt\\relax\nDescription') in result
assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{Term in deflist}}] ' assert ('\\item[{\\sphinxhref{http://sphinx-doc.org/}{Term in deflist}}] '
'\\leavevmode\nDescription') in result '\\leavevmode\\hskip0pt\\relax\nDescription') in result
assert ('\\sphinxurl{https://github.com/sphinx-doc/sphinx}\n' in result) assert ('\\sphinxurl{https://github.com/sphinx-doc/sphinx}\n' in result)
assert ('\\sphinxhref{mailto:sphinx-dev@googlegroups.com}' assert ('\\sphinxhref{mailto:sphinx-dev@googlegroups.com}'
'{sphinx\\sphinxhyphen{}dev@googlegroups.com}\n') in result '{sphinx\\sphinxhyphen{}dev@googlegroups.com}\n') in result
@ -1354,7 +1357,7 @@ def test_latex_index(app, status, warning):
'\\index{equation@\\spxentry{equation}}equation:\n' in result) '\\index{equation@\\spxentry{equation}}equation:\n' in result)
assert ('\n\\index{Einstein@\\spxentry{Einstein}}' assert ('\n\\index{Einstein@\\spxentry{Einstein}}'
'\\index{relativity@\\spxentry{relativity}}' '\\index{relativity@\\spxentry{relativity}}'
'\\ignorespaces \nand') in result '\\ignorespaces \\hskip0pt\\relax\nand') in result
assert ('\n\\index{main \\sphinxleftcurlybrace{}@\\spxentry{' assert ('\n\\index{main \\sphinxleftcurlybrace{}@\\spxentry{'
'main \\sphinxleftcurlybrace{}}}\\ignorespaces ' in result) 'main \\sphinxleftcurlybrace{}}}\\ignorespaces ' in result)
@ -1403,7 +1406,7 @@ def test_latex_thebibliography(app, status, warning):
result = (app.outdir / 'python.tex').read_text() result = (app.outdir / 'python.tex').read_text()
print(result) print(result)
assert ('\\begin{sphinxthebibliography}{AuthorYe}\n' assert ('\\begin{sphinxthebibliography}{AuthorYe}\n'
'\\bibitem[AuthorYear]{index:authoryear}\n' '\\bibitem[AuthorYear]{index:authoryear}\\hskip0pt\\relax\n'
'Author, Title, Year\n' 'Author, Title, Year\n'
'\\end{sphinxthebibliography}\n' in result) '\\end{sphinxthebibliography}\n' in result)
assert '\\sphinxcite{index:authoryear}' in result assert '\\sphinxcite{index:authoryear}' in result
@ -1447,7 +1450,8 @@ def test_latex_labels(app, status, warning):
r'\end{figure}' in result) r'\end{figure}' in result)
assert (r'\caption{labeled figure}' assert (r'\caption{labeled figure}'
'\\label{\\detokenize{index:figure3}}\n' '\\label{\\detokenize{index:figure3}}\n'
'\\begin{sphinxlegend}\nwith a legend\n\\end{sphinxlegend}\n' '\\begin{sphinxlegend}\\hskip0pt\\relax\n'
'with a legend\n\\end{sphinxlegend}\n'
r'\end{figure}' in result) r'\end{figure}' in result)
# code-blocks # code-blocks

View File

@ -158,7 +158,8 @@ def get_verifier(verify, verify_re):
':pep:`8`', ':pep:`8`',
('<p><span class="target" id="index-0"></span><a class="pep reference external" ' ('<p><span class="target" id="index-0"></span><a class="pep reference external" '
'href="http://www.python.org/dev/peps/pep-0008"><strong>PEP 8</strong></a></p>'), 'href="http://www.python.org/dev/peps/pep-0008"><strong>PEP 8</strong></a></p>'),
('\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}' ('\\hskip0pt\\relax\n'
'\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}'
'!PEP 8@\\spxentry{PEP 8}}\\sphinxhref{http://www.python.org/dev/peps/pep-0008}' '!PEP 8@\\spxentry{PEP 8}}\\sphinxhref{http://www.python.org/dev/peps/pep-0008}'
'{\\sphinxstylestrong{PEP 8}}') '{\\sphinxstylestrong{PEP 8}}')
), ),
@ -169,7 +170,8 @@ def get_verifier(verify, verify_re):
('<p><span class="target" id="index-0"></span><a class="pep reference external" ' ('<p><span class="target" id="index-0"></span><a class="pep reference external" '
'href="http://www.python.org/dev/peps/pep-0008#id1">' 'href="http://www.python.org/dev/peps/pep-0008#id1">'
'<strong>PEP 8#id1</strong></a></p>'), '<strong>PEP 8#id1</strong></a></p>'),
('\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}' ('\\hskip0pt\\relax\n'
'\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}'
'!PEP 8\\#id1@\\spxentry{PEP 8\\#id1}}\\sphinxhref' '!PEP 8\\#id1@\\spxentry{PEP 8\\#id1}}\\sphinxhref'
'{http://www.python.org/dev/peps/pep-0008\\#id1}' '{http://www.python.org/dev/peps/pep-0008\\#id1}'
'{\\sphinxstylestrong{PEP 8\\#id1}}') '{\\sphinxstylestrong{PEP 8\\#id1}}')
@ -180,7 +182,8 @@ def get_verifier(verify, verify_re):
':rfc:`2324`', ':rfc:`2324`',
('<p><span class="target" id="index-0"></span><a class="rfc reference external" ' ('<p><span class="target" id="index-0"></span><a class="rfc reference external" '
'href="http://tools.ietf.org/html/rfc2324.html"><strong>RFC 2324</strong></a></p>'), 'href="http://tools.ietf.org/html/rfc2324.html"><strong>RFC 2324</strong></a></p>'),
('\\index{RFC@\\spxentry{RFC}!RFC 2324@\\spxentry{RFC 2324}}' ('\\hskip0pt\\relax\n'
'\\index{RFC@\\spxentry{RFC}!RFC 2324@\\spxentry{RFC 2324}}'
'\\sphinxhref{http://tools.ietf.org/html/rfc2324.html}' '\\sphinxhref{http://tools.ietf.org/html/rfc2324.html}'
'{\\sphinxstylestrong{RFC 2324}}') '{\\sphinxstylestrong{RFC 2324}}')
), ),
@ -191,7 +194,8 @@ def get_verifier(verify, verify_re):
('<p><span class="target" id="index-0"></span><a class="rfc reference external" ' ('<p><span class="target" id="index-0"></span><a class="rfc reference external" '
'href="http://tools.ietf.org/html/rfc2324.html#id1">' 'href="http://tools.ietf.org/html/rfc2324.html#id1">'
'<strong>RFC 2324#id1</strong></a></p>'), '<strong>RFC 2324#id1</strong></a></p>'),
('\\index{RFC@\\spxentry{RFC}!RFC 2324\\#id1@\\spxentry{RFC 2324\\#id1}}' ('\\hskip0pt\\relax\n'
'\\index{RFC@\\spxentry{RFC}!RFC 2324\\#id1@\\spxentry{RFC 2324\\#id1}}'
'\\sphinxhref{http://tools.ietf.org/html/rfc2324.html\\#id1}' '\\sphinxhref{http://tools.ietf.org/html/rfc2324.html\\#id1}'
'{\\sphinxstylestrong{RFC 2324\\#id1}}') '{\\sphinxstylestrong{RFC 2324\\#id1}}')
), ),
@ -201,14 +205,14 @@ def get_verifier(verify, verify_re):
'``code sample``', '``code sample``',
('<p><code class="(samp )?docutils literal notranslate"><span class="pre">' ('<p><code class="(samp )?docutils literal notranslate"><span class="pre">'
'code</span>&#160;&#160; <span class="pre">sample</span></code></p>'), 'code</span>&#160;&#160; <span class="pre">sample</span></code></p>'),
r'\\sphinxcode{\\sphinxupquote{code sample}}', r'\\hskip0pt\\relax\n\\sphinxcode{\\sphinxupquote{code sample}}',
), ),
( (
# interpolation of arrows in menuselection # interpolation of arrows in menuselection
'verify', 'verify',
':menuselection:`a --> b`', ':menuselection:`a --> b`',
('<p><span class="menuselection">a \N{TRIANGULAR BULLET} b</span></p>'), ('<p><span class="menuselection">a \N{TRIANGULAR BULLET} b</span></p>'),
'\\sphinxmenuselection{a \\(\\rightarrow\\) b}', '\\hskip0pt\\relax\n\\sphinxmenuselection{a \\(\\rightarrow\\) b}',
), ),
( (
# interpolation of ampersands in menuselection # interpolation of ampersands in menuselection
@ -216,7 +220,9 @@ def get_verifier(verify, verify_re):
':menuselection:`&Foo -&&- &Bar`', ':menuselection:`&Foo -&&- &Bar`',
('<p><span class="menuselection"><span class="accelerator">F</span>oo ' ('<p><span class="menuselection"><span class="accelerator">F</span>oo '
'-&amp;- <span class="accelerator">B</span>ar</span></p>'), '-&amp;- <span class="accelerator">B</span>ar</span></p>'),
r'\sphinxmenuselection{\sphinxaccelerator{F}oo \sphinxhyphen{}\&\sphinxhyphen{} \sphinxaccelerator{B}ar}', ('\\hskip0pt\\relax\n'
r'\sphinxmenuselection{\sphinxaccelerator{F}oo \sphinxhyphen{}'
r'\&\sphinxhyphen{} \sphinxaccelerator{B}ar}'),
), ),
( (
# interpolation of ampersands in guilabel # interpolation of ampersands in guilabel
@ -224,21 +230,22 @@ def get_verifier(verify, verify_re):
':guilabel:`&Foo -&&- &Bar`', ':guilabel:`&Foo -&&- &Bar`',
('<p><span class="guilabel"><span class="accelerator">F</span>oo ' ('<p><span class="guilabel"><span class="accelerator">F</span>oo '
'-&amp;- <span class="accelerator">B</span>ar</span></p>'), '-&amp;- <span class="accelerator">B</span>ar</span></p>'),
r'\sphinxguilabel{\sphinxaccelerator{F}oo \sphinxhyphen{}\&\sphinxhyphen{} \sphinxaccelerator{B}ar}', ('\\hskip0pt\\relax\n'
r'\sphinxguilabel{\sphinxaccelerator{F}oo \sphinxhyphen{}\&\sphinxhyphen{} \sphinxaccelerator{B}ar}'),
), ),
( (
# no ampersands in guilabel # no ampersands in guilabel
'verify', 'verify',
':guilabel:`Foo`', ':guilabel:`Foo`',
'<p><span class="guilabel">Foo</span></p>', '<p><span class="guilabel">Foo</span></p>',
r'\sphinxguilabel{Foo}', '\\hskip0pt\\relax\n\\sphinxguilabel{Foo}',
), ),
( (
# kbd role # kbd role
'verify', 'verify',
':kbd:`space`', ':kbd:`space`',
'<p><kbd class="kbd docutils literal notranslate">space</kbd></p>', '<p><kbd class="kbd docutils literal notranslate">space</kbd></p>',
'\\sphinxkeyboard{\\sphinxupquote{space}}', '\\hskip0pt\\relax\n\\sphinxkeyboard{\\sphinxupquote{space}}',
), ),
( (
# kbd role # kbd role
@ -249,7 +256,7 @@ def get_verifier(verify, verify_re):
'+' '+'
'<kbd class="kbd docutils literal notranslate">X</kbd>' '<kbd class="kbd docutils literal notranslate">X</kbd>'
'</kbd></p>'), '</kbd></p>'),
'\\sphinxkeyboard{\\sphinxupquote{Control+X}}', '\\hskip0pt\\relax\n\\sphinxkeyboard{\\sphinxupquote{Control+X}}',
), ),
( (
# kbd role # kbd role
@ -260,7 +267,8 @@ def get_verifier(verify, verify_re):
'+' '+'
'<kbd class="kbd docutils literal notranslate">^</kbd>' '<kbd class="kbd docutils literal notranslate">^</kbd>'
'</kbd></p>'), '</kbd></p>'),
'\\sphinxkeyboard{\\sphinxupquote{Alt+\\textasciicircum{}}}', ('\\hskip0pt\\relax\n'
'\\sphinxkeyboard{\\sphinxupquote{Alt+\\textasciicircum{}}}'),
), ),
( (
# kbd role # kbd role
@ -275,21 +283,24 @@ def get_verifier(verify, verify_re):
'-' '-'
'<kbd class="kbd docutils literal notranslate">s</kbd>' '<kbd class="kbd docutils literal notranslate">s</kbd>'
'</kbd></p>'), '</kbd></p>'),
'\\sphinxkeyboard{\\sphinxupquote{M\\sphinxhyphen{}x M\\sphinxhyphen{}s}}', ('\\hskip0pt\\relax\n'
'\\sphinxkeyboard{\\sphinxupquote{M\\sphinxhyphen{}x M\\sphinxhyphen{}s}}'),
), ),
( (
# kbd role # kbd role
'verify', 'verify',
':kbd:`-`', ':kbd:`-`',
'<p><kbd class="kbd docutils literal notranslate">-</kbd></p>', '<p><kbd class="kbd docutils literal notranslate">-</kbd></p>',
'\\sphinxkeyboard{\\sphinxupquote{\\sphinxhyphen{}}}', ('\\hskip0pt\\relax\n'
'\\sphinxkeyboard{\\sphinxupquote{\\sphinxhyphen{}}}'),
), ),
( (
# kbd role # kbd role
'verify', 'verify',
':kbd:`Caps Lock`', ':kbd:`Caps Lock`',
'<p><kbd class="kbd docutils literal notranslate">Caps Lock</kbd></p>', '<p><kbd class="kbd docutils literal notranslate">Caps Lock</kbd></p>',
'\\sphinxkeyboard{\\sphinxupquote{Caps Lock}}', ('\\hskip0pt\\relax\n'
'\\sphinxkeyboard{\\sphinxupquote{Caps Lock}}'),
), ),
( (
# non-interpolation of dashes in option role # non-interpolation of dashes in option role
@ -297,14 +308,15 @@ def get_verifier(verify, verify_re):
':option:`--with-option`', ':option:`--with-option`',
('<p><code( class="xref std std-option docutils literal notranslate")?>' ('<p><code( class="xref std std-option docutils literal notranslate")?>'
'<span class="pre">--with-option</span></code></p>$'), '<span class="pre">--with-option</span></code></p>$'),
r'\\sphinxcode{\\sphinxupquote{\\sphinxhyphen{}\\sphinxhyphen{}with\\sphinxhyphen{}option}}$', (r'\\hskip0pt\\relax\n'
r'\\sphinxcode{\\sphinxupquote{\\sphinxhyphen{}\\sphinxhyphen{}with\\sphinxhyphen{}option}}$'),
), ),
( (
# verify smarty-pants quotes # verify smarty-pants quotes
'verify', 'verify',
'"John"', '"John"',
'<p>“John”</p>', '<p>“John”</p>',
"“John”", "\\hskip0pt\\relax\n“John”",
), ),
( (
# ... but not in literal text # ... but not in literal text
@ -312,21 +324,21 @@ def get_verifier(verify, verify_re):
'``"John"``', '``"John"``',
('<p><code class="docutils literal notranslate"><span class="pre">' ('<p><code class="docutils literal notranslate"><span class="pre">'
'&quot;John&quot;</span></code></p>'), '&quot;John&quot;</span></code></p>'),
'\\sphinxcode{\\sphinxupquote{"John"}}', '\\hskip0pt\\relax\n\\sphinxcode{\\sphinxupquote{"John"}}',
), ),
( (
# verify classes for inline roles # verify classes for inline roles
'verify', 'verify',
':manpage:`mp(1)`', ':manpage:`mp(1)`',
'<p><em class="manpage">mp(1)</em></p>', '<p><em class="manpage">mp(1)</em></p>',
'\\sphinxstyleliteralemphasis{\\sphinxupquote{mp(1)}}', '\\hskip0pt\\relax\n\\sphinxstyleliteralemphasis{\\sphinxupquote{mp(1)}}',
), ),
( (
# correct escaping in normal mode # correct escaping in normal mode
'verify', 'verify',
'Γ\\\\∞$', 'Γ\\\\∞$',
None, None,
'Γ\\textbackslash{}\\(\\infty\\)\\$', '\\hskip0pt\\relax\nΓ\\textbackslash{}\\(\\infty\\)\\$',
), ),
( (
# in verbatim code fragments # in verbatim code fragments
@ -342,7 +354,7 @@ def get_verifier(verify, verify_re):
'verify_re', 'verify_re',
'`test <https://www.google.com/~me/>`_', '`test <https://www.google.com/~me/>`_',
None, None,
r'\\sphinxhref{https://www.google.com/~me/}{test}.*', r'\\hskip0pt\\relax\n\\sphinxhref{https://www.google.com/~me/}{test}.*',
), ),
( (
# description list: simple # description list: simple