TikZ 中的不透明度会破坏 Beamer 中的整个结构

TikZ 中的不透明度会破坏 Beamer 中的整个结构

我正在用 Beamer 做演示。我想制作一张TikZ图片并在特定项目上局部更改其不透明度。当我这样做时,结构颜色发生了变化...

我将附上我的 preable 以及造成损害的框架......

\documentclass[slidestop,compress,11pt,xcolor=dvipsnames]{beamer}
\usefonttheme[onlymath]{serif}
\definecolor{LHCblue}{RGB}{4, 114, 255}
\usecolortheme[named=LHCblue]{structure}
\usepackage[bars]{beamerthemetree} % Beamer theme v 2.2
\usepackage{kerkis}
\mode<presentation>
\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
  \oldmacro\hfill%
  \insertframenumber\,}%/\,\inserttotalframenumber
\setbeamertemplate{footline}[frame number]
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\setbeamercovered{higly dynamic}
\usetheme[watermark=ntua-logo.jpg]{Ilmenau} % Beamer theme v 3.0
\useoutertheme[subsection=true]{smoothbars}%Beamer Outer Theme-circles on top

\useinnertheme{circles} %rectangle bullet points instead of circle ones
\usepackage{beamerthemebars}
\setbeamercolor{navigation symbols dimmed}{fg=red!80!black}
\setbeamercolor{navigation symbols}{fg=red!80!black}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\title[SRS/APV readout with mmDAQ/Recomm\hspace{1.5cm} Stony Brook, NYC]{rd51 mm     tracker \& SRS/APV readout using mmDAQ/Recomm}
\author[Stamatopoulos N. Athanasios\hspace{2.5cm}{[email protected]}]    {Stamatopoulos N. Athanasios}
\institute{NTUA/CERN}
\logo{%
  \makebox[0.99\paperwidth]{%
    \includegraphics[width=1cm,keepaspectratio]{cern_logo_white.jpg}%
    \hfill%
    \includegraphics[width=1cm,keepaspectratio]{ntua-logo.jpg}%
  }%
}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\usepackage{tikz}
\usepackage{multicol}
\usepackage{lmodern}
\usepackage{lipsum}
%\usepackage{graphicx}
\usepackage{marvosym}
%------------------tikz------------------------

\usetikzlibrary{%
calc,%
fadings,%
shadings%
}

\usetikzlibrary{arrows,snakes,shapes}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\transdissolve
\begin{columns}
\begin{column}{.48\textwidth}
\begin{tikzpicture}[scale=0.6]
\draw[->,color=red,thick](4,0) -- (-4,0);
\draw[yellow!60,fill,rounded corners,opacity=0.9] (3.5,2) rectangle (2.5,-2);%When applying opacity tha whole structure color is changed
\draw[yellow!60,fill,rounded corners,opacity=0.9] (2,2) rectangle (1,-2);
\draw[yellow!60,fill,rounded corners,opacity=0.9] (0.5,2) rectangle (-0.5,-2);
\draw[yellow!60,fill,rounded corners,opacity=0.9] (-1,2) rectangle (-2,-2);
\draw[yellow!60,fill,rounded corners,opacity=0.9] (-2.5,2) rectangle (-3.5,-2);

\draw[color=red] node at (5,0.5) {\footnotesize Beam};
\draw node at (3,-2.5) {\footnotesize mm2};
\draw node at (1.5,-2.5) {\footnotesize mm3};
\draw node at (0,-2.5) {\footnotesize mm4};
\draw node at (0,-3) {\footnotesize mm7};
\draw node at (-1.5,-2.5) {\footnotesize mm5};
\draw node at (-3,-2.5) {\footnotesize mm6};

\end{tikzpicture}\\
\hspace{1cm}
\end{column}%

\begin{column}{.48\textwidth}
\end{column}%
\end{columns}

\end{frame}
\end{document}

我再次修改了代码,以便成为真正的 MWE

不透明之前

不透明后

现在你看出区别了吗?

当我在图片中应用不透明度时,tikz整个结构的颜色都会发生变化!之前opacity它是生动的,然后它变得太苍白了......

有想法该怎么解决这个吗?

答案1

在我删除所有可能造成干扰的不必要代码之前和之后,我没有看到任何变化(无论是 Acrobat X 还是 SumatraPDF)。

\documentclass{beamer}
\usepackage{mwe,tikz,lmodern}
\definecolor{LHCblue}{RGB}{4, 114, 255}
\usecolortheme[named=LHCblue]{structure}
\usepackage[bars]{beamerthemetree} % Beamer theme v 2.2
\usetikzlibrary{decorations.pathmorphing} %<- Instead of snakes library which is obsolete

\title[My short title although it looks longer \hspace{1cm} than my long title]{My longer and longer title}
\author[My name\hspace{2.5cm}{[email protected]}]{My name}
\institute{NTUA/CERN}
\logo{%
  \makebox[0.99\paperwidth]{%
    \includegraphics[width=1cm,keepaspectratio]{example-image-a}%
    \hfill%
    \includegraphics[width=1cm,keepaspectratio]{example-image-b}%
  }%
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\begin{columns}
    \begin{column}{.48\textwidth}
        \begin{tikzpicture}[scale=0.6]
        \draw[->,color=red,thick](0,0) -- (-4,0);
        \draw[yellow!60,fill,rounded corners,opacity=0.9] (-1,2) rectangle (-2,-2);
        \end{tikzpicture}
    \end{column}%
    \begin{column}{.48\textwidth}
    \end{column}%
\end{columns}
\end{frame}
\end{document}

相关内容