我正在乳胶文档中的树形网格中显示嵌套的物料清单。
是否有可用的软件包可以帮助解决这个问题?
我当前表格的一个简短示例
\begin{table}[h]
\centering
\begin{tabular}{| l | l | c | c | r | r | }
\hline
Item & Description & Quantity & Units & Cost & Extended \\
\hline
\rowcolor{lightgray} Pulley & Pulley & 1.0 & Each & 15136.8 & 15136.8 \\
\rowcolor{lightgray} Shell & 996.5 ID x 1856 Plate 4140 32mm & 1.0 & Each & 3516.04 & 3516.04 \\
\hspace{0.3cm} PM00000019 & Weld MIG & 25.6763 & Kg & 1.2 & 30.81 \\
\hspace{0.3cm} PM00000012 & Weld MIG & 1.0135 & Hr & 90.0 & 91.22 \\
\hspace{0.3cm} PM00000013 & Weld Prep & 1.7373 & Hr & 90.0 & 156.36 \\
\hspace{0.3cm} PM00000108 & Plate 4140 32mm & 1483.0046 & Kg & 2.15 & 3188.46 \\
\hspace{0.3cm} PM00000010 & Plate Roll & 0.5465 & Hr & 90.0 & 49.19 \\
\rowcolor{lightgray} EnddiskA & 996.5 x 355 x 70 Plate 1045 & 1.0 & Each & 1445.32 & 1445.32 \\
\hspace{0.3cm} PM00001024 & Ring Backing 270 x 390 x 16 & 1.0 & Each & 39.73 & 39.73 \\
\hspace{0.3cm} PM00000115 & Plate 4140 70mm & 578.2036 & Kg & 2.43 & 1405.03 \\
\hspace{0.3cm} PM00000020 & Plasma Cutter & 0.2141 & Hr & 1.0 & 0.21 \\
\hspace{0.3cm} PM00000021 & Oxy Cutter & 0.5586 & Hr & 1.0 & 0.56 \\
\hspace{0.3cm} PM00000133 & Plate 1045 16mm & 17.2547 & Kg & 2.29 & 39.51 \\
\hline
\end{tabular}
\caption{Bill of Material}
\label{tab:my_label}
\end{table}
答案1
您可以尝试tikzmark
图书馆:
\documentclass{article}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{| l | l | c | c | r | r | }
\hline
Item & Description & Quantity & Units & Cost & Extended \\
\hline
\rowcolor{lightgray} Pulley & Pulley & 1.0 & Each & 15136.8 & 15136.8 \\
\rowcolor{lightgray} \tikzmark{Sh}Shell & 996.5 ID x 1856 Plate 4140 32mm & 1.0 & Each & 3516.04 & 3516.04 \\
\hspace{0.3cm} \tikzmark{PM19}PM00000019 & Weld MIG & 25.6763 & Kg & 1.2 & 30.81 \\
\hspace{0.3cm} \tikzmark{PM12}PM00000012 & Weld MIG & 1.0135 & Hr & 90.0 & 91.22 \\
\hspace{0.3cm} PM00000013 & Weld Prep & 1.7373 & Hr & 90.0 & 156.36 \\
\hspace{0.3cm} PM00000108 & Plate 4140 32mm & 1483.0046 & Kg & 2.15 & 3188.46 \\
\hspace{0.3cm} PM00000010 & Plate Roll & 0.5465 & Hr & 90.0 & 49.19 \\
\rowcolor{lightgray} EnddiskA & 996.5 x 355 x 70 Plate 1045 & 1.0 & Each & 1445.32 & 1445.32 \\
\hspace{0.3cm} PM00001024 & Ring Backing 270 x 390 x 16 & 1.0 & Each & 39.73 & 39.73 \\
\hspace{0.3cm} PM00000115 & Plate 4140 70mm & 578.2036 & Kg & 2.43 & 1405.03 \\
\hspace{0.3cm} PM00000020 & Plasma Cutter & 0.2141 & Hr & 1.0 & 0.21 \\
\hspace{0.3cm} PM00000021 & Oxy Cutter & 0.5586 & Hr & 1.0 & 0.56 \\
\hspace{0.3cm} PM00000133 & Plate 1045 16mm & 17.2547 & Kg & 2.29 & 39.51 \\
\hline
\tikz[remember picture] \foreach \i in {PM19,PM12} \draw[overlay] (pic cs:Sh) |- ([yshift=1.5mm]pic cs:\i);
\end{tabular}
\caption{Bill of Material}
\label{tab:my_label}
\end{table}
\end{document}