Implement native text accents for unmodified LaTeX jobs

This commit is contained in:
gloamxun committed 2026-11-20 16:15:30 +08:00
1 parent ca60c66a17
commit 4eeb5686b8
16 files changed
+269 -18

No files matched your search

@@ -312,7 +312,7 @@ impl Executor {
self.display.as_mut().unwrap().alignment = Some(list);
// fin_align's do_assignments runs in the empty display math list. In
// particular, the second closing shift is expanded before pop_nest.
let close = self.display_assignments(files)?;
let close = self.assignments_before_content(true, files)?;
if !matches!(
self.meaning(&close.token),
Meaning::Character(TokenKind::Character(_, CatCode::MathShift))
@@ -353,14 +353,19 @@ impl Executor {
self.display.take().unwrap();
self.resume_after_display(span, files)
}
fn display_assignments(
pub(super) fn assignments_before_content(
&mut self,
allow_setbox: bool,
files: &mut impl SourceProvider,
) -> Result<InputToken, Error> {
use Primitive::*;
loop {
let t = self.expanded_non_space(files)?;
match self.meaning(&t.token) {
let meaning = self.meaning(&t.token);
if !allow_setbox && Self::suppresses_meaning(&t, &meaning) {
continue;
}
match meaning {
Meaning::Primitive(Relax) => continue,
Meaning::Primitive(p)
if p.page_dimension().is_some()
@@ -431,7 +436,7 @@ impl Executor {
| Insertpenalties
) =>
{
self.assignment(Some(p), None, files)?
self.assignment_with_box_policy(Some(p), None, allow_setbox, files)?
}
Meaning::Count(n) => self.assignment(None, Some(Key::Count(n)), files)?,
Meaning::Toks(n) => self.assignment(None, Some(Key::Toks(n)), files)?,