diff --git a/docs/STATUS.md b/docs/STATUS.md index cbc936a..d24b403 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -151,3 +151,5 @@ See `docs/ROADMAP.md` for concrete implementation plans. - Fonts: bundled reserved-glyph subsets in `assets/fonts-subset/` are used when the document charset is covered; arXiv PDF is about 0.29 MB. - New-template compatibility: the SIVP class file loads fully and `sn-article.tex` previews and exports a 17-page PDF (PDF figures render as placeholders). Its journal title block captures title, author/affiliation, corresponding-author stars, both e-mails, abstract, and keywords; class declaration option leakage is consumed. The Huawei E fragment compiles to 16 A4 pages. Generic support added for TeX `\if`/`\ifx`, `\newcount`, `\newdimen`, `\char`, `tabular*`/`tabularx`, math accents/operators/arrows, a 64-bit dimension scanner, and `geometry` `text={width,height}` blocks. Both fixtures are regression tests (`sivp_project_previews_and_exports_a_pdf`, `e_fixture_compiles`). + +- Lines whose justification ratio exceeds 3 fall back to natural spacing instead of stretching inter-word gaps across the measure. diff --git a/src/rust_typeset/math_layout.rs b/src/rust_typeset/math_layout.rs index 0685bf0..ebfc354 100644 --- a/src/rust_typeset/math_layout.rs +++ b/src/rust_typeset/math_layout.rs @@ -1348,11 +1348,14 @@ fn break_inline_items( } }); let ratio_magnitude = f64::from(line_box.glue_ratio.as_float()).abs(); - let ratio = if line_box.width < natural_width { + let mut ratio = if line_box.width < natural_width { -ratio_magnitude } else { ratio_magnitude }; + if ratio.abs() > 3.0 { + ratio = 0.0; + } let mut natural_pre_display_width = scaled_mm(pre_display_extra); let mut pre_display_width_uses_adjusted_glue = false; let mut pre_display_size = None;