Os itens de texto dentro da tabela longa não estão alinhados verticalmente

Os itens de texto dentro da tabela longa não estão alinhados verticalmente

Minha pergunta pode ser semelhante a estaa lista de itens dentro da célula da tabela não está bem alinhada, mas a solução não se encaixou no meu caso.

com este código:

\documentclass[a4paper, 11pt]{article} 
\usepackage[margin=2cm]{geometry} % changes the margin
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage{titlesec}
\usepackage{indentfirst}
\usepackage{longtable}
\usepackage{blindtext}


%% Create a very compact enumerated list environment
\newlist{myenum}{enumerate}{1}
\setlist[myenum]{label=\arabic*., nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip}} % reducing vertical   space
%---------------------Need to Simplify This-----------------------------%
\newlist{myenum2}{enumerate}{1}
\setlist[myenum2]{label=\alph*), nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip}} % reducing vertical space
\newlist{myenum3}{enumerate}{1}
\setlist[myenum3]{label=\arabic*), nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip}} % reducing vertical space
\newlist{myenum4}{enumerate}{1}
\setlist[myenum4]{label=\arabic*., nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip},
             start=2} % reducing vertical space
\newlist{myenum5}{enumerate}{1}
\setlist[myenum5]{label=\arabic*., nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip},
             start=3} % reducing vertical space
\newlist{myenum6}{enumerate}{1}
\setlist[myenum6]{label=\arabic*., nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip},
             start=4} % reducing vertical space
\newlist{myenum7}{enumerate}{1}
\setlist[myenum7]{label=\arabic*., nosep, wide, 
             leftmargin=*, % hanging indentation
             before=\vspace{-0.57\baselineskip},
             after =\vspace{-0.8\baselineskip},
             start=5} % reducing vertical space               

\renewcommand\thesection{\Alph{section}.}
\renewcommand\thesubsection{\arabic{subsection}.}
%% Re-format the font size of "the section"
% {11} is the desired font size
% {15} is the vertical spacing, perhaps refers to 1.5 lines?
% \selectfont is for un-bold the sub-section
\titleformat{\section}
{\normalfont\fontsize{11}{.5em}\bfseries}{\thesection}{.5em}
    {}
\titleformat{\subsection}
{\normalfont\fontsize{11}{.5em}\selectfont}{\thesubsection}{.5em}
    {}
\titlespacing % starred version: first paragraph is not indented
{\subsection} % <command>
{0em} % <left>
{.4em} % <before-sep>
{.3em} % <after-sep>

\setlength\parindent{1cm} 

% Avoid hypenation (breaking sentences in paragraph)
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000

\begin{document}
%------------------------------Section D---------------------------------------------%
\section{Some Text Here}
\begin{longtable}{@{}p{0.3\textwidth}cp{0.65\textwidth}}
%% Subsection 1
\begin{myenum} \item Some Text Here \end{myenum} & : & \blindtext \\
%% Subsection 2
\begin{myenum4} \item Some Text Here \end{myenum4} & : & \blindtext \\
%% Subsection 3
\begin{myenum5} \item Some Text Here \end{myenum5} & : & \begin{myenum3}
\item Some Text Here;
\item Some Text Here;
\item Some Text Here;
\item Some Text Here;
\item Some Text Here;
\item Some Text Here.
\end{myenum3}\\
%% Subsection 4
\begin{myenum6} \item Some Text Here \end{myenum6} & : &   \begin{myenum2} 
\item \blindtext; 
\item \blindtext;  
\end{myenum2}\\
%% Subsection 5
\begin{myenum7} \item{Some Text Here} \end{myenum7} & : & \blindtext.\\
\end{longtable}
\end{document}

Isso resultou neste[saída1][ ][1]]1[ saída2]2

Minhas perguntas são:

  1. Eu sei que com \newlist e \setlist posso criar uma lista enumerada personalizada na primeira coluna, mas existe alguma maneira mais elegante?answered
  2. Como posso produzir uma tabela que abrange várias páginas com uma combinação de lista numerada na primeira coluna, algum texto na segunda coluna, :símbolo na terceira coluna e lista numerada na quarta coluna e mantê-los alinhados verticalmente?
  3. E como posso reduzir o espaço vertical desnecessário entre \section e o texto depois dele?answered

Qualquer ajuda seria muito apreciada.

Responder1

Se o único motivo para usar um enumerateambiente customizado for inserir automaticamente um contador na primeira coluna, sugiro que você proceda da seguinte forma. Observe que tanto o ambiente longtablequanto o tabularpossuem uma coluna (do tipo N) que é programada para incrementar o contador e imprimi-lo imediatamente.

Observe que é possível facilmente fazer referência cruzada de linhas específicas por meio do mecanismo \label- usual \ref.

insira a descrição da imagem aqui

\documentclass[a4paper, 11pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{array,longtable,etoolbox,lipsum}
\setlength\extrarowheight{2pt} % for a more open "look" of tabular material
\newcolumntype{P}[1]{p{#1\textwidth}}

\newcounter{rownum}
\newcolumntype{N}{>{\refstepcounter{rownum}\therownum}l}
% Automate resetting of counter to 0 at the start of a tabular-like env.:
\AtBeginEnvironment{tabular}{\setcounter{rownum}{0}}
\AtBeginEnvironment{tabular*}{\setcounter{rownum}{0}}
\AtBeginEnvironment{tabularx}{\setcounter{rownum}{0}}
\AtBeginEnvironment{longtable}{\setcounter{rownum}{0}}

\begin{document}

\begingroup  % localize the following settings
\setlength\tabcolsep{0pt} % <--- important
\setlength\LTleft{0pt} \setlength\LTright{0pt}

\begin{longtable}{@{\extracolsep{\fill}} N P{0.32} P{0.63}} 
   % rel. column widths of the "P" columns should sum to no more than 0.95.
\hline
\endfirsthead
\hline
\endlastfoot

& Some text here      & \lipsum*[1] \\[1ex]
& Some more text here & \lipsum*[2] \\

\end{longtable}
\endgroup


\begin{center}
\begin{tabular}{@{} N lll @{}}
\hline
& a & b & c \\
& d & e & f \\
\label{row:last}& g & h & i \\
\hline
\end{tabular}
\end{center}

%% Create a cross-reference to the final row:
\noindent
A cross-reference to row \ref{row:last}.
\end{document}

informação relacionada