Beamer 关于 tikzpictures 和阴影的(隐式)选项

Beamer 关于 tikzpictures 和阴影的(隐式)选项

在尝试使用撕页效果在一份beamer文档中,我遇到了一个意想不到的问题。

如果你只采取的代码这个答案并编译它,你会得到:

文章被撕毁效果截图

如果你只是将类更改为beamer(并注释掉geometry包),你会得到:

beamer 上撕裂效果的截图

阴影末端出现了一条细细的(丑陋的)线(也不完全一样)。我试过了很多选项和代码的修改,查看了beamer文档(哎哟),但找不到任何关于如何删除这条细线(或者至少使它变白)的线索。

答案1

这个问题得到了一些投票,但答案却隐藏在评论中。总结:这种差异是由于 pdf 查看器造成的。

一切都与 Adob​​e Reader 配合良好,它应该始终作为参考。

为什么大多数观看者在article使用该职业时能发挥效果,而在beamer使用该职业时却不能,这仍然是一个谜。

根据记录,测试的代码是

\documentclass[a5paper]{beamer}
\usepackage{lipsum}   % To generate test text 
\usepackage{framed}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calc,shadows.blur,shadings}
\pgfmathsetseed{1} % To have predictable results
% Define a background layer, in which the parchment shape is drawn
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

% This is the base for the fractal decoration. It takes a random point between the start and end, and
% raises it a random amount, thus transforming a segment into two, connected at that raised point
% This decoration can be applied again to each one of the resulting segments and so on, in a similar
% way of a Koch snowflake.
\pgfdeclaredecoration{irregular fractal line}{init}
{
  \state{init}[width=\pgfdecoratedinputsegmentremainingdistance]
  {
    \pgfpathlineto{\pgfpoint{random*\pgfdecoratedinputsegmentremainingdistance}{(random*\pgfdecorationsegmentamplitude-0.02)*\pgfdecoratedinputsegmentremainingdistance}}
    \pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
  }
}

% define some styles
\tikzset{
   paper/.style={draw=black!10, blur shadow, shading=bilinear interpolation,
                 lower left=black!20, upper left=black!15, upper right=white, lower right=black!10},
   irregular border/.style={decoration={irregular fractal line, amplitude=0.2},
           decorate,
     },
   ragged border/.style={ decoration={random steps, segment length=7mm, amplitude=2mm},
           decorate,
   }
}

% Macro to draw the shape behind the text, when it fits completly in the
% page
\def\tornpaper#1{
\tikz{
  \node[inner sep=1em] (A) {#1};  % Draw the text of the node
  \begin{pgfonlayer}{background}  % Draw the shape behind
  \fill[paper] % recursively decorate the bottom border
        decorate[irregular border]{decorate{decorate{decorate{decorate[ragged border]{
        ($(A.south east) - (0, random*5mm)$) -- ($(A.south west) - (0, random*5mm)$)
        }}}}}
        -- (A.north west) -- (A.north east) -- cycle;
  \end{pgfonlayer}}
}


\begin{document}
\noindent
\tornpaper{
\parbox{.9\textwidth}{\lipsum[11]}
}

\bigskip
\noindent
\tornpaper{
\parbox{.9\textwidth}{\lipsum[15]}
}
\end{document}

相关内容