2

When using the Warsaw theme in Beamer, I keep seeing this annoying white stripe to the left of the frametitle box on each slide:

White line in the Warsaw theme in Beamer

Here is the complete presentation code that results into that problem for me:

\documentclass{beamer}

\usepackage[english]{babel}

\usetheme{Warsaw}

\begin{document}

  \begin{frame}
    \frametitle{Vertical line to the left of the title}

    \begin{itemize}
        \item This slide has a problem
    \end{itemize}

  \end{frame}

\end{document}

This is not the expected behaviour, is it? How could I repair it?

  • 1
    Can you provide the full code for that slide? Including the preamble, etc. – Alenanno Jan 10 '16 at 13:48
  • @Alenanno I have updated the question with a complete version of the presentation code that results into that problem for me. – Mikhail Dubov Jan 10 '16 at 14:08
  • Thank you. Can you test a different PDF viewer? The line doesn't appear here. – Alenanno Jan 10 '16 at 14:13
  • @Alenanno In Adobe Reader 10, it is quite interesting: the line is there but occasionally disappears when you start playing with the zoom, then appears again... – Mikhail Dubov Jan 10 '16 at 14:24
  • @Alenanno By the way, the line also disappears when I start customizing the template for the frametitle (via \setbeamertemplate{frametitle} ...), but I generally don't want to do that in my presentation because then I lose this nice gradient background. – Mikhail Dubov Jan 10 '16 at 14:25
2

That part of gradient background is essentially generated by the following code (beamerouterthemeshadow.sty line 23-25)

\pgfdeclarehorizontalshading[frametitle.bg,frametitle right.bg]{beamer@frametitleshade}{\paperheight}{%
  color(0pt)=(frametitle.bg);
  color(\paperwidth)=(frametitle right.bg)}

And applied here (line 42-83) (see \pgfuseshading{beamer@frametitleshade}?)

\defbeamertemplate*{frametitle}{shadow theme}
{%
  \nointerlineskip%
  \vskip-2pt%
  \hbox{\leavevmode
    \advance\beamer@leftmargin by -12bp%
    \advance\beamer@rightmargin by -12bp%
    \beamer@tempdim=\textwidth%
    \advance\beamer@tempdim by \beamer@leftmargin%
    \advance\beamer@tempdim by \beamer@rightmargin%
    \hskip-\Gm@lmargin\hbox{%
      \setbox\beamer@tempbox=\hbox{\begin{minipage}[b]{\paperwidth}%
          \vbox{}\vskip-.75ex%
          \leftskip0.3cm%
          \rightskip0.3cm plus1fil\leavevmode
          \insertframetitle%
          \ifx\insertframesubtitle\@empty%
            \strut\par%
          \else
            \par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
          \fi%
          \nointerlineskip
          \vbox{}%
          \end{minipage}}%
      \beamer@tempdim=\ht\beamer@tempbox%
      \advance\beamer@tempdim by 2pt%
      \begin{pgfpicture}{0pt}{0pt}{\paperwidth}{\beamer@tempdim}
        \usebeamercolor{frametitle right}
        \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
        \pgfusepath{clip}
        \pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
      \end{pgfpicture}
      \hskip-\paperwidth%
      \box\beamer@tempbox%
    }%
    \hskip-\Gm@rmargin%
  }%
  \nointerlineskip
    \vskip-0.2pt
    \hbox to\textwidth{\hskip-\Gm@lmargin\pgfuseshading{beamer@topshade}\hskip-\Gm@rmargin}
    \vskip-2pt
}

As you can see, this shading is exactly the same width as the paper. At the same time, it is clipped by a rectangle with the same width. Although it is logically wide enough to cover the white background, this will confuse PDF renderers so much.

So you may both exlarge the shading by

\pgfdeclarehorizontalshading[frametitle.bg,frametitle right.bg]{beamer@frametitleshade}{\paperheight}{%
  color(1pt)=(frametitle.bg);
  color(\paperwidth+1pt)=(frametitle right.bg)}

and comment out the line \pgfusepath{clip}. Now the shading exceeds the boundary of PDF and there should be no problem. Even if the problem still exists, I do not think there is anything to do with TeX.

| improve this answer | |
  • Thanks. Basically changing just "color(0pt)" to "color(-1pt)" in line 24 seems to fix the issue. – Mikhail Dubov Jan 11 '16 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.