由于我犯了错误,我尝试在 excel 中创建表格,然后使用“ExceltoLatex”插件将其传输到 Latex,如下面的代码所示。但是,它仍然没有生成我想要的表格。
提前非常感谢您。
% Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{clp{15.335em}l}
\toprule
\multicolumn{2}{c}{\textbf{RIBA Work Stage}} & \multicolumn{1}{c}{\textbf{Description of Key Tasks}} & \multicolumn{1}{c}{\textbf{Core BIM Activities}} \\
\midrule
\multirow{2}[4]{*}{\begin{sideways}\textbf{Preparation}\end{sideways}} & \textbf{Appraisal} & Identification of client’s needs and objectives, business case, sustainability, life cycle and Facilities Management aspirations and possible constraints on development. Preparation of feasibility studies and assessment of options to enable the client to decide whether to proceed. & \multicolumn{1}{l}{\multirow{2}[4]{*}{•Advise client on purpose of BIM including benefits and implications. Agree level and extent of BIM including 4D (time), 5D (cost) and 6D (FM) following software assessment. Advise client on Integrated Team scope of service in totality and for each designer including requirements for specialists and appointment of a BIM Model Manager.\newline{}•Define long-term responsibilities, including ownership of model.\newline{}• Define BIM Inputs and Outputs and scope of post-occupancy evaluation (Soft Landings).\newline{}• Identify scope of and commission BIM surveys and investigation reports.\newline{}• Data drop 1.}} \\
\cmidrule{2-3} & \textbf{Design Brief} & Development of initial statement of requirements into the Design Brief by or on behalf of the client, confirming key requirements and constraints. Identification of procurement method, project sustainability and BIM procedures, building design lifetime and project organisational structure and range of consultants and others to be engaged for the project, including definition of responsibilities. & \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
答案1
使用makecell
、multirow
和包,重新tabularx
设计enumitem
了列标题:
\documentclass{article}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, multirow, tabularx}
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\newcolumntype{R}{>{\RaggedRight}X}
\usepackage{enumitem}
\begin{document}
\begin{table}[htbp]
\centering
\setlength\tabcolsep{4pt}
\caption{Add caption}
\label{tab:addlabel}%
\begin{tabularx}{\linewidth}{@{} >{\small\bfseries\hsize=0.24\hsize}R
*{2}{>{\hsize=0.83\hsize}R} @{}}
\toprule
\multirow{3}{=}{{RIBA Work Stage}}
& \multicolumn{2}{c}{\thead{Preparation}} \\
\cmidrule{2-3}
& \thead{Description of\\ Key Tasks}
& \thead{Core BIM\\Activities} \\
\midrule
Appraisal
& Identification of client’s needs and objectives, business case, sustainability, life cycle and Facilities Management aspirations and possible constraints on development. Preparation of feasibility studies and assessment of options to enable the client to decide whether to proceed.
& \multirow{2}{=}{%
\begin{itemize}[nosep, wide, before=\vspace{-\baselineskip}, after=\vspace{-\baselineskip}]
\item Advise client on purpose of BIM including benefits and implications. Agree level and extent of BIM including 4D (time), 5D (cost) and 6D (FM) following software assessment. Advise client on Integrated Team scope of service in totality and for each designer including requirements for specialists and appointment of a BIM Model Manager.
\item Define long-term responsibilities, including ownership of model.
\item Define BIM Inputs and Outputs and scope of post-occupancy evaluation (Soft Landings).\newline{}• Identify scope of and commission BIM surveys and investigation reports.
\item Data drop 1.
\end{itemize}} \\
\addlinespace
Design Brief
& Development of initial statement of requirements into the Design Brief by or on behalf of the client, confirming key requirements and constraints. Identification of procurement method, project sustainability and BIM procedures, building design lifetime and project organisational structure and range of consultants and others to be engaged for the project, including definition of responsibilities.
& \\
\bottomrule
\end{tabularx}%
\end{table}
\end{document}
编辑:
上面的解决方案考虑显示表格,其中不需要使用longtable
。而是使用它tabularx
(如在其他一些答案中一样)。
如果您的表格确实跨越多页,那么您可以轻松地采用上述代码来满足此类需求,例如通过使用xltabular
。如果需要,请告诉我,我将提供代码。
答案2
嵌套表格也是一种可能性,但对齐是一个挑战(示例 1)。您还可以calstable
使用卡路里包。我也使用微型为了更好的换行,并且没有关于过满的警告hbox
。(示例 2)。
我已经用标题更新了示例 2。您可以calstable
像其他表格一样为 at 添加标题:要么将 at 括calstable
在 \captionof{table}{command 中table-environment, or load the [capt-of][3] package and use the
。我建议您加载完整的 [caption][3] 包,以便可以格式化标题。除非您使用 [KOMA-script][3]。那么您应该使用内部命令 \captionofabove`:
示例 1 – 嵌套表格
\documentclass{article}
\usepackage{array, booktabs, multirow}
\usepackage{enumitem}
\usepackage{array}
\usepackage{rotating}
\usepackage{geometry}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{@{}>{\bfseries}p{0.3cm}p{3cm}m{4.75cm}m{5cm}@{}}
\toprule
&
\small\bfseries RIBA Work Stage &
\small\bfseries Description of Key Tasks &
\small\bfseries Core BIM Activities\\ \midrule
\begin{sideways}Preparation\end{sideways} &
\begin{tabular}[c]{@{}>{\bfseries}m{3cm}m{4.755cm}@{}}
Appraisal &
Identification of client’s needs and objectives, business case, sustainability, life cycle and Facilities Management aspirations and possible constraints on development. Preparation of feasibility studies and assessment of options to enable the client to decide whether to proceed.\\ \midrule
Design Brief &
Development of initial statement of requirements into the Design Brief by or on behalf of the client, confirming key requirements and constraints. Identification of procurement method, project sustainability and BIM procedures, building design lifetime and project organisational structure and range of consultants and others to be engaged for the project, including definition of responsibilities.\\
\end{tabular}&
&\begin{minipage}[b]{5cm}
\begin{itemize}[labelsep=*, leftmargin=*, nosep]
\item Advise client on purpose of BIM including benefits and implications. Agree level and extent of BIM including 4D (time), 5D (cost) and 6D (FM) following software assessment. Advise client on Integrated Team scope of service in totality and for each designer including requirements for specialists and appointment of a BIM Model Manager.
\item Define long-term responsibilities, including ownership of model.
\item Define long-term responsibilities, including ownership of model.
\item Define BIM Inputs and Outputs and scope of post-occupancy evaluation (Soft Landings)
\item Identify scope of and commission BIM surveys and investigation reports.
\item Data drop 1
\end{itemize}
\end{minipage}\\
\bottomrule
\end{tabular}%
\label{tab:addlabeladd}%
\end{table}%
\end{document}
示例 2 – calstable
\documentclass{article}
\usepackage{cals}
\usepackage{enumitem}
\usepackage{rotating, caption}
\usepackage{geometry}
\usepackage{lmodern}
\usepackage{microtype}
\begin{document}
\let\nc=\nullcell % Shortcuts
\let\sc=\spancontent
\begin{table}
\caption{You add caption to at calstable the usual way: Either enclose the calstable in a table-environment, or load the capt-of package and use the captionof command}
\begin{calstable}[c]
\colwidths{{\dimexpr(\columnwidth)/20\relax}
{\dimexpr((\columnwidth)/20)*4\relax}
{\dimexpr((\columnwidth)/40)\relax}
{\dimexpr((\columnwidth)/20)*7\relax}
{\dimexpr((\columnwidth)/40)\relax}
{\dimexpr((\columnwidth)/20)*7\relax}
}
\makeatletter
\def\cals@framers@width{0.8pt} % Outside frame rules
\def\cals@framecs@width{0pt}
\def\cals@bodyrs@width{0.6pt} % Rule between header and tabular body
\def\cals@cs@width{0pt} % Inside vertical rules
\def\cals@rs@width{0.4pt} % Inside horizontal rules
\setlength{\cals@paddingL}{0pt}
\setlength{\cals@paddingR}{0pt}
\def\bb{\ifx\cals@borderB\relax % Bottom border switch (off-on)
\def\cals@borderB{0pt}
\else\let\cals@borderB\relax\fi}
% H1
\thead{\bfseries\small
\brow
\alignL\cell{}
\alignL\cell{ RIBA Work Stage}
\cell{}
\alignL\cell{Description of Key Tasks }
\cell{}
\alignL\cell{Core BIM Activities}
\erow
\mdseries
}
%R1
\brow
\nc{tlr}
\alignL\cell{\vfil \textbf{Appraisal}}
\cell{}
\alignL\cell{Identification of client’s needs and objectives, business case, sustainability, life cycle and Facilities Management aspirations and possible constraints on development. Preparation of feasibility studies and assessment of options to enable the client to decide whether to proceed.}\bb
\cell{}
\nc{tlr}
\erow
%R2
\brow\bb
\nc{blr}\alignL\sc{\vfil\begin{sideways}\textbf{Preparation}\end{sideways}}
\alignL\cell{\vfil \textbf{Design Brief}}
\cell{}
\alignL\cell{Development of initial statement of requirements into the Design Brief by or on behalf of the client, confirming key requirements and constraints. Identification of procurement method, project sustainability and BIM procedures, building design lifetime and project organisational structure and range of consultants and others to be engaged for the project, including definition of responsibilities.}
\cell{}
\nc{blr}\alignL\sc{\begin{itemize}[labelsep=*, leftmargin=*, nosep]
\item Advise client on purpose of BIM including benefits and implications. Agree level and extent of BIM including 4D (time), 5D (cost) and 6D (FM) following software assessment. Advise client on Integrated Team scope of service in totality and for each designer including requirements for specialists and appointment of a BIM Model Manager.
\item Define long-term responsibilities, including ownership of model.
\item Define BIM Inputs and Outputs and scope of post-occupancy evaluation (Soft Landings)
\item Identify scope of and commission BIM surveys and investigation reports.
\item Data drop 1
\end{itemize}}
\erow
\makeatother
\end{calstable}
\end{table}
\end{document}
答案3
借助tabularx
使表格与文本宽度一样宽,enumitem
用于最后一列的列表,makecell
用于列标题,以及multirow
用于第一列和最后一列的内容。
\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{tabularx}
\renewcommand{\theadfont}{\normalsize\bfseries}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1}
\setlist[tabitem]{wide=0pt, nosep, leftmargin= * ,label=\textbullet,after=\vspace{-\baselineskip},before=\vspace{-\baselineskip}}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabularx}{\textwidth}{cl>{\hsize=0.9\hsize}X>{\hsize=1.1\hsize}X}
\toprule
\multicolumn{2}{c}{\thead{RIBA Work Stage}} & \thead{Description of Key Tasks} & \thead{Core BIM Activities} \\
\midrule
\multirow{24}[4]{*}{\rotatebox{90}{\textbf{Preparation}}}
& \textbf{Appraisal}
& Identification of client’s needs and objectives, business case, sustainability, life cycle and Facilities Management aspirations and possible constraints on development. Preparation of feasibility studies and assessment of options to enable the client to decide whether to proceed.
& \multirow[t]{24}{=}{\begin{tabitem}
\item advise client on purpose of BIM including benefits and implications. Agree level and extent of BIM including 4D (time), 5D (cost) and 6D (FM) following software assessment. Advise client on Integrated Team scope of service in totality and for each designer including requirements for specialists and appointment of a BIM Model Manager.
\item Define long-term responsibilities, including ownership of model.
\item Define BIM Inputs and Outputs and scope of post-occupancy evaluation (Soft Landings).
\item Identify scope of and commission BIM surveys and investigation reports.
\item Data drop 1.
\end{tabitem}} \\
\cmidrule{2-3}
& \textbf{Design Brief}
& Development of initial statement of requirements into the Design Brief by or on behalf of the client, confirming key requirements and constraints. Identification of procurement method, project sustainability and BIM procedures, building design lifetime and project organisational structure and range of consultants and others to be engaged for the project, including definition of responsibilities. & \\
\bottomrule
\end{tabularx}%
\label{tab:addlabel}%
\end{table}%
\end{document}
您可能还对表格内容的完全不同的呈现方式感兴趣。例如,您可以使用嵌套的 description/itemize 环境,如下所示:
\documentclass{article}
\usepackage{geometry}
\usepackage{enumitem}
\begin{document}
\begin{description}[style=nextline]
\item[Preparation]~
\begin{description}
\item[Appraisal] Identification of client’s needs and objectives, business case, sustainability, life cycle and Facilities Management aspirations and possible constraints on development. Preparation of feasibility studies and assessment of options to enable the client to decide whether to proceed.
\item[Design Brief] Development of initial statement of requirements into the Design Brief by or on behalf of the client, confirming key requirements and constraints. Identification of procurement method, project sustainability and BIM procedures, building design lifetime and project organisational structure and range of consultants and others to be engaged for the project, including definition of responsibilities.
\end{description}
\begin{itemize}
\item advise client on purpose of BIM including benefits and implications. Agree level and extent of BIM including 4D (time), 5D (cost) and 6D (FM) following software assessment. Advise client on Integrated Team scope of service in totality and for each designer including requirements for specialists and appointment of a BIM Model Manager.
\item Define long-term responsibilities, including ownership of model.
\item Define BIM Inputs and Outputs and scope of post-occupancy evaluation (Soft Landings).
\item Identify scope of and commission BIM surveys and investigation reports.
\item Data drop 1.
\end{itemize}
\end{description}
\end{document}
答案4
感谢@Steven B. Segletes ---https://tex.stackexchange.com/a/148524/197451
下表格式应该足以满足您的需求——看看它是否符合您的要求
\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
& RIBA Work Stage & Description of Key Task & Core BIM & 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}