在重组表中合并单元格(Sphinx => latexpdf)

时间:2015-10-08 20:02:16

标签: python-sphinx restructuredtext tex multirow

我在使用sphinx生成一些文档时遇到表问题。 我在rst文件中的表格如下所示:

.. tabularcolumns:: p{3.5cm}p{.5cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}
 +-------------------------+--------+--------+--------+--------+--------+--------+--------+
| Typ modelu              | ISM035 | ISM054 | ISM074 | ISM096 | ISM120 | ISM150 | ISM200 |
+--------------------+----+--------+--------+--------+--------+--------+--------+--------+
| Ciśnienie spalania | Pa | 35     | 40     | 45     | 45     | 50     | 50     | 50     |
+--------------------+----+--------+--------+--------+--------+--------+--------+--------+
| Spadki ciśnień komponentów Ø 80                                                        |
+--------------------+----+--------+--------+--------+--------+--------+--------+--------+
| Rura Ø 80 o dł 1m  | Pa | 2.3    | 6.4    | 11.7   | 19.2   | 25     | 34.9   | 52.4   |
(...)

以* .tex结尾:

\begin{tabulary}{\linewidth}{p{3.5cm}p{.5cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}}
\hline
\multicolumn{2}{|l|}{
Typ modelu
} & 
ISM035
 & 
ISM054
& 
ISM074
& 
ISM096
& 
ISM120
& 
ISM150
& 
ISM200
\\
\hline
Ciśnienie spalania
& 
Pa
& 
35
& 
40
& 
45
& 
45
& 
50
& 
50
& 
50
\\
\hline \multicolumn{9}{|l|}{
Spadki ciśnień komponentów Ø 80
}\\
\hline
Rura Ø 80 o dł 1m
& 
Pa
& 
2.3
& 
6.4
& 
11.7
& 
19.2
& 
25
& 
34.9
& 
52.4
\\
\hline

对我来说有什么问题是:    \多列{2} {| L |} {    (......)    \ hline \ multicolumn {9} {| l |} {

如何在创建多列时避免获取额外的规格?我想用“l”代替“| l |” ?

我遇到的第二个问题是antoher表,其中文本从表格单元格中出来:

.. tabularcolumns:: p{4cm}p{3cm}p{1.5cm}p{2cm}p{3cm}

+---------------------------+-----------------------+--------+-----------------------+------------------------------+
| Założenia                 | Komponent             | Ilość  | Spadek ciśnienia      | Suma spadku ciśniena         |
+===========================+=======================+========+=======================+==============================+
| Moduł ISM035,             | 1 metrowa rura 0 80   | 9 szt. | 2.3 Pa                | 20.7 Pa                      |
| ciśnienie spalania 35 Pa  +-----------------------+--------+-----------------------+------------------------------+
| wysokość komina 9m        | Parasol 0 80          | 1 szt. | 2 Pa                  | 2 Pa                         |
|                           +-----------------------+--------+-----------------------+------------------------------+
|                           | Trójnik 0 80          | 1 szt. | 5.9 Pa                | 5.9 Pa                       |
|                           +-----------------------+--------+-----------------------+------------------------------+
|                           | RAZEM                                                  | 28.6 Pa                      |
+---------------------------+--------------------------------------------------------+------------------------------+

从导出到html我得到的是: enter image description here

但是我从出口到pdf的结果很差:

  • 单元格外的文字
  • 这里需要额外的多列垂直线,但它会从我的第一张表中找出问题

enter image description here

网格表是从rest表中获取合并单元格的唯一方法吗?我应该如何格式化以便在pdf中正确显示?

0 个答案:

没有答案