这是我的问题:
你看到我方块周围的黑色了吗?我不知道为什么会发生这种情况。我想把它去掉。顺便说一句,因为这个投影仪需要一张图片。请使用任何图片并将其重命名为“ logo.png
”。希望你能帮助我。谢谢!
这是我的 MWE:
\documentclass[]{beamer}
\beamertemplateshadingbackground{yellow!30!white}{cyan!20!white}
\usetheme{Boadilla}
\usepackage{ragged2e}
\usepackage[none]{hyphenat}
\sloppy
\usepackage{changepage}
\usepackage{textpos}
\usepackage{tikzducks}
\usepackage{amsmath}
\usepackage{contour}
%%%%%%%%%%%%%%%%%%%%%%% SET BEAMER FONT ON BLOCK %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamerfont{block body}{size=\small}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% SET THE INNER MARGIN OF BLOCKS %%%%%%%%%%%%%%%%%%%%%%%%%%%
\addtobeamertemplate{block begin}
{}
{\vspace{1ex plus 0.5ex minus 0.5ex} % Pads top of block
% separates paragraphs in a block
\setlength{\parskip}{24pt plus 1pt minus 1pt}%
\begin{adjustwidth}{-.2cm}{.3cm}
}
\addtobeamertemplate{block end}
{\end{adjustwidth}%
\vspace{2ex plus 0.5ex minus 0.5ex}}% Pads bottom of block
{\vspace{10ex plus 1ex minus 1ex}} % Seperates blocks from each other
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set Color ==============================
% Custom colors
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{shadings}
\colorlet{titleleft}{red!70!white} %Ganti warna gradasi kiri pada judul section
\colorlet{titleright}{cyan!70!white} %Ganti warna gradasi kanan pada judul section
% http://www.computerhope.com/htmcolor.htm
\definecolor{gold}{HTML}{FDD017}
\definecolor{deep sky blue}{HTML}{3BB9FF}
\definecolor{light sky blue}{HTML}{82CAFA}
\definecolor{mybackground}{HTML}{82CAFA}
\definecolor{myforeground}{HTML}{0000A0}
\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{alerted text}{fg=red}
\setbeamercolor{example text}{fg=black}
\setbeamercolor{background canvas}{fg=myforeground, bg=white}
\setbeamercolor{background}{fg=myforeground, bg=mybackground}
\setbeamercolor{palette primary}{fg=black, bg=gray!50!white} %Ganti warna bar pojok kanan bawah
\setbeamercolor{palette secondary}{fg=black, bg=gray!20!white}%Ganti warna bar tengah bawah
\setbeamercolor{palette tertiary}{fg=black, bg=red!70!white}%Ganti warna bar pojok kiri bawah
\setbeamercolor{frametitle}{fg=white} %Ganti warna tulisan pada frame judul
\setbeamercolor{title}{fg=white} %Ganti warna tulisan pada judul
\setbeamercolor{titlelike}{parent=structure, bg=red} %Ganti warna pada kotak judul
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{section in head/foot}%
\usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}\hspace*{2ex}\insertsubsectionhead
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%% GLOBAL SETTING OF ITEMSEP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\define@key{beamerframe}{wide}[5pt]{%
\def\beamer@cramped{\itemsep #1\topsep0.5pt\relax}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\defbeamertemplate*{title page}{mydefault}[1][]
{
\vbox{}
\vfill
\begin{centering}
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
% \usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
% \vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\end{centering}
\vfill
}
\setbeamertemplate{title page}[mydefault][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\pgfdeclarehorizontalshading[titleleft,titleright]{beamer@frametitleshade}{\paperheight}{%
color(0pt)=(titleleft);
color(\paperwidth)=(titleright)}
\defbeamertemplate*{frametitle}{horizontal shading}
{%
\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%
}%
\vskip-2pt
}
\pgfdeclareimage[width=.33\paperwidth]{white-logo}{}
\pgfdeclareimage[width=.33\paperwidth]{large-corner}{large-corner}
\newcommand\DoPurpleBackground{%
\pgfpathmoveto{\pgfpointorigin}
\pgfpathrectanglecorners{\pgfpoint{0pt}{0pt}}{\pgfpoint{\paperwidth}{-\paperheight}}
\pgfsetfillcolor{cyan!70!white}
\pgfusepath{fill}
\pgftext[at=\pgfpoint{\paperwidth}{-\paperheight},right,base]{\pgfuseimage{large-corner}}
}
\newenvironment{myfont1}{\fontfamily{pzc}\selectfont}{\par}
\newenvironment{myfont2}{\fontfamily{uncl}\selectfont}{\par}
\newcommand\ThankYouFrame{
\begin{frame}[plain,t]
\transboxout<1>[duration=2]
\begin{pgfpicture}
\pgf@relevantforpicturesizefalse
\pgftransformxshift{-\Gm@lmargin}
\pgftransformyshift{5.5pt}
\DoPurpleBackground
\pgftext[at=\pgfpoint{.5\paperwidth}{-.52\paperheight},center,center]{\pgfuseimage{white-logo}}
\pgftext[at=\pgfpoint{.5\paperwidth}{-.23\paperheight},center,center]{
\begin{myfont1}
\fontsize{50}{60}\selectfont\contour{yellow}{\color{red}Terima Kasih}
\end{myfont1}
}
\pgftext[at=\pgfpoint{.5\paperwidth}{-.8\paperheight},center,center]{
\begin{myfont2}
\small\structure{Universitas Jember}
\end{myfont2}
}
\end{pgfpicture}
\end{frame}
}
\makeatother
% Set Color ==============================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GANTI NAMA & JUDUL & DLL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Title}
\subtitle{\textbf{Another Title}}
\author[Me]{My Name is Who?}
\institute[FOO]{Institue \\ Insitute \\Insitute \\ Insitute}
\date{\today}
\titlegraphic{\includegraphics[height=2cm]{logo}\vspace*{.5cm}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% \frame{\maketitle}
\begin{frame}
\maketitle
\end{frame}
\section[Outline]{}
\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{100mm}(.85\textwidth, -1cm)
\includegraphics[height=1cm,width=1cm]{logo}
\end{textblock*}
}
\begin{frame}{Outline}
\transboxin<1>[duration=2]
\tableofcontents
\end{frame}
\begin{frame}[wide]{THIS IS WHAT}
\transpush<1>
\setbeamercovered{transparent}
\setbeamercolor{block title example}{use=structure,fg=white,bg=blue!80!black}
\setbeamercolor{block body example}{use=structure,fg=black,bg=blue!10!white}
\onslide<+->{\begin{beamercolorbox}[rounded=true]{block title example}
LIPSUM
\end{beamercolorbox}}
\onslide<+->{\begin{exampleblock}{LIPSUM}
\justifying
LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM LIPSUM
\end{exampleblock}}
\end{frame}
\end{document}
编辑 :
由于 @Werner 和 @schoekling 说他们没有遇到这个问题,所以我假设我的代码有问题,可能在一台设备上可以运行,但在另一台设备上却不行。我这样说是因为即使我使用了另一款 TeX 编辑器 TeXmaker,问题仍然存在(目前我使用的是 TeXstudio 最新版本)。所以,你能通过提供替代方案来回答我的问题吗beamorcolorbox
?我想要一个蓝色块。非常感谢!
答案1
升级到 beamer 软件包的最新版本。使用版本2021/03/19 v3.62
(例如包含在 TeXLive 2021 中)问题消失。相关修复发生在文件中beamerbaseboxes.sty
。
使用稍旧一点的版本,2020/11/26 v3.60
我可以重现该问题。它在以下情况下发生:
- 使用带圆角和阴影的框
- 盒子没有盖上,例如
\pause
- 隐藏元素的颜色设置为透明。
这是一个展示该问题的相当简单的例子:
\documentclass{beamer}
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamercovered{transparent}
\begin{document}
\begin{frame}
Some text
\pause
\begin{block}{Block title}
Block text.
\end{block}
\end{frame}
\end{document}
答案2
我评论道:
%\setbeamertemplate{块}[圆形][阴影=true]
问题就解决了。