# Beamer template shading background

I have a problem with the background of my beamer slides. When I compile it on my PC (Windows 7, TeXLive 2015) I get the following background:

But when I compile it on my MacBook (Mojave, TeXLive 2018) I get the following background:

How can I fix it to get the first one?

\documentclass[red]{beamer}
\usepackage{verbatim}
\mode<article>
{
\usepackage{fullpage}
\usepackage[bookmarks=false]{hyperref}
}

\mode<presentation>
{

\usetheme
\useoutertheme[height=0pt,width=2cm,left,]{sidebar}
\setbeamerfont{section in sidebar}{size=\fontsize{8.7}{8.6}\selectfont}
\setbeamerfont{subsection in sidebar}{size=\fontsize{5.7}{6.7}\selectfont}

\useinnertheme{circles}
}
\usefonttheme{serif}

\usepackage{fontspec}
\usepackage{calligra}
\newfontfamily\unicodefont{Remachine Script Personal Use}
\input Starburst.fd
\newcommand*\initfamily{\usefont{U}{Starburst}{xl}{n}}
\newcommand*{\myfont}{\fontfamily{lmr}\selectfont}

\usepackage[
final
]{pdfcomment}
\usepackage[mathscr]{euscript}
\usepackage{multirow}
\usepackage{xcolor}
\usepackage{ragged2e}
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
\newcommand*{\Scale}[2][4]{\scalebox{#1}{$#2$}}
\usepackage{pdfpages}

\usepackage{url}
\newfontface\Edwardian{Edwardian Script ITC}
\newfontface\Kunstler{Kunstler Script}

\hypersetup{pdfpagemode=FullScreen}

\definecolor{Red}{rgb}{1,0,0}
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Green}{rgb}{0,1,0}
\definecolor{magenta}{rgb}{1,0,.6}
\definecolor{lightblue}{rgb}{0,.5,1}
\definecolor{lightpurple}{rgb}{.6,.4,1}
\definecolor{gold}{rgb}{.6,.5,0}
\definecolor{orange}{rgb}{1,0.4,0}
\definecolor{hotpink}{rgb}{1,0,0.5}
\definecolor{newcolor2}{rgb}{.5,.3,.5}
\definecolor{newcolor}{rgb}{0,.3,1}
\definecolor{newcolor3}{rgb}{1,0,.35}
\definecolor{darkgreen1}{rgb}{0, .35, 0}
\definecolor{darkgreen}{rgb}{0, .6, 0}
\definecolor{darkred}{rgb}{.75,0,0}

\xdefinecolor{olive}{cmyk}{0.64,0,0.95,0.4}
\xdefinecolor{purpleish}{cmyk}{0.75,0.75,0,0}

\setbeamertemplate{footline}[text line]{
\hbox{%
\hspace*{5ex} \insertshortdate
\end{beamercolorbox}%
}
} % makes the footer EMPTY

% include packages
\usepackage{subfigure}
\usepackage{multicol}
\usepackage{amsmath,booktabs}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage[all,knot]{xy}
\xyoption{arc}
\usepackage{url}
\usepackage{amsthm, amssymb, amsmath, amsfonts}
\usepackage{times}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}
\input{commands}

\setbeamercovered{transparent=10}
\newcommand{\warp}{\mathbf{W}(\mathbf{x};\mathbf{p})}

\newfontfamily\farsifont[Script=Arabic]{XB Niloofar}

\makeatletter
\TeXXeTstate=1
\def\farsitext#1{\begingroup\beginR\farsifont#1\endR\endgroup}
\setbeamertemplate{frametitle}{
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\vspace*{0.055cm}
\begin{beamercolorbox}[sep=0.3cm,center,wd=\the\@tempdima]{frametitle}
\usebeamerfont{frametitle}%
\vbox{}\vskip-1ex%
\if@tempswa\else\csname beamer@ftecenter\endcsname\fi%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
\end{beamercolorbox}%
}
\def\th@mystyle{%
\normalfont % body font
\setbeamercolor{block title example}{bg=orange,fg=white}
\setbeamercolor{block body example}{bg=orange!20,fg=black}
\def\inserttheoremblockenv{exampleblock}
}
%%% %%%%%%%
\setbeamertemplate{section in sidebar}{\vbox{%
\setbeamertemplate{section in sidebar shaded}{\vbox{%
\makeatother

\newenvironment{variableblock}[3]{
\setbeamercolor{block body}{#2}
\setbeamercolor{block title}{#3}
\begin{block}{#1}}
{\end{block}}

\newenvironment{varblock}[4][.9\textwidth]{
\setlength{\textwidth}{#1}
\setbeamercolor{block body}{#3}
\setbeamercolor{block title}{#4}
\begin{block}{#2}}
{\end{block}}

\usepackage{colortbl}
\usepackage{times}
\usepackage[english]{babel}

\usepackage[utf8]{inputenc}
\usepackage{pstricks,pst-node,pst-text,pst-3d}
\usepackage[T1]{fontenc}
\usepackage{xunicode}% provides unicode character macros
\usepackage{xltxtra}
\usepackage{multicol}

\AtBeginSubsection[]
{
\begin{frame}<beamer>
\frametitle{\initfamily Outline}
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}

\def\XePersian{\leavevmode$\smash{\hbox{X\lower.5ex \hbox{\kern-.125em{E}}Persian}}$}%\reflect{E}

\title[\textcolor{yellow}{Analysis of Non-Gaussian Spatial Models with Covariates Measurement Error}]
{\Large  Analysis of Non-Gaussian Spatial Models with Covariates Measurement Error}
%\subtitle{The Beamer Class}
\institute[SCU]{\normalsize \unicodefont Department of Statistics, \\Shahid Chamran University \\ Supervisor: Prof. A. Rasekh}
\date[{Ph.D. Thesis in Statistics} \hspace{5.3cm}December 4, 2018]\\% \tiny November 2011

\begin{document}

\tikzstyle{every picture}+=[remember picture]
\tikzstyle{na} = [baseline=-.5ex]

\everymath{\displaystyle}

\frame{
\vspace{-.6cm}
\begin{center}%\\[.2cm]
\calligra
%\Kunstler
\vspace{0.3cm}
{%\textcolor{black}
}% \\[.25cm]
\end{center}
\vspace{-.4cm}
\titlepage
}

\begin{frame}
\frametitle{\initfamily Outline}
\tableofcontents[pausesections]
\end{frame}

\end{document}

• You MWE does not compile for me. I have to add \usepackage{tikz} and \initfamily is not defined. I also get a warning about the red class option being obsolete. If I fix these issues I do get the yellow to red shading, so I can't reproduce your MacOS issue. I run texlive 2018 under Linux. – David Purton Nov 24 '18 at 8:22
• The first thing I would try is to compile your actual MWE on both platforms and see if you get a difference. (Since it doesn't compile as you have it, I assume you haven't actually tried this.) Then, my hunch is that the problem is related to the shadow under the box. The shadow colour matches under MacOS, but doesn't match under your PC screenshot. Just a guess though. – David Purton Nov 24 '18 at 8:24
• The not matching shading in your first images suggestions, that your beamer version is seriously outdated. – user36296 Nov 24 '18 at 14:18
• Your code does not compile, but if I add all the necessary package and invent some definitions for some unknown commands, the difference in the colour can be explained by an syntax error: You must not have an empty line between \mode<article> and {. This has the effect that sometimes you are overwriting your background with \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10] sometimes not, depends on how different versions treat the empty line. Same goes for the linebreak between \usetheme and {Darmstadt}. – user36296 Nov 24 '18 at 14:30
• Can you clarify which of the backgrounds you want? – user36296 Nov 24 '18 at 15:26

You first set your yellow-red background, but later you overwrite it with \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]

If you remove this line, you get the yellow-red shading.

• The incorrect shading of the shadow in your first image indicates that your beamer version is seriously outdated. You should update your tex distribution

• the beamer option red is obsolete. Use \usecolortheme[rgb={0.7,0.2,0.2}]{structure} instead

• You don't need xcolor, graphicx or url with beamer

• don't load packages multiple times

• It makes little sense to load multicol with beamer, because beamer has it's own column mechanism

• you should not use epsfig in any document written in this millennium

• times is obsolete, there are much better packages for times font

• instead of colortbl better pass xcolor={table} as documentclass option to beamer

• The new line after the optional argument of \date makes no sense and the mandatory argument is missing

% !TeX TS-program = xelatex
\documentclass{beamer}

\usecolortheme[rgb={0.7,0.2,0.2}]{structure}

\mode<article>{
\usepackage{fullpage}
\usepackage[bookmarks=false]{hyperref}
}

\mode<presentation>{
}

%\usepackage{xcolor}
%\usepackage{url}
%\usepackage{multicol}
%\usepackage{amsmath}
%\usepackage{epsfig}
%\usepackage{graphicx}
%\usepackage{url}
%\usepackage{times}
%\usepackage{colortbl}
%\usepackage{times}
%\usepackage{multicol}

\title[\textcolor{yellow}{Analysis of Non-Gaussian Spatial Models with Covariates Measurement Error}]
{\Large  Analysis of Non-Gaussian Spatial Models with Covariates Measurement Error}
\date[{Ph.D. Thesis in Statistics} \hspace{5.3cm}December 4, 2018]{}%\\% \tiny November 2011

\begin{document}

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

\end{document}