~xdanaux/moderncv/trunk

« back to all changes in this revision

Viewing changes to moderncv.cls

  • Committer: Xavier Danaux
  • Date: 2014-02-17 20:59:16 UTC
  • Revision ID: xdanaux@gmail.com-20140217205916-9qof32nbauu518p7
Modified the cvcolumn code the expand the tabular column definitions correctly, as to avoid conflicts with the "colortbl" / "array" packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
% TODO: move to xifthen and \isempty{<arg>} instead of \equal{<arg>}{}
82
82
 
83
83
% color
84
 
\RequirePackage{xcolor}
 
84
\RequirePackage[table]{xcolor}
85
85
 
86
86
% font loading
87
87
\RequirePackage{ifxetex,ifluatex}
485
485
        \g@addto@macro\cvcolumns@def{@{\hspace*{\separatorcolumnwidth}}}%
486
486
        \g@addto@macro\cvcolumns@head{&}%
487
487
        \g@addto@macro\cvcolumns@content{&}\fi%
488
 
      \expandafter\g@addto@macro\expandafter\cvcolumns@def\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@def\endcsname}%
 
488
%      \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<i>@def references that it doesn't understand; the next 2 lines expand \cvcolumn@def to the point it doesn't
 
489
      \edef\tmpcvcolumn@def{\csname cvcolumn\roman{tmpiteratorcounter}@def\endcsname}%
 
490
      \expandafter\g@addto@macro\expandafter\cvcolumns@def\expandafter{\tmpcvcolumn@def}%
489
491
      \expandafter\g@addto@macro\expandafter\cvcolumns@head\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@head\endcsname}%
490
492
      \expandafter\g@addto@macro\expandafter\cvcolumns@content\expandafter{\csname cvcolumn\roman{tmpiteratorcounter}@content\endcsname}%
491
493
      \stepcounter{tmpiteratorcounter}%
503
505
%      \repeat%
504
506
    % create the tabular
505
507
    \cvitem{}{%
506
 
      \begin{tabular}{\cvcolumns@def}%
 
508
%      \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
 
509
      \def\begincvcolumns{\begin{tabular}}
 
510
      \expandafter\begincvcolumns\expandafter{\cvcolumns@def}%
507
511
        \if@cvcolumns@head@empty\else%
508
512
          \cvcolumns@head%\\[-.8em]%
509
513
%          {\color{color1}\rule{\maincolumnwidth}{.25pt}}%