Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only adjust black color during box operations #2456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/LaTeXML/Engine/TeX_Box.pool.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ sub adjustBoxColor_rec {
sub adjustBoxColor_internal {
my ($color, $box) = @_;
if (my $font = $box->getFont) {
$box->setFont($font->merge(color => $color)); }
if (Black->equals($font->getColor)) {
$box->setFont($font->merge(color => $color)); } }
return; }

DefPrimitive('\box Number', sub {
Expand Down
Binary file modified t/graphics/xcolors.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions t/graphics/xcolors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ \section{Boxes}
\copy\mybox
\setbox\mybox=\hbox{Should be Red!}
{\color{red}\copy\mybox}
\setbox\mybox=\hbox{The final word should be \textcolor{green}{green}}
\box\mybox

\section{Custom rgb directives}
\color{rgb:red,4;green,2;yellow,1} Brown
Expand Down
4 changes: 3 additions & 1 deletion t/graphics/xcolors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,9 @@ A=100*13 = 1300pt;</p>
<title><tag close=" ">11</tag>Boxes</title>
<para xml:id="S11.p1">
<p>Should NOT be Red!
<text color="#FF0000">Should be Red!</text></p>
<text color="#FF0000">Should be Red!</text>

The final word should be <text color="#00FF00">green</text></p>
</para>
</section>
<section inlist="toc" xml:id="S12">
Expand Down
Loading