创建漂亮的盒子

创建漂亮的盒子

我想创造

  • (蓝色!70)框包含我如何使用 geogebra 的方法

在此处输入图片描述

\documentclass{article}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{graphics}

\begin{document}

\begin{tcolorbox}[colback=yellow!10!white,colframe=blue!75!black,title=Method]
\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{1}
\lipsum
\end{wrapfigure}
\end{tcolorbox}

\end{document}

答案1

您可以将您的itemize环境和图像并排放在两个小页面内。

框内的颜色使用以下选项设置:colback=<any_color_you_like>

如果您有不同种类的盒子,一种选择是创建一种样式(我称之为mybeatiful)并仅在需要时使用它。

还有可能创建一个新的tcolorbox(我称之为mybox,这更方便,因为你需要写得更少)。

\documentclass{article}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{graphics}
\tcbset{
  mybeautiful/.style={
      sharp corners=all,
      enhanced,
      breakable,
      colback=cyan!20,
      colframe=blue!75!black,
      colbacktitle=blue,
      coltitle=white,
      left skip={.20\linewidth},
      attach boxed title to top left={xshift=-.2\linewidth, yshift=-40pt},
      boxed title style={
          sharp corners=all,       }
      }
}

% definition of a new tcolorbox whic uses the style:
\newtcolorbox{mybox}[2][]{ 
    mybeautiful,  
    title    = #2,
    #1,
    }


\begin{document}
First option: using a style directly:
\begin{tcolorbox}[mybeautiful,title=Method]
\begin{minipage}{0.45\textwidth}
\begin{itemize}
\item I hope
\item this is
\item what you want
\end{itemize}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\end{minipage}

\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\begin{itemize}
\item I hope
\item this is
\item what you want
\end{itemize}
\end{minipage}
\end{tcolorbox}

Second option (more convenient) a new tcolorbox:
\begin{mybox}{Method}
\begin{minipage}{0.45\textwidth}
\begin{itemize}
\item I hope
\item this is
\item what you want
\end{itemize}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\end{minipage}

\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\begin{itemize}
\item I hope
\item this is
\item what you want
\end{itemize}
\end{minipage}
\end{mybox}
\end{document}

在此处输入图片描述

答案2

希望一切顺利blue!70!这只是一小段代码。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{graphics}
\usepackage{float}
\usepackage{menukeys}

\usetikzlibrary{shadows}

\newcommand*\keystroke[1]{%
  \tikz[baseline=(key.base)]
    \node[%
      draw=white!20!gray!10,
      fill=lightgray,
      drop shadow={shadow xshift=0.25ex,shadow yshift=-0.25ex,fill=lightgray,opacity=0.4},
      rectangle,
      rounded corners=2pt,
      inner sep=1pt,
      line width=0.5pt,
      font=\scriptsize\sffamily
    ](key) {#1\strut}
  ;
}

\begin{document}

\begin{tcolorbox}[colback=cyan!10,colframe=blue!70,title=Method]

\begin{wrapfigure}{r}{0.4\textwidth}
\begin{center}
    \includegraphics[width=0.4\textwidth]{example-image}
\end{center}
\caption{image}
\end{wrapfigure}
\lipsum[1] with Blaaaaaaa \keystroke{Ctrl}+\keystroke{V} 
\end{tcolorbox}

\end{document}

相关内容