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

Buggy dvisvgm export for transparency group=knockout #1349

Open
tobiasBora opened this issue Jul 10, 2024 · 0 comments
Open

Buggy dvisvgm export for transparency group=knockout #1349

tobiasBora opened this issue Jul 10, 2024 · 0 comments
Labels

Comments

@tobiasBora
Copy link

Brief outline of the bug

I'd love to be able to use the awesome transparency group=knockout feature, that allows us to paint in transparent color to reveal the underlying image. For instance (taken from the doc):

\documentclass[dvisvgm]{minimal}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \shade [left color=red,right color=blue] (-2,-1) rectangle (2,1);
  \begin{scope}[transparency group=knockout]
    \fill[white] (-1.9,-.9) rectangle (1.9,.9);
    \node[opacity=0,font=\fontencoding{T1}\fontfamily{ptm}\fontsize{45}{45}\bfseries]{Ti\emph{k}Z};
  \end{scope}
\end{tikzpicture}
\end{document}

is supposed to write TikZ in a rainbow-like fashion. But since this is poorly supported by pdf viewers/printers, I wanted to export to svg directly. But running:

$ lualatex --output-format=dvi test
$ dvisvgm test
$ inkscape test.svg

gives me

image

which is not at all the expected result as we cannot read tikz in rainbow like colors, and the huge right margin is also weird.

Thanks a lot for considering this!

NB: I asked first in mgieseki/dvisvgm#272 and they told me that tikz needed to solve it on their side.

Minimal working example (MWE)

\documentclass[dvisvgm]{minimal}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \shade [left color=red,right color=blue] (-2,-1) rectangle (2,1);
  \begin{scope}[transparency group=knockout]
    \fill[white] (-1.9,-.9) rectangle (1.9,.9);
    \node[opacity=0,font=\fontencoding{T1}\fontfamily{ptm}\fontsize{45}{45}\bfseries]{Ti\emph{k}Z};
  \end{scope}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants