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

Support pattern objects with dvipdfmx #761

Merged
merged 1 commit into from
Oct 29, 2019
Merged

Support pattern objects with dvipdfmx #761

merged 1 commit into from
Oct 29, 2019

Conversation

doraTeX
Copy link
Contributor

@doraTeX doraTeX commented Oct 28, 2019

pgfsys-dvipdfmx.def seems not to support patterns library fully. Patterns are sometimes lost with the following error:

dvipdfmx:warning: Object @pgfpatternobject3 used, but not defined. Replaced by null.

Test code

%#!latex + dvipdfmx
\documentclass[dvipdfmx]{article}
\usepackage{tikz}
\usetikzlibrary{patterns}

\def\test{\tikz\filldraw[pattern=north east lines] (0,0) ellipse (2 and 1);}

\begin{document}
%%% Uncomment only one of the following choices.
%[1] \test %%% works correctly
[2] \setbox0\hbox{\test}\test %%% FAILS: patterns are lost
%[3] $\mathchoice{\test}{\test}{}{}$ %%% FAILS: patterns are lost
%[4] \test\setbox0\hbox{\test}\test %%% works correctly
%[5] \test$\mathchoice{\test}{\test}{}{}$ %%% works correctly
\end{document}

Result

When you uncomment [2] or [3] and compile it with LaTeX (DVI mode) + dvipdfmx, you will get an unfilled ellipse like this:

image

Solution

This problem does not occur when compiled with XeTeX (xdvipdfmx). So I tried replacing the definition of \pgfsys@dvipdfmx@patternobj in pgfsys-dvipdfmx.def with the one in pgfsys-xetex.def. This workaround seems to work well.

@hmenke hmenke merged commit 8d88524 into pgf-tikz:master Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants