Graphics, Figures & TablesWhat is wrong with this simple tabularx in revtex4 ?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with this simple tabularx in revtex4 ?

Post by Cham »

I'm experiencing a major error with this simple code (tabularx with a color, under the revtex4 class), and I don't understand what is happening here :

Code: Select all

Code, edit and compile here:
\RequirePackage[l2tabu,orthodox]{nag}
\documentclass[11pt]{revtex4}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[dvipsnames,table]{xcolor}
\usepackage{tabularx}
\begin{document}
\section{Introduction}
A simple table :
\begin{table}
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\textwidth}{|X|X|X|X|X|}
\hline
\rowcolor[gray]{0.95}
\multicolumn{5}{|c|}{\textbf{\textsf{Title}}}
\\ \hline
\multicolumn{1}{|>{\centering}p{6.5em}|}{\textsf{word 1}}
& \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 2}}
& \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 3}}
& \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 4}}
& \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 5}}
\\ \hline
& & & &
\\
& & & &
\\
& & & &
\\ \hline
\end{tabularx}
\end{table}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The same tabularx is working great with all the other classes I tested (article, book, etc). So what is wrong with this code ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

What is wrong with this simple tabularx in revtex4 ?

Post by Stefan Kottwitz »

Hi Cham,

again, you made a fantastic minimal example, so it's easy to work with it.

That's an issue with revtex4 that I consider as a bug. It is fixed with revtex4-1. Is that ok for you, or would you like to fix it with revtex4?

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with this simple tabularx in revtex4 ?

Post by Cham »

I didn't tried revtex4-1 with this table yet. How to fix it for revtex4 ?

Weird bug !

EDIT : Works much better with revtex4-1.
Post Reply