使用 tabularx 在多列单元格内枚举

使用 tabularx 在多列单元格内枚举

我想在表格中的项目中添加一个带缩进的子项目。我已展示了一个实际示例。如您所见,子项目与下一个单元格的水平线重叠。子项目的编号为 4.1,而不是 5。此外,当其中一列包含列表时,我希望两列的文本和顶部水平线之间的间距相同(参见第 1 行和第 2 行,两列中的文本相对于顶部水平线的间距不同)。

\documentclass[11pt,a4paper]{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[a4paper,left=1.11in,right=0.75in,top=0.5in,bottom=1.5in]{geometry}

\usepackage[T1]{fontenc}
\usepackage{mathptmx} %font
\usepackage{soul} %underline
\setul{}{1pt} %underline thickness
\pagenumbering{gobble}
\usepackage{lipsum}

\usepackage{tabularx,booktabs,mathtools}
\usepackage{multirow}
\usepackage{enumitem}

\newlist{mylist}{enumerate}{1}
\setlist[mylist]{label=\arabic*.,
                 nosep, wide, leftmargin=*,
                 before=\vspace{-0.37\baselineskip},
                 after =\vspace{-0.85\baselineskip}}
                 
\title{{\normalsize \textbf{\ul{PROGRESS REPORT}}}\vspace{-2.5em}}
\date{}
\author{}

\begin{document}
\maketitle
\thispagestyle{empty}
\noindent
    \begin{tabularx}{\linewidth}{|>{\hsize=1.3\hsize\linewidth=\hsize}X|>{\hsize=0.7\hsize\linewidth=\hsize}X|}    
    \hline
        \begin{mylist}[start=1]
            \item Project Title:\newline \lipsum[75]
        \end{mylist}
        & File No: \newline XXX/YYYY/NNNNNNNN \\
    \hline
        \begin{mylist}[start=2]
            \item PI (Name \& Address): \newline Dr. Some Long Name \newline Some Research Institute, Street Name, City Name, District Name, State Name, Country, Pincode 
        \end{mylist}
        & Date of Birth:\newline DD/MM/YYYY\\
    \hline
    \multicolumn{2}{|>{\hsize=2\hsize\linewidth=\hsize}X|}{
       \begin{mylist}[start=4] 
            \item Broad area of Research: Physics
            \begin{mylist}[label*=\arabic*.] 
                \item Sub area of Research: Superconductivity
            \end{mylist}
       \end{mylist}}\\
    \hline
    
    \multicolumn{2}{|>{\hsize=2\hsize\linewidth=\hsize}X|}{
       \begin{mylist}[start=5] 
            \item Project Proposal: \newline 
            \lipsum[2-4]
       \end{mylist}}\\
    \hline
        Date of Start: DD/MM/YYYY & Project Cost: xxxxxxx \\
    \hline
        \multirow[t]{3}{*}{Date of Completion: DD/MM/YYYY} &  Total Expense xxxxxxx  \\
         & Conumables - xxxxxxxx\\
         & Travel - xxxxxxxx\\  
    \hline
    \end{tabularx}
  
\end{document}

其结果是:

其结果是:

答案1

子项没有子编号的原因是\newlist{mylist}{enumerate}{1}我将其更改为\newlist{mylist}{enumerate}{2}

对于其余部分,我建议使用tabularray

是否需要 2 至 4 之间的数字(不含 3)?

\documentclass[11pt,a4paper]{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[a4paper,left=1.11in,right=0.75in,top=0.5in,bottom=1.5in]{geometry}

\usepackage[T1]{fontenc}
\usepackage{mathptmx} %font
\usepackage{soul} %underline
\setul{}{1pt} %underline thickness
\pagenumbering{gobble}
\usepackage{lipsum}

\usepackage{tabularray}
\UseTblrLibrary{varwidth}

\usepackage{mathtools}
\usepackage{enumitem}

\newlist{mylist}{enumerate}{2}
\setlist[mylist]{label=\arabic*.,
                 nosep, wide, leftmargin=*,}  
                 
\title{{\normalsize \textbf{\ul{PROGRESS REPORT}}}\vspace{-2.5em}}
\date{}
\author{}

\begin{document}
\maketitle
\thispagestyle{empty}
\noindent
\begin{tblr}{
    hlines, vlines,
    colspec={X[1.3]X[.7]},
    measure=vbox,stretch=-1,
    rowsep=4pt,
    }    
    \begin{mylist}
        \item Project Title:\newline \lipsum[75]
    \end{mylist}
    & {File No:\\ XXX/YYYY/NNNNNNNN} \\
    \begin{mylist}[start=2]
        \item PI (Name \& Address): \newline Dr. Some Long Name \newline Some Research Institute, Street Name, City Name, District Name, State Name, Country, Pincode 
    \end{mylist}
    & {Date of Birth:\\ DD/MM/YYYY}\\
    \SetCell[c=2]{l}
    \begin{mylist}[start=4] 
        \item Broad area of Research: Physics
        \begin{mylist}[label*=\arabic*.] 
            \item Sub area of Research: Superconductivity
        \end{mylist}
   \end{mylist}\\
   \SetCell[c=2]{j, wd=\linewidth-\parindent}
   \begin{mylist}[start=5] 
        \item Project Proposal: \newline 
        \lipsum[2-4]
   \end{mylist}\\
   Date of Start: DD/MM/YYYY & Project Cost: xxxxxxx \\
   Date of Completion: DD/MM/YYYY & {Total Expense xxxxxxx  \\
       Consumables - xxxxxxxx\\
       Travel - xxxxxxxx}\\
\end{tblr}
\end{document}

在此处输入图片描述

相关内容