![Beamer 模板底纹背景](https://linux22.com/image/386439/Beamer%20%E6%A8%A1%E6%9D%BF%E5%BA%95%E7%BA%B9%E8%83%8C%E6%99%AF.png)
我的投影仪幻灯片的背景有问题。当我在 PC(Windows 7,TeXLive 2015)上编译它时,我得到以下背景:
但是当我在 MacBook(Mojave,TeXLive 2018)上编译它时,我得到了以下背景:
我该如何修复它才能获得第一个?
\documentclass[red]{beamer}
\beamertemplateshadingbackground{red!70}{yellow!85}
\usepackage{verbatim}
\mode<article>
{
\usepackage{fullpage}
\usepackage[bookmarks=false]{hyperref}
}
\mode<presentation>
{
\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
\usetheme
{Darmstadt}
\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{%
\begin{beamercolorbox}[wd=3.7\paperwidth,ht=2.25ex,dp=1ex,left]{date in head/foot}%
\usebeamerfont{date in head/foot}
\hspace*{1ex} \insertframenumber{} / \inserttotalframenumber
\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}
\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\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%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\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{%
\beamer@sidebarformat{4pt}{section in sidebar}{\insertsectionhead}}}
\setbeamertemplate{section in sidebar shaded}{\vbox{%
\beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionhead}}}
\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}
\author[\unicodefont{\scriptsize \textcolor{yellow}{Tadayon, V.}}]{\vspace{-.2cm}\Large\textcolor{blue}{\unicodefont{Vahid Tadayon}}}
\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}
答案1
你首先设置了黄红色背景,但后来你用\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
如果删除这条线,就会得到黄红色的阴影。
关于您的代码的其他一些评论:
第一张图片中阴影的阴影不正确,表明您的 beamer 版本严重过时。您应该更新您的 tex 发行版
beamer 选项
red
已过时。请\usecolortheme[rgb={0.7,0.2,0.2}]{structure}
使用你不需要
xcolor
,graphicx
或者url
用投影仪不要多次加载包
使用 beamer进行加载没有什么意义
multicol
,因为 beamer 有自己的柱状机构你不应该
epsfig
在本世纪写的任何文件中使用times
已经过时了,有更好的 times 字体包而不是
colortbl
更好地将xcolor={table}
documentclass 选项传递给 beamer可选参数后的换行符
\date
毫无意义,且缺少强制参数
% !TeX TS-program = xelatex
\documentclass{beamer}
\usecolortheme[rgb={0.7,0.2,0.2}]{structure}
\beamertemplateshadingbackground{red!70}{yellow!85}
\mode<article>{
\usepackage{fullpage}
\usepackage[bookmarks=false]{hyperref}
}
\mode<presentation>{
%\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
\usetheme{Darmstadt}
}
%\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}