So nummerieren Sie Zeilen und Spalten in einer [seitlichen] Tabelle automatisch

So nummerieren Sie Zeilen und Spalten in einer [seitlichen] Tabelle automatisch

Ich versuche, eine Quertabelle mit automatischer Nummerierung der Zeilen und Unternummerierung der Spalten zu setzen. Ich habediese Antwortum die Zeilen zu nummerieren, aber das bringt mir nur die Zeilenkopfnummern. Ich möchte, dass die Spalten entsprechende Unternummern für jede Zeile haben (z. B. 1. Zeilenkopf 1a. ungefähr zwei Zeilen mit ..., 1b. ..., 1c. ...). Das MWE behält einige der erforderlichen Formatierungen als mein Dokument bei, sodass einige Elemente (z. B. die seitliche Anordnung der Tabelle) möglicherweise nicht erforderlich sind. Meine Versuche haben dazu geführt, dass die Zählung über die Zeilen hinweg fortgesetzt wird, anstatt Unternummern zu erhalten (z. B. erhalte ich 1. 2. 3. 4. über die erste Zeile und dann beginnt die zweite Zeile bei 5.) Ich bin neu bei LaTeX und dies ist mein erster Beitrag, also entschuldigen Sie, wenn dies offensichtlich ist oder wenn ich die Antwort woanders übersehen habe.

MWE:

\documentclass[11pt,a4paper,openright,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{array}
\usepackage{rotating}

\renewcommand{\arraystretch}{1.5}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcounter{rowcount}
\setcounter{rowcount}{0}

\begin{document}
\begin{sidewaystable}
\centering
\caption{An Appropriate Table Title}
\small
\label{tab:valued_language_capabilities}
\begin{tabular}{@{\stepcounter{rowcount}\therowcount.\hspace*{\tabcolsep}}L{40mm}L{45mm}L{45mm}L{45mm}}
\multicolumn{1}{>{\makebox[3em][r]{}}l}{}   & column header & column header & column header\\
\hline
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
\hline
\end{tabular}
\end{sidewaystable}
\end{document}

Kompiliert als:

Nummerierte Zeilen, aber keine Unternummern über die Zeile in jeder Spalte

Antwort1

So? (Ich habe es \hskipnur verwendet, um die Anzahl der Buchstaben zu reduzieren.)

\documentclass[11pt,a4paper,openright,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{array}
\usepackage{rotating}

\renewcommand{\arraystretch}{1.5}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcounter{rowcount}
\setcounter{rowcount}{0}
\newcounter{colcount}[rowcount]% auto reset
\renewcommand{\thecolcount}{\therowcount\alph{colcount}}

\begin{document}
\begin{sidewaystable}
\centering
\caption{An Appropriate Table Title}
\small
\label{tab:valued_language_capabilities}
\begin{tabular}{@{\stepcounter{rowcount}\therowcount.\hskip\tabcolsep}L{40mm}
  @{\hskip\tabcolsep\stepcounter{colcount}\thecolcount\hskip\tabcolsep}L{45mm}
  @{\hskip\tabcolsep\stepcounter{colcount}\thecolcount\hskip\tabcolsep}L{45mm}
  @{\hskip\tabcolsep\stepcounter{colcount}\thecolcount\hskip\tabcolsep}L{45mm}}
\multicolumn{1}{>{\makebox[3em][r]{}}l}{}   & column header & column header & column header\\
\hline
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
row header  & approximately two lines of row subcontent & approximately two lines of row subcontent & approximately two lines of row subcontent\\
\hline
\end{tabular}
\end{sidewaystable}
\end{document}

verwandte Informationen