%20de%20ambientes%20enumerados%20e%20tabulares%20com%20r%C3%B3tulos%20que%20fornecem%20o%20n%C3%BAmero%20do%20ambiente%20enumerado.png)
Estou tentando fazer algo semelhante a Como posso misturar ambientes discriminados e tabulares?.
Porém, estou tentando usar um ambiente enumerado, quero os itens alinhados como em um ambiente tabular, e gostaria de referenciar os itens no ambiente enumerado usando rótulos para que as referências apareçam como números no ambiente enumerado .
Conceitualmente, a ideia é semelhante à de um ambiente de estilo bibliográfico, mas cada item é uma linha em um ambiente enumerado. Conceitualmente, o layout seria mais ou menos assim, mas com o cabeçalho e as linhas do corpo alinhados, é claro.
\documentclass{article}
\begin{document}
\newcommand{\corr}[4]{%
\begin{tabular}{llll}
%Date & From & To\\
#1 & #2 & #3 & #4
\end{tabular}
}
\section{List of Correspondence}
\begin{tabular}{llll}
\textbf{Date} & \textbf{From} & \textbf{To} & \textbf{Summary}\\
\end{tabular}
\begin{enumerate}
\item\label{c1} \corr{September 26th 2011}{Sender1}{Recepient1}{Some stuff}
\item\label{c2} \corr{September 23rd 2013}{Sender2}{Recepient2}{Some other stuff}
\end{enumerate}
Here is \ref{c1} and \ref{c2}.
\end{document}
ADENDO: O multienum
pacote faz algo parecido com o que eu quero, exceto que não vejo como incluir os cabeçalhos.
ADENDO 2: Se houvesse alguma maneira de fazer referência direta ao itemize
contador sem a sobrecarga de colocar rótulos, isso seria útil.
Responder1
Aqui está uma solução, se entendi bem seus requisitos:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{array}
\newcommand{\colhead}[1]{\multicolumn{1}{>{\bfseries}l}{#1}}
\newcounter{tabenum}\setcounter{tabenum}{0}
\newcommand{\nextnum}{\refstepcounter{tabenum}\thetabenum.}
\begin{document}
\section{Examples}
Here is an example:
\begin{center}
\begin{tabular}{>{\nextnum}l@{\hspace{\labelsep}}*{3}{l@{\quad\quad}}l}
\colhead{} & \colhead{Date} & \colhead{From} & \colhead{To} & \colhead {Summary} \\
\hline
\label{sep11} & September 26\textsuperscript{th} 2011 & Sender 1 &Recipient 1 \\
\label{sep13} & September 23\textsuperscript{rd} 2013 & Sender 2 & Recipient 2
\end{tabular}
\end{center}
According to case \ref{sep13}, Sender 2 sent a letter to Recipient 2.
\end{document}