Span multicolumn cells in LaTeX tables
This commit is contained in:
1 parent
04446e673f
commit
78ffd054d4
5 files changed
+124
-19
No files matched your search
@@ -5255,6 +5255,28 @@ mod source_tests {
|
||||
assert_eq!(second.caption.as_deref(), Some("Figure 1: Numbered"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tabular_multicolumn_cells_span_columns() {
|
||||
let source = r"\begin{tabular}{|l|c|}
|
||||
\multicolumn{2}{|c|}{Merged} \\
|
||||
A & B \\
|
||||
\end{tabular}";
|
||||
let (body, geometry) = geometry_and_body(source);
|
||||
let blocks = paragraphs(&body).unwrap();
|
||||
let document = build_document(&blocks, &geometry);
|
||||
let Some(VerticalItem::Halign(halign)) = document.units[0].items.first() else {
|
||||
panic!("expected halign");
|
||||
};
|
||||
assert_eq!(halign.rows[0].cells.len(), 1);
|
||||
assert_eq!(halign.rows[0].cells[0].text, "Merged");
|
||||
assert_eq!(halign.rows[0].cells[0].span, 2);
|
||||
assert_eq!(
|
||||
halign.rows[0].cells[0].alignment,
|
||||
texrra_tex_core::CellAlignment::Center
|
||||
);
|
||||
assert_eq!(halign.rows[1].cells.len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn table_floats_carry_their_tabular() {
|
||||
let source = r"\begin{table}[t]
|
||||
|
||||
Reference in new issue
Block a user