I've just updated all packages from CTAN and my articles in RevTeX style stopped compiling. Digging down, I've narrowed it to the use of p column type (and its derivatives), used to make a text-filled table cell with word wrap. This used to compile just fine under RevTeX, but now it generates lots of errors and prevents it from producing output at all.
This seems to be not caused by changes in the current RevTeX 4-2, but by some other package update incompatible with it. I have a legacy RevTeX 4-1 manually installed on my machine, not updated for years and no longer in CTAN. That old style also stopped compiling after the recent package update, with the same bunch of errors.
Here are minimal examples. This one compiles without errors:
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}
\begin{tabular}{p{30mm}}
\hline\hline
This text needs to be wrapped inside the table cell. This text needs to be wrapped inside the table cell. This text needs to be wrapped inside the table cell.\\
\hline\hline
\end{tabular}
\end{table}
\end{document}
This one fails with errors:
\documentclass[aps,pra,twocolumn,showpacs,amsmath,amssymb,preprintnumbers,superscriptaddress,10pt]{revtex4-2}
\usepackage{array}
\begin{document}
\begin{table}
\begin{tabular}{p{30mm}}
\hline\hline
This text needs to be wrapped inside the table cell. This text needs to be wrapped inside the table cell. This text needs to be wrapped inside the table cell.\\
\hline\hline
\end{tabular}
\end{table}
\end{document}
I contacted APS helpline but they were not helpful to track down the cause of the problem and did not suggest workarounds.
I just need to be able to wrap text inside table cells in RevTeX. Package makecell still works, but I would prefer automatic text wrap, not manual line breaks.
p
column type in atabular
environment? The reason I ask is that I get the exact same problems with your setup and with just the word "Hello" in the body of the document. The error message i get is triggered by LaTeX encountering the instruction\begin{document}
:! Extra \endgroup.
\document ->\endgroup
\document@inithook \true@sw {}
\UseOneTimeHook {begindo...
I use MacTeX2024 with all updates applied.MiKtEX
. However, if I removearray
package from loading in preamble, compilation go fine. This can be explained, that documentclass has own codes fortabular
column types, which should not be overwritten by loadingarray
package,tabularray
package. I supports all features of packages which you use in your document and works fine withrevtex
document class.\documentclass[aps,pra,twocolumn,showpacs,amsmath,amssymb,preprintnumbers,superscriptaddress,10pt]{revtex4-2} \usepackage{tabularray} \begin{document} \begin{table} \begin{tblr}{hlines, colspec={Q[ wd=30mm]}} \hline\hline This text needs to be wrapped inside the table cell. This text needs to be wrapped inside the table cell. This text needs to be wrapped inside the table cell.\\ {A\\B}\\ \end{tblr} \end{table} \end{document}