Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sphinx/writers/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ def get_table_type(self) -> str:
elif self.has_verbatim:
return 'tabular'
elif self.colspec:
if any(c in 'LRCJT' for c in self.colspec):
assert len(self.colspec) > 2
_colspec = re.sub(r'\{.*?\}', '', self.colspec[1:-2])
if any(c in 'LRCJT' for c in _colspec):
# tabulary would complain "no suitable columns" if none of its
# column type were used so we ensure at least one matches.
# It is responsability of user to make sure not to use tabulary
Expand Down Expand Up @@ -1212,8 +1214,13 @@ def depart_table(self, node: Element) -> None:
for _ in self.tables[:-1]:
_.has_problematic = True
else:
# We try to catch a tabularcolumns using L, R, J, C, or T.
# We can not simply test for presence in the colspec of
# one of those letters due to syntax such as >{\RaggedRight}.
if self.table.colspec:
if any(c in self.table.colspec for c in 'LRJCT'):
assert len(self.table.colspec) > 2
_colspec = re.sub(r'\{.*?\}', '', self.table.colspec[1:-2])
if any(c in _colspec for c in 'LRJCT'):
logger.warning(
__(
'colspec %s was given which uses '
Expand Down
Loading