如何分离 .cls 文件中表格的结构和样式,并从另一个文件中提取内容来填充表格?

如何分离 .cls 文件中表格的结构和样式,并从另一个文件中提取内容来填充表格?

我有文件“poscomp.cls”,其中包含表:

 \begin{table}[hbt!]
  \ifthenelse
   {\equal{\@nivel}{mestrado}}
   {{\textbf{CRONOGRAMA DE ELABORAÇÃO DE DISSERTAÇÃO – ANO 1}}}
   {{\textbf{CRONOGRAMA DE ELABORAÇÃO DE TESE – ANO 1}}}
  \centering
  \resizebox{\columnwidth}{!}{
  \begin{tabular}{llclllllllllll}
   
  \rowcolor[HTML]{A8D08D} 
  \cellcolor[HTML]{D9D9D9} & 
  \cellcolor[HTML]{BDD7EE} & 
  \multicolumn{12}{c}{\cellcolor[HTML]{A8D08D}\textbf{ANO 1}} \\
   
  \rowcolor[HTML]{C5E0B3}
  \cellcolor[HTML]{D9D9D9} &
  \cellcolor[HTML]{BDD7EE} &
  \multicolumn{12}{c}{\cellcolor[HTML]{C5E0B3}\textbf{MESES DO ANO (2021 - 2022)}} \\

  \multirow{-3}{*}{
  \cellcolor[HTML]{D9D9D9}\textbf{ETAPAS}} & 
  \multirow{-3}{*}{
  \cellcolor[HTML]{BDD7EE}\textbf{\begin{tabular}[c]{@{}c@{}}DURAÇÃO\\(MESES)\end{tabular}}} &

  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{1}} &
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{2}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{3}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{4}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{5}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{6}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{7}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{8}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{9}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{10}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{11}} & 
  \multicolumn{1}{c}{\cellcolor[HTML]{E2EFD9}\textbf{12}} \\


  % INÍCIO DA LINHA %
  \begin{tabular}[c]{@{}l@{}}Etapa 2 – Estudo da linguagem de programação a ser\\ aplicada no desenvolvimento do sistema\end{tabular} & 
  \multicolumn{1}{c}{XXX} &
   
  \multicolumn{1}{l}
  \checkmark &
  \checkmark & 
  \checkmark &
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark \\
  % FIM DA LINHA %

  % INÍCIO DA LINHA %
  \begin{tabular}[c]{@{}l@{}}Etapa 2 – Estudo da linguagem de programação a ser\\ aplicada no desenvolvimento do sistema\end{tabular} & 
  \multicolumn{1}{c}{XXX} &
   
  \multicolumn{1}{l}
  \checkmark &
  \checkmark & 
  \checkmark &
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark \\
  % FIM DA LINHA %   

  \end{tabular}}
  \end{table}

这些线的定义如下:

  % INÍCIO DA LINHA %
  \begin{tabular}[c]{@{}l@{}}Etapa 2 – Estudo da linguagem de programação a ser\\ aplicada no desenvolvimento do sistema\end{tabular} & 
  \multicolumn{1}{c}{XXX} &
   
  \multicolumn{1}{l}
  \checkmark &
  \checkmark & 
  \checkmark &
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark & 
  \checkmark \\
  % FIM DA LINHA %

我想要的是:通过另一个文件,在用户添加或删除表格行时动态填充表格行。换句话说,这个想法是用户不接触“poscomp.cls”文件,而只是将数据添加到单独的文件中。有什么办法吗?

相关内容