[table]{xcolor} and array v2.4k conflict












0















I'm trying to create a table with:




  1. different formatting across cells

  2. footnotes

  3. minipages

  4. coloured rows


For the coloured rows I'm trying to use xcolor with the [table] option.



However, this throws an error with the >{bfseries} column spec. I'm using MiKTeX 2.9.6972 on Windows 10 x64 and version 2.4k of the array package as described in here, and XeLaTeX to compile (although PDFLaTeX seems to generate the same error). This works if I switch off the xcolor package, but then the rowcolor command is no longer available.



My question is two-fold:




  1. Is it possible to use [table]{xcolor} and {array} together?

  2. If not, is there an alternative to color a row of a table?


MWE:



documentclass{article}
usepackage[table]{xcolor} % works if we remove the 'table' option, but then we don't have access to cellcolor/rowcolor
%usepackage{xcolor}

usepackage{booktabs}

% force the new array package to be loaded.
usepackage{tabularx}

% https://texfaq.org/FAQ-wholerow
newcolumntype{@}{>{globalletcurrentrowstylerelax}}
newcolumntype{^}{>{currentrowstyle}}
newcommand{rowstyle}[1]{gdefcurrentrowstyle{#1}%
#1ignorespaces
}

begin{document}

begin{tabular}{>{bfseries}@p{5.5cm}^r}
Col A & Col B \
midrule
rowstyle{bfseriesitshapelarge}This row should be large, bold, italics with shading & So this cell too. \
rowcolor{grey}This bold but shaded & this just normal.footnote{I.e., no extra mark-up} \
Remark & multicolumn{1}{c}{begin{minipage}[t]{3.5cm}raggedright {footnotesize Some cells are included as a minipage to accommodate extra text.}end{minipage}} \
midrule
end{tabular}

end{document}


The error I get is:



! Use of @startpbox doesn't match its definition.
<inserted text> @startpbox {
>{bfseries }@p{5.5cm}^r}
l.19 begin{tabular}{>{bfseries}@p{5.5cm}^r}

If you say, e.g., `defa1{...}', then you must always put `1' after `a',
since control sequence names are made up of letters only.
The macro here has not been followed by the required stuff, so I'm ignoring
it.

! LaTeX Error: Command bfseries invalid in math mode.









share|improve this question





























    0















    I'm trying to create a table with:




    1. different formatting across cells

    2. footnotes

    3. minipages

    4. coloured rows


    For the coloured rows I'm trying to use xcolor with the [table] option.



    However, this throws an error with the >{bfseries} column spec. I'm using MiKTeX 2.9.6972 on Windows 10 x64 and version 2.4k of the array package as described in here, and XeLaTeX to compile (although PDFLaTeX seems to generate the same error). This works if I switch off the xcolor package, but then the rowcolor command is no longer available.



    My question is two-fold:




    1. Is it possible to use [table]{xcolor} and {array} together?

    2. If not, is there an alternative to color a row of a table?


    MWE:



    documentclass{article}
    usepackage[table]{xcolor} % works if we remove the 'table' option, but then we don't have access to cellcolor/rowcolor
    %usepackage{xcolor}

    usepackage{booktabs}

    % force the new array package to be loaded.
    usepackage{tabularx}

    % https://texfaq.org/FAQ-wholerow
    newcolumntype{@}{>{globalletcurrentrowstylerelax}}
    newcolumntype{^}{>{currentrowstyle}}
    newcommand{rowstyle}[1]{gdefcurrentrowstyle{#1}%
    #1ignorespaces
    }

    begin{document}

    begin{tabular}{>{bfseries}@p{5.5cm}^r}
    Col A & Col B \
    midrule
    rowstyle{bfseriesitshapelarge}This row should be large, bold, italics with shading & So this cell too. \
    rowcolor{grey}This bold but shaded & this just normal.footnote{I.e., no extra mark-up} \
    Remark & multicolumn{1}{c}{begin{minipage}[t]{3.5cm}raggedright {footnotesize Some cells are included as a minipage to accommodate extra text.}end{minipage}} \
    midrule
    end{tabular}

    end{document}


    The error I get is:



    ! Use of @startpbox doesn't match its definition.
    <inserted text> @startpbox {
    >{bfseries }@p{5.5cm}^r}
    l.19 begin{tabular}{>{bfseries}@p{5.5cm}^r}

    If you say, e.g., `defa1{...}', then you must always put `1' after `a',
    since control sequence names are made up of letters only.
    The macro here has not been followed by the required stuff, so I'm ignoring
    it.

    ! LaTeX Error: Command bfseries invalid in math mode.









    share|improve this question



























      0












      0








      0








      I'm trying to create a table with:




      1. different formatting across cells

      2. footnotes

      3. minipages

      4. coloured rows


      For the coloured rows I'm trying to use xcolor with the [table] option.



      However, this throws an error with the >{bfseries} column spec. I'm using MiKTeX 2.9.6972 on Windows 10 x64 and version 2.4k of the array package as described in here, and XeLaTeX to compile (although PDFLaTeX seems to generate the same error). This works if I switch off the xcolor package, but then the rowcolor command is no longer available.



      My question is two-fold:




      1. Is it possible to use [table]{xcolor} and {array} together?

      2. If not, is there an alternative to color a row of a table?


      MWE:



      documentclass{article}
      usepackage[table]{xcolor} % works if we remove the 'table' option, but then we don't have access to cellcolor/rowcolor
      %usepackage{xcolor}

      usepackage{booktabs}

      % force the new array package to be loaded.
      usepackage{tabularx}

      % https://texfaq.org/FAQ-wholerow
      newcolumntype{@}{>{globalletcurrentrowstylerelax}}
      newcolumntype{^}{>{currentrowstyle}}
      newcommand{rowstyle}[1]{gdefcurrentrowstyle{#1}%
      #1ignorespaces
      }

      begin{document}

      begin{tabular}{>{bfseries}@p{5.5cm}^r}
      Col A & Col B \
      midrule
      rowstyle{bfseriesitshapelarge}This row should be large, bold, italics with shading & So this cell too. \
      rowcolor{grey}This bold but shaded & this just normal.footnote{I.e., no extra mark-up} \
      Remark & multicolumn{1}{c}{begin{minipage}[t]{3.5cm}raggedright {footnotesize Some cells are included as a minipage to accommodate extra text.}end{minipage}} \
      midrule
      end{tabular}

      end{document}


      The error I get is:



      ! Use of @startpbox doesn't match its definition.
      <inserted text> @startpbox {
      >{bfseries }@p{5.5cm}^r}
      l.19 begin{tabular}{>{bfseries}@p{5.5cm}^r}

      If you say, e.g., `defa1{...}', then you must always put `1' after `a',
      since control sequence names are made up of letters only.
      The macro here has not been followed by the required stuff, so I'm ignoring
      it.

      ! LaTeX Error: Command bfseries invalid in math mode.









      share|improve this question
















      I'm trying to create a table with:




      1. different formatting across cells

      2. footnotes

      3. minipages

      4. coloured rows


      For the coloured rows I'm trying to use xcolor with the [table] option.



      However, this throws an error with the >{bfseries} column spec. I'm using MiKTeX 2.9.6972 on Windows 10 x64 and version 2.4k of the array package as described in here, and XeLaTeX to compile (although PDFLaTeX seems to generate the same error). This works if I switch off the xcolor package, but then the rowcolor command is no longer available.



      My question is two-fold:




      1. Is it possible to use [table]{xcolor} and {array} together?

      2. If not, is there an alternative to color a row of a table?


      MWE:



      documentclass{article}
      usepackage[table]{xcolor} % works if we remove the 'table' option, but then we don't have access to cellcolor/rowcolor
      %usepackage{xcolor}

      usepackage{booktabs}

      % force the new array package to be loaded.
      usepackage{tabularx}

      % https://texfaq.org/FAQ-wholerow
      newcolumntype{@}{>{globalletcurrentrowstylerelax}}
      newcolumntype{^}{>{currentrowstyle}}
      newcommand{rowstyle}[1]{gdefcurrentrowstyle{#1}%
      #1ignorespaces
      }

      begin{document}

      begin{tabular}{>{bfseries}@p{5.5cm}^r}
      Col A & Col B \
      midrule
      rowstyle{bfseriesitshapelarge}This row should be large, bold, italics with shading & So this cell too. \
      rowcolor{grey}This bold but shaded & this just normal.footnote{I.e., no extra mark-up} \
      Remark & multicolumn{1}{c}{begin{minipage}[t]{3.5cm}raggedright {footnotesize Some cells are included as a minipage to accommodate extra text.}end{minipage}} \
      midrule
      end{tabular}

      end{document}


      The error I get is:



      ! Use of @startpbox doesn't match its definition.
      <inserted text> @startpbox {
      >{bfseries }@p{5.5cm}^r}
      l.19 begin{tabular}{>{bfseries}@p{5.5cm}^r}

      If you say, e.g., `defa1{...}', then you must always put `1' after `a',
      since control sequence names are made up of letters only.
      The macro here has not been followed by the required stuff, so I'm ignoring
      it.

      ! LaTeX Error: Command bfseries invalid in math mode.






      tables color rowcolor






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 17 secs ago









      JouleV

      4,5441938




      4,5441938










      asked 15 mins ago









      user3754505user3754505

      243




      243






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477514%2ftablexcolor-and-array-v2-4k-conflict%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477514%2ftablexcolor-and-array-v2-4k-conflict%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks