\begin 與其定義不符

\begin 與其定義不符

我嘗試創建一個帶有文字的透明框。因此,我建立了一個名為 mybox 的新顏色框。

\usepackage[many]{tcolorbox}
\usepackage{lmodern}    % just to avoid font size warnings

\newtcolorbox{mybox}[1][]{
    width=20cm,
    arc=3mm,
%    auto outer arc,
    boxsep=0cm,
    coltext = white,
    colback = black,
    toprule=0pt,
    leftrule=0pt,
    bottomrule=0pt,
    rightrule=0pt,
    colframe=black,
    fontupper=\centering\fontsize{26pt}{26pt}\itshape,
    breakable,
    nobeforeafter,
    enhanced jigsaw,
    opacityframe=0.8,
    opacityback=0.8
}

然後我嘗試插入下面提到的文字。但我收到一個錯誤說\begin doesn't match its definition.我找不到原因。有人能找到原因嗎?注意:儘管存在該錯誤,該框仍已創建,但我無法將文字設為​​粗體。

\title{
\begin{mybox}[]
 \textbf{Voltage Regulation on a High PV penetrated Distributed System using Electric Vehicles}
\end{mybox}
  }

相關內容