我在 LaTeX 表格方面遇到了一些问题。我想在单元格内列出项目,同时在第一列中将文本旋转 90 度,垂直居中。我有一张目前得到的结果的屏幕截图,看起来并不像我想要的那样 - 我想你知道我的意思:
另外,我想强制带有 itemize 的单元格使用左对齐而不是完全对齐。
提前致谢 :-)
重现该表的代码列在此处:
\documentclass[a4paper,11pt]{article}
\usepackage{a4wide}
\usepackage{enumitem}
\usepackage{array}
\usepackage{rotating}
\begin{document}
\begin{table}[h!]
\begin{center}
\footnotesize
\begin{tabular}{|l|l|l|l|l|}
\hline
& Fuji X100s & Canon 6D & Nikon F100 & PHILM\\
\hline
\rotatebox{90}{Strengths} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Globally large
\item Many distribution centers
\item Well established
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Globally large
\item Many distribution centers
\item Well established
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Globally large
\item Many distribution centers
\item Well established
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Has a niche market
\item Easy distribution
\item Fits any ASLR
\end{itemize}}\\
\hline
\rotatebox{90}{Weaknesses} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Big for a compact camera
\item Retro look only appeals to limited market
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Expensive
\item Big and bulky
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item No direct playback
\item Out dated
\item Expensive to develop film
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Market is limited
\item Battery life
\item No direct playback
\item Not ``established'' brand
\end{itemize}}\\
\hline
\rotatebox{90}{Opportunities} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Retro look can be fashionable
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Utilization of Canon brand
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Photo enthusiast can revive 35mm photoshooting
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Photo enthusiast can revive 35mm photoshooting
\end{itemize}}\\
\hline
\rotatebox{90}{Threats} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Competing brands can develop better cameras
\item Retro look no longer fashionable
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Competing brands can develop better cameras
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Digital cameras
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]%
\item Digital cameras
\end{itemize}}\\
\hline
\end{tabular}
\caption{Competitor SWOT analysis\label{tab:competitor-swot}}
\end{center}
\end{table}
\end{document}
答案1
对于旋转的标签,我使用了空格和的组合\llap
。为了证明,我调用了\raggedright
每个 itemize 环境。
\documentclass[a4paper,11pt]{article}
\usepackage{a4wide}
\usepackage{enumitem}
\usepackage{array}
\usepackage{rotating}
\begin{document}
\begin{table}[h!]
\begin{center}
\footnotesize
\begin{tabular}{|l|l|l|l|l|}
\hline
& Fuji X100s & Canon 6D & Nikon F100 & PHILM\\
\hline
\rotatebox{90}{\llap{Strengths~}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Globally large
\item Many distribution centers
\item Well established
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Globally large
\item Many distribution centers
\item Well established
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Globally large
\item Many distribution centers
\item Well established
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Has a niche market
\item Easy distribution
\item Fits any ASLR
\end{itemize}}\\
\hline
\rotatebox{90}{\llap{Weaknesses~}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Big for a compact camera
\item Retro look only appeals to limited market
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Expensive
\item Big and bulky
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item No direct playback
\item Out dated
\item Expensive to develop film
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Market is limited
\item Battery life
\item No direct playback
\item Not ``established'' brand
\end{itemize}}\\
\hline
\rotatebox{90}{~~~~~~~\llap{Opportunities~}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Retro look can be fashionable
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Utilization of Canon brand
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Photo enthusiast can revive 35mm photoshooting
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Photo enthusiast can revive 35mm photoshooting
\end{itemize}}\\
\hline
\rotatebox{90}{\llap{Threats~~~~}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Competing brands can develop better cameras
\item Retro look no longer fashionable
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Competing brands can develop better cameras
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Digital cameras
\end{itemize}} & \parbox[t]{0.2\textwidth}{%
\begin{itemize}[leftmargin=1em,itemsep=1pt,parsep=0pt]\raggedright%
\item Digital cameras
\end{itemize}}\\
\hline
\end{tabular}
\caption{Competitor SWOT analysis\label{tab:competitor-swot}}
\end{center}
\end{table}
\end{document}