我尝试从 yaml 文件(使用 python)创建 latex 表来创建规范文档。我的想法是创建一个 longtable,在第一列中输入规范编号,在第二列中输入标题和说明。
在 yaml 规范中,我也有表格,我想将它们嵌入到这个 longtable 中。为此,我尝试直接使用表格,但对于长文本,分页符无法正确完成。
如何将表格正确嵌入长表中?嵌入的表格也应进行分页。问题是无法将长表嵌入到长表中
\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{german,longtable}
\usepackage{multirow}
\begin{document}
\renewcommand*{\arraystretch}{2}
\begin{longtable}{|p{3cm}|p{11cm}|}
\hline
\multirow{2}{=}{SPEC\_601} & \textbf{Specification 1}\\
\cline{2-2}
& Description of Specification 1\\
\hline
\multirow{2}{=}{SPEC\_602} & \textbf{Specification 2}\\
\cline{2-2}
& The table contains the description of the specification:
\begin{tabular}{|p{4cm}|p{3cm}|}
\hline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sit amet nisl suscipit adipiscing bibendum est ultricies. Mollis nunc sed id semper risus in hendrerit gravida rutrum. Accumsan lacus vel facilisis volutpat est. Suscipit tellus mauris a diam maecenas sed. Neque sodales ut etiam sit amet. Ipsum nunc aliquet bibendum enim facilisis gravida. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Elit eget gravida cum sociis natoque penatibus. Dictum varius duis at consectetur lorem donec. Ullamcorper velit sed ullamcorper morbi tincidunt. Suspendisse in est ante in nibh mauris cursus. Cras adipiscing enim eu turpis egestas. Ut ornare lectus sit amet. In dictum non consectetur a erat nam at lectus. & This is another long text\\
\hline
Test2 & Test2\\
\hline
Test3 & Test3 \\
\hline
Test4 & Test4 \\
\hline
\end{tabular}
\\
\hline
\multirow{2}{=}{SPEC\_603} & \textbf{Specification 3}\\
\cline{2-2}
& Description of Specification 3
\begin{tabular}{|l| l|}
\hline
Pin Number & Pin Description\\
1 & Description of Pin 1 \\
2 & Description of Pin 2 \\
\hline
\end{tabular}
\\
\hline
\end{longtable}
\end{document}