Compile the Huawei E template with tabularx and math vocabulary

This commit is contained in:
gloamxun committed 2026-10-20 00:30:03 +08:00
1 parent 07a4dcdda1
commit 0864536d6d
6 files changed
+49 -10

No files matched your search

+14 -3
View File
@@ -339,7 +339,17 @@ const PRELUDE: &str = r#"
\def\sum{∑}
\def\prod{∏}
\def\int{∫}
\def\bigcup{⋃}
\def\bigcap{⋂}
\def\bigoplus{⊕}
\def\bigotimes{⊗}
\def\bigodot{⊙}
\def\biguplus{⊎}
\def\bigsqcup{⨆}
\def\bigvee{⋁}
\def\bigwedge{⋀}
\def\oint{∮}
\def\Pr{\texrraoperatorstart Pr\texrraoperatorend}
\def\sin{\texrraoperatorstart sin\texrraoperatorend}
\def\cos{\texrraoperatorstart cos\texrraoperatorend}
\def\tan{\texrraoperatorstart tan\texrraoperatorend}
@@ -349,6 +359,7 @@ const PRELUDE: &str = r#"
\def\lim{\texrraoperatorstart lim\texrraoperatorend}
\def\max{\texrraoperatorstart max\texrraoperatorend}
\def\min{\texrraoperatorstart min\texrraoperatorend}
\def\*{*}
\def\quad{\hskip1em\relax}
\def\qquad{\hskip2em\relax}
\def\,{\texrramathspace{3}}
@@ -432,11 +443,11 @@ const PRELUDE: &str = r#"
\def\bigbreak{\bigskip}
\def\enspace{\hskip0.5em\relax}
\def\thinspace{\hskip0.16667em\relax}
\def\negthinspace{\hskip-0.16667em\relax}
\def\negthinspace{\hskip0pt\relax}
\def\medspace{\hskip0.22222em\relax}
\def\negmedspace{\hskip-0.22222em\relax}
\def\negmedspace{\hskip0pt\relax}
\def\thickspace{\hskip0.27778em\relax}
\def\negthickspace{\hskip-0.27778em\relax}
\def\negthickspace{\hskip0pt\relax}
\def\space{ }
\def\nobreakspace{ }
\def\ { }
+5 -2
View File
@@ -1534,7 +1534,7 @@ impl vm::Handlers<CompilerState> for OutputHandlers {
.current()
.map(str::to_owned);
let event = match environment.as_deref() {
Some("tabular") | Some("tabular*") | Some("longtable") => {
Some("tabular") | Some("tabular*") | Some("tabularx") | Some("longtable") => {
FrontendEventKind::TableCell
}
Some(environment) if is_math_alignment_environment(environment) => {
@@ -6307,8 +6307,11 @@ fn begin_environment_primitive(
input.as_mut().expansions_mut().push(flush);
}
}
let argument = if name == "tabular*" {
let argument = if name == "tabular*" || name == "tabularx" {
let _width = read_scanned_token_list(input)?;
if name == "tabularx" {
let _ = read_optional_bracketed_argument(input, token, "tabularx position")?;
}
Some(
read_scanned_token_list(input)?
.into_iter()