Table row shading throws compile error

Paul A. Rubin parubin73 at gmail.com
Tue Jul 5 22:55:00 UTC 2022


On 7/5/22 18:14, Rich Shepard wrote:
> On Tue, 5 Jul 2022, Paul A. Rubin wrote:
>
>> I tried this in a fresh document (KomaScript Report class) by adding
>> \usepackage{xcolor, colortbl} to the preamble, and my table with your 
>> ERT
>> and column name in row 1, column 1 compiled just fine. You didn't 
>> specify
>> what module you are using, and a MWE would be helpful.
>
> Paul,
>
> I had \usepackage{colortbl}; just added xcolor. Made no difference. MWE
> attached, with the build log.
>
> Thanks,
>
> Rich
>
Well, the introduction of table borders causes LyX to introduce 
"multicolumns" of one column each, which somehow seems to conflict 
(slightly) with the \rowcolor command. Maybe a TeXpert can figure out a 
workaround, but I suspect this is one of those LaTeX things you just 
need to accept ... unless maybe you want to experiment with using LaTeX 
commands to introduce the border lines yourself.

FWIW, I tried editing the LaTeX to move the \rowcolor file before rather 
than in the first cell. It seemed to fix the problem, but I can't find 
any way in LyX to wedge a custom command/setting into a table before the 
first row. The Embedded Objects help manual says to color rows the way 
you are currently doing it, if that is any consolation.

Paul



More information about the lyx-users mailing list