我怎样才能在投影机中完成这个块

我怎样才能在投影机中完成这个块

我怎样才能在 Beamer 中做到这一点在此处输入图片描述

这是我在 R sweave 中的代码

\documentclass[12pt,xcolor={svgnames},aspectratio=169]{beamer}
\usetheme{Madrid}
\definecolor{aggiemaroon}{RGB}{80,0,0} 
\usecolortheme[named=aggiemaroon]{structure}
\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\useoutertheme{shadow}
\useinnertheme{rounded}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{structure}{family=\rmfamily,series=\bfseries}
\usefonttheme[stillsansseriftext]{serif}
\usepackage{tikz}
\usepackage{tcolorbox}
\usetikzlibrary{arrows,shapes,calc,positioning,shadows,trees,decorations.markings}
\tcbuselibrary{skins,breakable,raster}
\definecolor{darkred}{rgb}{0.55, 0.0, 0.0} 
\definecolor{myred}{RGB}{209,23,23}
\definecolor{myorange}{RGB}{255,153,51}
\definecolor{mypurple}{RGB}{102,0,102}
\definecolor{mygrey}{RGB}{200,200,200}
\newtcolorbox{mybox}[2]{%
    empty,
    coltitle = #1,
    title = #2,
    overlay ={
        \draw[mygrey,line width=1pt]
        (frame.north west)--(frame.north east)--(frame.south east)--(frame.south west)--(frame.north west);
        \draw[#1,line width=1pt]
        ($(frame.north west)!0.33!(frame.south west)$)
        --(frame.north west)
        --($(frame.north west)!0.33!(frame.north east)$);
        \draw[#1,line width=1pt]
        ($(frame.south east)!0.33!(frame.south west)$)
        --(frame.south east)
        --($(frame.south east)!0.33!(frame.north east)$);
    }
}
\tcbset{marktext/.style={%
        overlay={\node[rotate=90,text=black,anchor=north east] at (frame.north west){#1};},
        code={\setbox\z@=\color@hbox#1\color@endbox\tcbdimto\myheight{\wd\z@+3mm}},
        minimum for equal height group=\tcb@ehgid:\myheight,
}}

\makeatletter
 
\long\def\beamer@@frametitle[#1]#2{% 
\beamer@ifempty{#2}{}{% 
\gdef\insertframetitle{\centering{#2\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle continuation}\fi}}% 
\gdef\beamer@frametitle{#2}% 
\gdef\beamer@shortframetitle{#1}% 
            }% 
          } 
\newenvironment{noheadline}{
\setbeamertemplate{noheadline}{}
\addtobeamertemplate{frametitle}{\vpace*{-0.9\○baselineskip}}{}
          }{}
\makeatother 
\title[Master Economie appliquée]{Test de point de changement CUSUM pour les séries financières basées sur SVR}
\author [Chaymae HAFID ]{Chaymae HAFID}
\date[ \today]{\today}
\institute{\textbf{Encadré par: Pr. ALJ $\&$ Pr .TOUIJAR}} 
\begin{document}
\SweaveOpts{concordance=TRUE}
\begin{frame}[plain,noframenumbering]
\includegraphics[width=1\textwidth]{ghuf.PNG}
\titlepage
\end{frame}
 \begin{frame}{Table de matières}
\tableofcontents
\end{frame}
\section{Introduction}
 \begin{frame}[fragile]{This is a \texttt{fragile} frame}
\begin{block}{This is a R chunk}
<<oneandone>>=
 1+1
@
\end{block}
 \end{frame}
\begin{frame}
\begin{tcbraster}[%
    raster columns=3,
    raster equal height=rows
    ]
\begin{mybox}{myred}{Title 1}
                some text in the first box
\end{mybox}
\begin{mybox}{myorange}{Title 2}
some text in the second box
some text in the second box
some text in the second box
\end{mybox}
\begin{mybox}{mypurple}{Title 3}
                some text in the third box blabla
\end{mybox}
\end{tcbraster}
    \end{frame}

\end{document}

但是我遇到了类似这样的错误:!软件包 tikz 错误:放弃此路径。您忘记了分号吗?。

答案1

以下是使用 tcolorbox 包的示例:

我使用了以下代码:

\documentclass{beamer}

\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{tcolorbox}

\usetikzlibrary{calc}
\tcbuselibrary{skins,breakable,raster}

\makeatletter

\definecolor{myred}{RGB}{209,23,23}
\definecolor{myorange}{RGB}{255,153,51}
\definecolor{mypurple}{RGB}{102,0,102}
\definecolor{mygrey}{RGB}{200,200,200}

\newtcolorbox{mybox}[2]{%
empty,
coltitle = #1,
title = #2,
overlay ={
\draw[mygrey,line width=1pt]
(frame.north west)--(frame.north east)--(frame.south east)--(frame.south west)--(frame.north west);
\draw[#1,line width=1pt]
($(frame.north west)!0.33!(frame.south west)$)
--(frame.north west)
--($(frame.north west)!0.33!(frame.north east)$);
\draw[#1,line width=1pt]
($(frame.south east)!0.33!(frame.south west)$)
--(frame.south east)
--($(frame.south east)!0.33!(frame.north east)$);
}
}

\tcbset{marktext/.style={%
  overlay={\node[rotate=90,text=black,anchor=north east] at (frame.north west){#1};},
  code={\setbox\z@=\color@hbox#1\color@endbox\tcbdimto\myheight{\wd\z@+3mm}},
  minimum for equal height group=\tcb@ehgid:\myheight,
  }}

\makeatother

\begin{document}
\begin{frame}
\begin{tcbraster}[%
    raster columns=3,
    raster equal height=rows
    ]
    \begin{mybox}{myred}{Title 1}
    some text in the first box
    \end{mybox}
    \begin{mybox}{myorange}{Title 2}
    some text in the second box
    \end{mybox}
    \begin{mybox}{mypurple}{Title 3}
    some text in the third box blabla
    \end{mybox}
\end{tcbraster}
\end{frame}
\end{document}

相关内容