LaTeX forum ⇒ Graphics, Figures & TablesWhat is wrong with this simple tabularx in revtex4 ? Topic is solved

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

What is wrong with this simple tabularx in revtex4 ?

Postby Cham » Mon Nov 27, 2017 11:35 pm

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 :

  1. \RequirePackage[l2tabu,orthodox]{nag}
  2. \documentclass[11pt]{revtex4}
  3. \usepackage[T1]{fontenc}
  4. \usepackage{graphicx}
  5. \usepackage[dvipsnames,table]{xcolor}
  6. \usepackage{tabularx}
  7.  
  8. \begin{document}
  9.  
  10. \section{Introduction}
  11.  
  12. A simple table :
  13. \begin{table}
  14. \renewcommand{\arraystretch}{1.5}
  15. \begin{tabularx}{\textwidth}{|X|X|X|X|X|}
  16. \hline
  17. \rowcolor[gray]{0.95}
  18. \multicolumn{5}{|c|}{\textbf{\textsf{Title}}}
  19. \\ \hline
  20. \multicolumn{1}{|>{\centering}p{6.5em}|}{\textsf{word 1}}
  21. & \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 2}}
  22. & \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 3}}
  23. & \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 4}}
  24. & \multicolumn{1}{>{\centering}p{6.5em}|}{\textsf{word 5}}
  25. \\ \hline
  26. & & & &
  27. \\
  28. & & & &
  29. \\
  30. & & & &
  31. \\ \hline
  32. \end{tabularx}
  33. \end{table}
  34.  
  35. \end{document}


The same tabularx is working great with all the other classes I tested (article, book, etc). So what is wrong with this code ?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8527
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Nov 28, 2017 12:23 am

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
Site admin

User avatar
Cham
Posts: 813
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Tue Nov 28, 2017 12:26 am

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.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 11 guests