我是 LaTeX 新手。我正在寻找一种方法来根据文档中可用的内容(自动)制作物料清单清单。
在下面的例子中,我展示了文档将包含什么以及我需要什么输出。
这可能吗?如果可以,怎么做?
在此先感谢您的帮助!
例如:
\documentclass[a4paper,10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage[section]{placeins}
\renewcommand\thesection{\arabic{section}}
\usepackage{lscape}
\begin{document}
\section{Need to Auto Generate Table from these Tables}
\subsection{Chap 1}
\begin{table}[h]
\caption{Parts}
\centering
\begin{tabularx}{.8\linewidth}{l X X r}
\toprule
Item No. & Part Number & Description & Qty. \\
\midrule
1 & Comp 1 & ABC & X \\
2 & Comp 2 & CDE & XX \\
\bottomrule
\end{tabularx}
\end{table}
\clearpage
\subsection{Chap 2}
\begin{table}[h]
\caption{Parts}
\centering
\begin{tabularx}{.8\linewidth}{l X X r}
\toprule
Item No. & Part Number & Description & Qty. \\
\midrule
1 & Comp 3 & BCD & XX \\
2 & Comp 4 & COD & XXX \\
\bottomrule
\end{tabularx}
\end{table}
\subsection{Reference (section not to be populated in output)}
\begin{tabularx}{\linewidth}{ c X X r}
\toprule
Description & Manufacturer & Model \# & Internal Part \#\\
\midrule
Comp 1 & Jack \& co & V1 & - \\
Comp 2 & Jill \& co & V2 & A1B2\\
\bottomrule
\end{tabularx}
\clearpage
\begin{landscape}
\subsection{Bill - (Required final output)}
\subsection*{Example}\\
\begin{table}[h]
\toprule
\begin{tabularx}{\linewidth}{ c X l l r}
\emph{Quantity} &
\emph{Description} &
\emph{Manufacturer} &
\emph{Model \#} &
\emph{Internal Part \#}\\
\midrule
X &
Comp 1 &
Jack \& co &
V1 &
- \\
\hline
XX &
Comp 2 &
Jill \& co &
V2 &
A1B2 \\
\hline
%etc
\bottomrule
\end{tabularx}
\end{table}
\clearpage
\end{landscape}
\end{document}
编辑-“请告诉我这是否真的可行。”