1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Table Grid Parser System
//!
//! A state-aware grid parser for handling complex LaTeX table structures.
//!
//! This module provides robust parsing of LaTeX tables including:
//! - `\multirow` and `\multicolumn` support
//! - Sparse data tables (empty cells in the middle)
//! - Partial horizontal lines (`\cline`, `\cmidrule`)
//! - Nested table structures
//!
//! # Architecture
//!
//! The parser maintains a virtual grid state to correctly handle cell spanning:
//!
//! ```text
//! Raw LaTeX -> Pre-processing -> Grid State Machine -> Typst Generation
//! ```
//!
//! # Example
//!
//! ```ignore
//! use table::{CellAlign, parse_with_grid_parser};
//!
//! let alignments = vec![CellAlign::Left, CellAlign::Center, CellAlign::Right];
//! let typst_code = parse_with_grid_parser(content, alignments);
//! ```
// Re-export public API
pub use CellAlign;
pub use parse_with_grid_parser;