Skip to content

Commit

Permalink
update \XC@mcolor in pgf.sty rather than pgfsys-latexml.def
Browse files Browse the repository at this point in the history
The change guarantees that \XC@mcolor is updated after color/xcolor are
loaded, but also before finishing loading PGF.
  • Loading branch information
xworld21 committed Aug 18, 2024
1 parent c3d682e commit 2ddfc0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions lib/LaTeXML/Package/pgf.sty.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ DefMacro('\pgfsetcolor{}', '\pgfsetcolor@orig{#1}\lxSVG@set@color');
DefPrimitive('\lxSVG@set@color', sub {
MergeFont(color => LookupValue('color_pgfstrokecolor')); });

# This seems to be needed to actually set colors (code similar to xxcolor.sty)
if (XEquals(T_CS('\XC@mcolor'), T_CS('\relax'))) {
Let('\XC@mcolor', '\@empty'); }
AddToMacro('\XC@mcolor', '\pgfsetcolor{.}');

# This makes this conditional always true; Why???
DefConditionalI('\ifpgf@relevantforpicturesize', undef, sub { 1; });
DefMacroI('\pgf@relevantforpicturesizefalse', undef, '');
Expand Down
3 changes: 0 additions & 3 deletions lib/LaTeXML/Package/pgfsys-latexml.def.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,6 @@ DefConstructor('\lxSVG@eorulefalse', '', alias => '\pgfsys@eorulefalse', s

DefMacro('\lxSVG@setcolor{}{}', '\ifpgfpicture\lxSVG@begingroup{#1={#2}}\fi');

# Need to defer until after color/xcolor are loaded!
AtBeginDocument('\def\XC@mcolor{\pgfsetcolor{.}}');

#=====================================================================
# Implementation

Expand Down

0 comments on commit 2ddfc0b

Please sign in to comment.