간단한 맞춤 Beamer 테마를 사용하고 있습니다.네오, 제가 한때 처음부터 만든 것입니다. 기본적으로 표준 Beamer 테마의 색상을 적용하므로 멋진 일이 실제로 발생하지 않습니다. 제목이 비어 있는 블록의 배경은 여전히 더 어두운 파란색입니다. 왜 이런 일이 발생합니까? 나는 이것을 담당하는 내 테마의 부분을 식별할 수 없습니다.
\documentclass{beamer}
\usetheme{neo}
\begin{document}
\frame{
\begin{block}{}
Here is my text...
\end{block}
}
\end{document}
답변1
새로운 솔루션
tcolorbox 내부 테마 버전 v0.5를 사용하면 빈 제목을 마음대로 켜거나 끌 수 있습니다.
\documentclass{beamer}
\usetheme{Berlin}
\useinnertheme[showtitle=false]{tcolorbox}
\begin{document}
\begin{frame}
\begin{block}{}
Here is my text...
\end{block}
\begin{block}{test}
Here is my text...
\end{block}
\end{frame}
\end{document}
기존 솔루션
비어 있지 않은 경우에만 제목을 인쇄합니다.
\documentclass{beamer}
\usetheme{Berlin}
\usepackage{xstring}
\setbeamertemplate{block begin}
{
\par\vskip\medskipamount%
\IfStrEq{\insertblocktitle}{}{}{
\begin{beamercolorbox}[colsep*=.75ex]{block title}
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
}
{\parskip0pt\par}%
\ifbeamercolorempty[bg]{block title}
{}
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
\usebeamerfont{block body}%
\begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\begin{document}
\begin{frame}
\begin{block}{}
Here is my text...
\end{block}
\begin{block}{test}
Here is my text...
\end{block}
\end{frame}
\end{document}
또 다른 (부분) 솔루션
이 문제는 둥근 블록에서는 발생하지 않으므로 이를 사용하되 모서리 반경이 0이 되도록 정의를 변경하는 것이 좋습니다.
다음 코드에서는 왼쪽 상단 모서리( %%%% CHANGED
코드에 표시됨)를 수정했지만 다른 모서리는 여전히 수정해야 합니다.
\documentclass{beamer}
\setbeamercolor{block title}{bg=blue}
\setbeamercolor{block body}{bg=blue!20}
\makeatletter
\renewcommand\beamerboxesrounded[2][]{%
\global\let\beamer@firstlineitemizeunskip=\relax%
\vbox\bgroup%
\setkeys{beamerboxes}{upper=block title,lower=block body,width=\textwidth,shadow=false}%
\setkeys{beamerboxes}{#1}%
{%
\usebeamercolor{\bmb@lower}%
\globalcolorstrue%
\colorlet{lower.bg}{bg}%
}%
{%
\usebeamercolor{\bmb@upper}%
\globalcolorstrue%
\colorlet{upper.bg}{bg}%
}%
%
% Typeset head
%
\vskip4bp
\setbox\bmb@box=\hbox{%
\begin{minipage}[b]{\bmb@width}%
\usebeamercolor[fg]{\bmb@upper}%
#2%
\end{minipage}}%
\ifdim\wd\bmb@box=0pt%
\setbox\bmb@box=\hbox{}%
\ht\bmb@box=1.5pt%
\bmb@prevheight=-4.5pt%
\else%
\wd\bmb@box=\bmb@width%
\bmb@temp=\dp\bmb@box%
\ifdim\bmb@temp<1.5pt%
\bmb@temp=1.5pt%
\fi%
\setbox\bmb@box=\hbox{\raise\bmb@temp\hbox{\box\bmb@box}}%
\dp\bmb@box=0pt%
\bmb@prevheight=\ht\bmb@box%
\fi%
\bmb@temp=\bmb@width%
\bmb@dima=\bmb@temp\advance\bmb@dima by2.2bp%
\bmb@dimb=\bmb@temp\advance\bmb@dimb by4bp%
\hbox{%
\begin{pgfpicture}{0bp}{+-\ht\bmb@box}{0bp}{+-\ht\bmb@box}
\ifdim\wd\bmb@box=0pt%
\color{lower.bg}%
\else%
\color{upper.bg}%
\fi%
\pgfpathqmoveto{-4.2bp}{3bp}
\pgfpathqcurveto{-2.2bp}{3bp}{-2.2bp}{3bp}{-2.2bp}{3bp} %%%% CHANGED
\pgfpathlineto{\pgfpoint{\bmb@temp}{3bp}}
\pgfpathcurveto%
{\pgfpoint{\bmb@dima}{3bp}}%
{\pgfpoint{\bmb@dimb}{1.2bp}}%
{\pgfpoint{\bmb@dimb}{-1bp}}%
\bmb@dima=-\ht\bmb@box%
\advance\bmb@dima by-2pt%
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfpathlineto{\pgfpoint{-4bp}{\bmb@dima}}
\pgfusepath{fill}
\end{pgfpicture}%
\copy\bmb@box%
}%
\nointerlineskip%
\vskip-1pt%
\ifdim\wd\bmb@box=0pt%
\else%
\hbox{%
\begin{pgfpicture}{0pt}{0pt}{\bmb@width}{60pt}
\bmb@dima=\bmb@width%
\advance\bmb@dima by8bp%
\pgfpathrectangle{\pgfpoint{-4bp}{-1bp}}{\pgfpoint{\bmb@dima}{8bp}}
\pgfusepath{clip}
{\pgftransformshift{\pgfpoint{-4bp}{0bp}}\pgftext[left,base]{\pgfuseshading{bmb@transition}}}%
\end{pgfpicture}%
}%
\nointerlineskip%
\vskip-0.5pt%
\fi%
\ifbmb@shadow%
\setbox\bmb@boxshadow=\hbox{\pgfuseshading{bmb@shadow}}%
\setbox\bmb@boxshadowball=\hbox{\pgfuseshading{bmb@shadowball}}%
\setbox\bmb@boxshadowballlarge=\hbox{\pgfuseshading{bmb@shadowballlarge}}%
\fi%
\setbox\bmb@colorbox=\hbox{{\pgfpicturetrue\pgfsetcolor{lower.bg}}}%
\setbox\bmb@box=\hbox\bgroup\begin{minipage}[b]{\bmb@width}%
\vskip2pt%
\usebeamercolor[fg]{\bmb@lower}%
\colorlet{beamerstructure}{upper.bg}%
\colorlet{structure}{upper.bg}%
%\color{.}%
}
\def\endbeamerboxesrounded{%
\end{minipage}\egroup%
\wd\bmb@box=\bmb@width%
\bmb@temp=\dp\bmb@box%
\advance\bmb@temp by.5pt%
\setbox\bmb@box=\hbox{\raise\bmb@temp\hbox{\box\bmb@box}}%
\dp\bmb@box=0pt%
\bmb@temp=\wd\bmb@box%
\bmb@dima=\bmb@temp\advance\bmb@dima by2.2bp%
\bmb@dimb=\bmb@temp\advance\bmb@dimb by4bp%
\hbox{%
\begin{pgfpicture}{0bp}{0bp}{0bp}{0bp}
\ifbmb@shadow%
{\pgftransformshift{\pgfpoint{4bp}{-3bp}}\pgftext{\copy\bmb@boxshadowball}}
\begin{pgfscope}
{%
\advance\bmb@temp by-1bp%
\pgfpathrectangle{\pgfpoint{\bmb@temp}{-7bp}}{\pgfpoint{9bp}{9bp}}%
\pgfusepath{clip}
}%
{\pgftransformshift{\pgfpoint{\bmb@temp}{1bp}}\pgftext{\box\bmb@boxshadowballlarge}}
\end{pgfscope}
\begin{pgfscope}
\advance\bmb@temp by-4bp%
\pgfpathrectangle{\pgfpoint{4bp}{-7bp}}{\pgfpoint{\bmb@temp}{5bp}}
\pgfusepath{clip}
{\pgftransformshift{\pgfpoint{4bp}{-7bp}}\pgftext[left,base]{\copy\bmb@boxshadow}}%
\end{pgfscope}
\begin{pgfscope}
\advance\bmb@temp by 4bp%
\bmb@dima=\ht\bmb@box%
\advance\bmb@dima by\bmb@prevheight%
\advance\bmb@dima by 4bp%
\pgfpathrectangle{\pgfpoint{\bmb@temp}{1bp}}{\pgfpoint{4bp}{\bmb@dima}}
\pgfusepath{clip}
\advance\bmb@dima by-4bp%
{\pgftransformshift{\pgfpoint{\bmb@temp}{\bmb@dima}}\pgftext{\box\bmb@boxshadowball}}
\advance\bmb@dima by-1bp%
\pgfpathrectangle{\pgfpoint{\bmb@temp}{1bp}}{\pgfpoint{4bp}{\bmb@dima}}
\pgfusepath{clip}
\advance\bmb@temp by4bp%
{\pgftransformshift{\pgfpoint{\bmb@temp}{-3bp}}%
\pgftransformrotate{90}%
\pgftext[left,base]{\box\bmb@boxshadow}}%
\end{pgfscope}
\fi%
\unhbox\bmb@colorbox%
\pgfpathqmoveto{-4bp}{1bp}
\pgfpathqcurveto{-4bp}{-1.2bp}{-2.2bp}{-3bp}{0bp}{-3bp}
\pgfpathlineto{\pgfpoint{\the\bmb@temp}{-3bp}}
\pgfpathcurveto%
{\pgfpoint{\the\bmb@dima}{-3bp}}%
{\pgfpoint{\the\bmb@dimb}{-1.2bp}}%
{\pgfpoint{\the\bmb@dimb}{1bp}}%
{
\bmb@dima=\ht\bmb@box%
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfpathlineto{\pgfpoint{-4bp}{\bmb@dima}}
\pgfusepath{fill}
}
\ifbmb@shadow%
{
\color{black!50!bg}
\pgfsetlinewidth{0pt}
\pgfpathmoveto{\pgfpoint{\bmb@dimb}{-.5bp}}
\bmb@dima=\ht\bmb@box%
\advance\bmb@dima by\bmb@prevheight%
\advance\bmb@dima by 1bp%
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfusepath{stroke}
\bmb@temp=\bmb@dima
\advance\bmb@dima by 1bp%
\color{black!31!bg}
\pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}}
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfusepath{stroke}
\advance\bmb@dima by 1bp%
\advance\bmb@temp by 1bp%
\color{black!19!bg}
\pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}}
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfusepath{stroke}
\advance\bmb@dima by 1bp%
\advance\bmb@temp by 1bp%
\color{black!6!bg}
\pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}}
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfusepath{stroke}
\advance\bmb@dima by 1.5bp%
\advance\bmb@temp by 1bp%
\color{bg}
\pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}}
\pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
\pgfusepath{stroke}
}
\fi
\end{pgfpicture}%
\box\bmb@box%
}%
\ifbmb@shadow%
\vskip4bp minus 2bp%
\else%
\vskip2bp%
\fi%
\egroup% of \vbox\bgroup
}
\makeatother
\setbeamertemplate{block begin}
{%
\par\vskip\medskipamount%
\begin{beamerboxesrounded}[upper=block title,lower=block body]%
{\raggedright\usebeamerfont*{block title}\insertblocktitle}%
\raggedright%
\usebeamerfont{block body}%
}
\setbeamertemplate{block end}
{\end{beamerboxesrounded}\vskip\smallskipamount}
\begin{document}
\begin{frame}
\begin{block}{}
content...
\end{block}
\end{frame}
\end{document}