From a72660424a00ac67147d7fbaf1725961ebe044a2 Mon Sep 17 00:00:00 2001 From: Xavier Danaux Date: Mon, 17 Feb 2014 15:59:16 -0500 Subject: [PATCH] Modified the cvcolumn code the expand the tabular column definitions correctly, as to avoid conflicts with the "colortbl" / "array" packages --- moderncv.cls | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/moderncv.cls b/moderncv.cls index f07a82a..4f6f49b 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -81,7 +81,7 @@ % TODO: move to xifthen and \isempty{} instead of \equal{}{} % color -\RequirePackage{xcolor} +\RequirePackage[table]{xcolor} % font loading \RequirePackage{ifxetex,ifluatex} @@ -485,7 +485,9 @@ \g@addto@macro\cvcolumns@def{@{\hspace*{\separatorcolumnwidth}}}% \g@addto@macro\cvcolumns@head{&}% \g@addto@macro\cvcolumns@content{&}\fi% - \expandafter\g@addto@macro\expandafter\cvcolumns@def\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@def\endcsname}% +% \expandafter\g@addto@macro\expandafter\cvcolumns@def\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@def\endcsname}% % this creates issues with the colortbl" package (loaded by xcolor when passing the "table" option) as the column definitions passed to \begin{tabular} contains \cvcolumn@def references that it doesn't understand; the next 2 lines expand \cvcolumn@def to the point it doesn't + \edef\tmpcvcolumn@def{\csname cvcolumn\roman{tmpiteratorcounter}@def\endcsname}% + \expandafter\g@addto@macro\expandafter\cvcolumns@def\expandafter{\tmpcvcolumn@def}% \expandafter\g@addto@macro\expandafter\cvcolumns@head\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@head\endcsname}% \expandafter\g@addto@macro\expandafter\cvcolumns@content\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@content\endcsname}% \stepcounter{tmpiteratorcounter}% @@ -503,7 +505,9 @@ % \repeat% % create the tabular \cvitem{}{% - \begin{tabular}{\cvcolumns@def}% +% \begin{tabular}{\cvcolumns@def}% this conflicts with the "colortbl" package (loaded by xcolor when passing the "table" option), and requires the below 2 lines to expand \cvcolumns@def + \def\begincvcolumns{\begin{tabular}} + \expandafter\begincvcolumns\expandafter{\cvcolumns@def}% \if@cvcolumns@head@empty\else% \cvcolumns@head%\\[-.8em]% % {\color{color1}\rule{\maincolumnwidth}{.25pt}}%