From: Ethan A M. <me...@uw...> - 2020-08-21 03:04:17
|
On Thursday, 20 August 2020 18:34:54 PDT Henri Menke wrote: > Currently the cairolatex terminal does not respect transparency options > given in the terminal setting. In this minimal example the > notransparent option is ignored: > > set terminal cairolatex png notransparent > set output "test.tex" > plot sin(x) > > Running this through gnuplot and then using `file' reveals that the > alpha channel is still present: > > $ gnuplot test.gnuplot && file test.png > test.png: PNG image data, 1500 x 900, 8-bit/color RGBA, non-interlace I think the raionale for the current code is that the png image created for inclusion in a LaTeX document must have a transparent background in order to support the "back" and "behind" attributes for text elements, since they will be drawn by the latex engine and then covered by inclusion of the graphics image. The structure of the latex processing is: render text elements that are "behind" or "back" \includegraphics{gnuplot_figure} render text elements that are "front" If you use a solid color background in the graphics image, it will hide any previously rendered text elements. Ethan > > With this patch the transparency setting will be honoured. The current > default setting of implicitly assuming transparency is unaltered. > --- > term/cairo.trm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/term/cairo.trm b/term/cairo.trm > index ee748dfe2..3ef76ecc6 100644 > --- a/term/cairo.trm > +++ b/term/cairo.trm > @@ -849,7 +849,7 @@ void cairotrm_graphics() > plot.background.g = cairo_params->background.g; > plot.background.b = cairo_params->background.b; > gp_cairo_set_background(cairo_params->background); > - if (ISCAIROLATEX || cairo_params->transparent) > + if (cairo_params->transparent) > gp_cairo_clear_background(&plot); > else > gp_cairo_solid_background(&plot); > |