tcolorbox 的內部漸層著色不起作用

tcolorbox 的內部漸層著色不起作用

我正在使用修改後的 IMSAloquium 模板。以下是我的程式碼

\documentclass[final]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{nicematrix}
\usepackage{xcolor}
\usepackage{utopia} %font utopia imported
\usepackage{setspace}  % <---
\setstretch{1.3}

\bibliographystyle{alpha}
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}
\usepackage{tikz-feynman}
\tikzfeynmanset{vanilla/.style=}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=0.5cm,text centered, draw=cyan, fill=cyan!20]
\tikzstyle{arrow} = [thick,->,>=stealth]

\usetikzlibrary{positioning}
\usetheme{imsa}
\usecolortheme{imsa}
\usefonttheme[onlymath]{serif}
\usepackage[most]{tcolorbox}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage[labelformat=empty]{caption}
\setbeamertemplate{background}
{\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{pointbackground.png}}
%------------------------------------------------------------

%Mergin selection%
\setbeamersize
{
    text margin left=0.7cm,
    text margin right=0.7cm
}
%This block of code defines the information to appear in the
%Title page





\setbeamertemplate{frametitle}{%
  \begin{tcolorbox}[colframe=blue,boxrule=0.5pt,top=0.7mm,bottom=0.7mm,grow to left by=5.8mm, grow to right by=5.9mm, before skip=0.07cm,
  interior style={left color=blue, right color=white}]
    \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle
  \end{tcolorbox}
}
\begin{document}



% Title Page
\frame{
\titlepage
}
\AtBeginSection[]
{
{
\setbeamertemplate{background}
{\includegraphics[width = \the\paperwidth, height = \the\paperheight]{toc.png}}
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection]
  \end{frame}
  }
}

\setbeamertemplate{background}
{\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{pointbackground.png}}

\small
\begin{frame}{Cross section}
    
\end{frame}


%Bibilographies
\begin{frame}[allowframebreaks]{Bibilography}
    \bibliography{bibitems}
\end{frame}
\end{document}

在框架標題框中,它應該提供漸變著色,如手冊所示,但事實並非如此。為什麼?

答案1

新增tcolorbox選項enhanced

來自tcolorbox軟體包手冊(v6.2.0,2024-01-10),秒。 10.1「樣式選項鍵」(第 172 頁)

如果→P.該選項 [ /tcb/interior style] 可用。/tcb/interior titled engine157/tcb/interior engine→P。 158設定為pathpathfirstpathmiddle、 或pathlast。它不適用於standard

最初,/tcb/interior enginestandard.因此要使其interior style生效,最小設定為interior engine=path

方便的enhanced選項是 的簡寫skin=enhanced,它將/tcb/graphical environment=tikzpicture所有繪圖引擎(包括/tcb/interior engine)設為path等。

相關內容