summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-10-31 22:59:01 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-01-14 22:23:18 +0900
commitc399357f38a081cf5f75e98c9627b80928a1c035 (patch)
tree64e7684c4f3d5dd1af862c940d75ea836824d708
parentf3f829664dce9ed8b236ffdb1d909524096d3b76 (diff)
downloadsphinx-git-c399357f38a081cf5f75e98c9627b80928a1c035.tar.gz
Show a notice if both tabularcolumns and :widths: are given (refs: #4196)
-rw-r--r--doc/markup/misc.rst5
-rw-r--r--sphinx/writers/latex.py3
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/markup/misc.rst b/doc/markup/misc.rst
index 35ed6375d..51e3a405c 100644
--- a/doc/markup/misc.rst
+++ b/doc/markup/misc.rst
@@ -323,6 +323,11 @@ following directive exists:
Sphinx's merged cells interact well with ``p{width}``, ``\X{a}{b}``, ``Y{f}``
and tabulary's columns.
+ .. note::
+
+ :rst:dir:`tabularcolumns` conflicts with ``:widths:`` option of table
+ directives. If both are specified, ``:widths:`` option will be ignored.
+
Math
----
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 6c86e6174..4741de92b 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -1376,6 +1376,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.table = Table(node)
if self.next_table_colspec:
self.table.colspec = '{%s}\n' % self.next_table_colspec
+ if 'colwidths-given' in node.get('classes', []):
+ logger.info('both tabularcolumns and :widths: option are given. '
+ ':widths: is ignored.', location=node)
self.next_table_colspec = None
def depart_table(self, node):