Skip to content

Only block fullpage/graphics in HTML, not PDF#270

Open
AbdelKharij wants to merge 2 commits into
XimeraProject:masterfrom
AbdelKharij:block-fullpage-graphics-html-only
Open

Only block fullpage/graphics in HTML, not PDF#270
AbdelKharij wants to merge 2 commits into
XimeraProject:masterfrom
AbdelKharij:block-fullpage-graphics-html-only

Conversation

@AbdelKharij

Copy link
Copy Markdown

Summary

  • fullpage/graphics are now only disabled by \ximera@blockpkg in the HTML build (guarded by \ifdefined\HCode), matching the project's standard PDF/HTML detection convention (see src/only.dtx). They load normally under plain pdflatex/lualatex, so \pdfOnly content depending on them keeps working.
  • Adds a cfgXimera section suppressing tex4ht's raster <img>/dvisvgm output for Ximera's internally-loaded \includegraphics, since blocking the package alone doesn't stop Ximera's own image machinery (see src/image.dtx) from still emitting markup in HTML.
  • Adds lualatex.pdf/lualatex.handout.pdf targets to luaxake's xake config, needed so XM_COMPILE_SEQUENCE=lualatex.pdf (new engine toggle in ximera-contribution-1) resolves to an actual build command instead of a no-op.

Test plan

  • Compiled a test doc with lualatex directly: fullpage/graphics load with no "conflicts with Ximera" warning; other blocked packages (geometry, authblk, setspace, fancyhdr, multicol, ragged2e) still warn as before.
  • Compiled the same doc via make4ht: all seven packages, including fullpage/graphics, now produce the block warning.
  • Checked the generated HTML has no <img> tag or reference to the test image.

AbdelKharij and others added 2 commits June 28, 2026 20:44
Adds a \ximera@blockpkg helper in src/packages.dtx that pre-declares
packages as already loaded (via \@namedef{ver@<pkg>.sty}), making
\usepackage a silent no-op with a warning in the compile log.

Blocked packages:
- geometry, fullpage: conflict with Ximera's hardcoded page dimensions
  (\oddsidemargin, \textwidth, etc. set in src/pagesetup.dtx)
- fancyhdr: conflicts with Ximera's titlesec-based \pagestyle{main}
- authblk: conflicts with Ximera's custom \author handling in src/title.dtx
- setspace, multicol, ragged2e: alter spacing/layout Ximera depends on

Also overrides \pagenumbering to a no-op with a warning, since
Ximera manages page numbering via its own pagestyle.

The original \pagenumbering is preserved as \ximera@old@pagenumbering
in case Ximera itself needs to call it internally in the future.
fullpage and graphics were unconditionally disabled by \ximera@blockpkg,
but they only actually conflict with Ximera's own page layout and image
handling in the HTML build (tex4ht's graphics.4ht clashes with Ximera's
graphicspath/image environment from src/image.dtx). In a plain PDF build
neither package causes problems, so \pdfOnly content relying on them was
being silently dropped for no reason. Guard both with \ifdefined\HCode,
the project's standard PDF/HTML detection (see src/only.dtx), so they
load normally under pdflatex/lualatex and are only blocked for HTML.

Blocking graphics in HTML on its own isn't enough, since Ximera's own
\includegraphics machinery is loaded internally regardless of whether
the user's package load was blocked. Added a cfgXimera section that
suppresses tex4ht's raster <img>/dvisvgm output for it, so no stray
image markup leaks into the HTML.

Also adds lualatex.pdf/lualatex.handout.pdf targets to luaxake's xake
config, needed so XM_COMPILE_SEQUENCE=lualatex.pdf (the new engine
toggle in ximera-contribution-1) actually resolves to a build command
instead of being a no-op.

Verified against both output paths: compiling with lualatex directly
loads fullpage/graphics with no warning, while compiling via make4ht
(tex4ht) produces the "conflicts with Ximera" warning for both and
the generated HTML has no leftover <img> tag for the test image.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@bartsnapp

bartsnapp commented Jul 16, 2026 via email

Copy link
Copy Markdown
Collaborator

@AbdelKharij

AbdelKharij commented Jul 16, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants