![dirtree 在其中一个表格单元格中创建的图形](https://linux22.com/image/477382/dirtree%20%E5%9C%A8%E5%85%B6%E4%B8%AD%E4%B8%80%E4%B8%AA%E8%A1%A8%E6%A0%BC%E5%8D%95%E5%85%83%E6%A0%BC%E4%B8%AD%E5%88%9B%E5%BB%BA%E7%9A%84%E5%9B%BE%E5%BD%A2.png)
我希望将文本列表和figure
使用dirtree
并排放置。因此,我使用表格环境,在一个单元格中放置itemized
列表,在另一个单元格中放置figure
环境。这不起作用。示例代码如下:
\begin{tabular}[h]{@{} p{0.35\linewidth} | p{0.6\linewidth}@{}}
\begin{itemize}[noitemsep,topsep=2pt,parsep=2pt,partopsep=2pt,leftmargin=*]
\item something
\end{itemize}
&
\begin{figure}%[htp]
\dirtree{%
.1 Sheet Metal Features.
.2 Principal Features.
.3 Face-Wall \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorWall.png}}.
.3 Bend \qquad \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorBend.png}}.
.3 Flange \quad \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorFlange.png}}.
.3 Loft Flange \qquad \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorLoftedFlange.png}}.
%.3 Rib \quad \quad \adjustbox{valign=t}{\includegraphics[height=0.11\linewidth]{..//Common/images/Feature_Rib.png}}.
}
\caption{Sheet Metal features}
\label{tax_sm}
\end{figure}
\\
\end{tabular}
答案1
Afigure
是浮动环境,因此不能嵌入到tabular
。
\captionof
您可以通过capt-of
。
平均能量损失
\RequirePackage[demo]{graphicx}
\documentclass{article}
\usepackage{dirtree}
\usepackage{enumitem}
\usepackage{capt-of}
\usepackage{adjustbox}
\begin{document}
\begin{tabular}[h]{@{} p{0.35\linewidth} | p{0.6\linewidth}@{}}
\begin{itemize}[noitemsep,topsep=2pt,parsep=2pt,partopsep=2pt,leftmargin=*]
\item something
\end{itemize}
&
\dirtree{%
.1 Sheet Metal Features.
.2 Principal Features.
.3 Face-Wall \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorWall.png}}.
.3 Bend \qquad \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorBend.png}}.
.3 Flange \quad \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorFlange.png}}.
.3 Loft Flange \qquad \adjustbox{valign=t}{\includegraphics[scale=0.65]{..//Common/images/InventorLoftedFlange.png}}.
%.3 Rib \quad \quad \adjustbox{valign=t}{\includegraphics[height=0.11\linewidth]{..//Common/images/Feature_Rib.png}}.
}
\captionof{figure}{Sheet Metal features}
\label{tax_sm}
\\
\end{tabular}
\end{document}
输出