Track two-column class options in the document model
This commit is contained in:
1 parent
fb361b7df9
commit
3afa8dc6c1
2 files changed
+9
No files matched your search
@@ -122,6 +122,8 @@ pub struct DocumentModel {
|
|||||||
pub page: PageSize,
|
pub page: PageSize,
|
||||||
pub parindent: common::Scaled,
|
pub parindent: common::Scaled,
|
||||||
/// Base font size selected by the document class (10, 11, or 12pt).
|
/// Base font size selected by the document class (10, 11, or 12pt).
|
||||||
|
/// Number of text columns (1 for article, 2 for `iicol`/`twocolumn`).
|
||||||
|
pub columns: u8,
|
||||||
pub base_font_size: u8,
|
pub base_font_size: u8,
|
||||||
pub margins: PageMargins,
|
pub margins: PageMargins,
|
||||||
pub show_title: bool,
|
pub show_title: bool,
|
||||||
@@ -159,6 +161,7 @@ impl Default for DocumentModel {
|
|||||||
page: PageSize::default(),
|
page: PageSize::default(),
|
||||||
// article's default \parindent for 10/11pt text.
|
// article's default \parindent for 10/11pt text.
|
||||||
parindent: common::Scaled(17 * 65_536),
|
parindent: common::Scaled(17 * 65_536),
|
||||||
|
columns: 1,
|
||||||
base_font_size: 10,
|
base_font_size: 10,
|
||||||
margins: PageMargins::default(),
|
margins: PageMargins::default(),
|
||||||
show_title: false,
|
show_title: false,
|
||||||
|
|||||||
@@ -1121,6 +1121,12 @@ impl Parser {
|
|||||||
}
|
}
|
||||||
expanded::FrontendEventKind::Geometry(settings) => {
|
expanded::FrontendEventKind::Geometry(settings) => {
|
||||||
apply_class_font_size(&mut self.document, settings);
|
apply_class_font_size(&mut self.document, settings);
|
||||||
|
if settings
|
||||||
|
.split(",")
|
||||||
|
.any(|option| matches!(option.trim(), "iicol" | "twocolumn"))
|
||||||
|
{
|
||||||
|
self.document.columns = 2;
|
||||||
|
}
|
||||||
apply_geometry(&mut self.document, settings);
|
apply_geometry(&mut self.document, settings);
|
||||||
}
|
}
|
||||||
expanded::FrontendEventKind::TextStyleStart(style) => self.begin_style(*style),
|
expanded::FrontendEventKind::TextStyleStart(style) => self.begin_style(*style),
|
||||||
|
|||||||
Reference in new issue
Block a user