Expose active insertion height to pdfTeX macros

This commit is contained in:
gloamxun committed 2026-11-28 16:39:02 +08:00
1 parent 2fa11fb971
commit 7707cd9b09
7 files changed
+70 -4

No files matched your search

@@ -103,6 +103,7 @@ pub enum Primitive {
Pdfrefximage,
Pdflastximage,
Pdfximagebbox,
Pdfinsertht,
Pdflastximagepages,
Pdflastximagecolordepth,
Jobname,
@@ -533,6 +534,7 @@ impl Primitive {
| XeTeXselectorname
| Pdfstrcmp
| Pdfximagebbox
| Pdfinsertht
| Pdfmatch
| Pdflastmatch
| Pdfuniformdeviate
@@ -952,6 +954,7 @@ const PDFTEX_ONLY_PRIMITIVES: &[(&str, Primitive)] = {
("pdfrefximage", Pdfrefximage),
("pdflastximage", Pdflastximage),
("pdfximagebbox", Pdfximagebbox),
("pdfinsertht", Pdfinsertht),
("pdflastximagepages", Pdflastximagepages),
("pdflastximagecolordepth", Pdflastximagecolordepth),
("pdfcreationdate", Pdfcreationdate),
@@ -2015,6 +2018,11 @@ impl State {
self.update_profile_command("pdfximagebbox", Meaning::Primitive(Primitive::Pdfximagebbox), enabled);
}
pub(super) fn install_pdf_insertion_query_command(&mut self) {
let enabled = self.input_profile != super::InputProfile::XeTeX;
self.update_profile_command("pdfinsertht", Meaning::Primitive(Primitive::Pdfinsertht), enabled);
}
fn install_pdftex_primitives(&mut self) {
let enabled = self.input_profile != super::InputProfile::XeTeX;
for &(name, primitive) in PDFTEX_ONLY_PRIMITIVES {