3

Here's my MWE:

% !TeX program = XeLaTeX
\documentclass[9pt]{beamer}  

\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{backgrounds}

\tikzstyle{blurredShadow} = [rectangle, thick, draw=none, minimum width=1.5cm, minimum height=0.5cm, fill=green!50, blur shadow={shadow opacity=40}]

\begin{document}

\begin{frame}
\begin{center}
\begin{tikzpicture}[node distance=2cm]
tikzstyle{every node}=[font=\scriptsize]

\node (one) {Blabla};
\node (two) [right of=one]{
  \begin{tabular}{c}
        Blabla \\
        \& Blublu \\
    \end{tabular}
    };

\begin{scope}[on background layer]
\node [blurredShadow, above of=one, yshift=-2cm] { };
\node [blurredShadow, above of=two, yshift=-2cm, minimum height=1.5cm] { };
\end{scope}

\end{tikzpicture}

\end{center}
\end{frame}

\end{document}

gives me this:

pgf-blur glitch

The glitch does not occur when compiling with pdfLaTeX. However, I need to use XeLaTex because I need to use the fontspec package.

Linux 64bit Ubuntu 16.04. Tex version: TeX 3.14159265 (TeX Live 2015/Debian)

The following solution to a similar problem did not work for me: Define driver by setting\def\pgfsysdriver{pgfsys-dvipdfmx.def}

Does anyone know a solution?

jmjr
  • 187
  • 1
  • 8

1 Answers1

1

As a temporary workaround you can pass the height and width to the style.

\documentclass[9pt]{beamer}  

\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{backgrounds}

\tikzset{blurredShadow/.style 2 args={rectangle, thick, draw=none, minimum
width=#1, minimum height=#2, fill=green!50, blur shadow={shadow
opacity=40}}}

\begin{document}

\begin{frame}
\begin{center}
\begin{tikzpicture}[node distance=2cm]
tikzstyle{every node}=[font=\scriptsize]

\node (one) {Blabla};
\node (two) [right of=one]{
  \begin{tabular}{c}
        Blabla \\
        \& Blublu \\
    \end{tabular}
    };

\begin{scope}[on background layer]
\node [blurredShadow={1.5cm}{1.5cm}, above of=two, yshift=-2cm] { };
\node [blurredShadow={1.5cm}{0.5cm}, above of=one, yshift=-2cm] { };
\end{scope}

\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
jmjr
  • 187
  • 1
  • 8
  • Doesn't work for me when using XeLaTeX. Did you try with XeLaTeX? – jmjr Mar 02 '18 at 15:01
  • @jmjr Ooops, sorry! Now better? –  Mar 02 '18 at 17:56
  • Unfortunately no. Still not working as supposed. – jmjr Mar 02 '18 at 21:54
  • 1
    @jmjr You won't like it, but on my TeXLive 2017 installation the shadows show correctly if I compile with xelatex. That is, I was able to reproduce your output with your original snippet (and with xelatex), but this one shows the appropriate shadows. –  Mar 03 '18 at 02:13
  • Thanks for the hint. I installed texlive 2017 ("vanilla"). Unfortunately shadows are still incorrect (using your code). Do you have any ideas as to why that is? – jmjr Mar 11 '18 at 20:36
  • @marmot See https://tex.stackexchange.com/a/445321/2388 – Ulrike Fischer Aug 09 '18 at 13:40
  • @UlrikeFischer Yes, that's clearly better. These questions have been around and other solutions have proposed, but I think yours is better. (And I wrote "temporary workaround" in March, which is also correct. ;-) –  Aug 09 '18 at 14:19