4

I want to creat color boxes as the picture. Could anybody help me

enter image description here

  • 1
    Welcome! The site works best when you post some code you've tried and ask about a specific problem. Start with one box you'd like to create and post a specific question when you get stuck, giving us your code so we can help you with the next step. The images you posted are quite different from each other and it really isn't clear what specifically you need help with. – cfr Jul 8 '15 at 14:38
  • Have you looked in the tcolorbox manual? It has lots of examples of the kind you are looking for. Or see tex.stackexchange.com/questions/250069/create-a-color-box?rq=1. – cfr Jul 8 '15 at 14:41
  • I tried to creat the third box and fourth box I succeed but the first box and final box I haven't done. Anybody help me – ablhope Jul 8 '15 at 15:00
  • 1
    Please post what you've tried. It is much easier to help given a document to start from. Or post the code you've got for the first and final boxes and ask how to add code for the others. – cfr Jul 8 '15 at 15:25
9

Here's one option for the first, second and fifth boxes. The code for boxes three and four can be found in my answer to Create a color box?.

enter image description here

The code:

\documentclass{article}
\usepackage[many]{tcolorbox}

\definecolor{problemblue}{RGB}{100,134,158}
\definecolor{idiomsgreen}{RGB}{0,162,0}
\definecolor{exercisebgblue}{RGB}{192,232,252}

\newtcolorbox{idioms}{
  breakable,
  enhanced,
  colback=white,
  colframe=idiomsgreen,
  arc=0pt,
  outer arc=0pt,
  title=Idioms,
  fonttitle=\bfseries\sffamily\large,
  colbacktitle=idiomsgreen,
  attach boxed title to top left={},
  boxed title style={
    enhanced,
    skin=enhancedfirst jigsaw,
    arc=3pt,
    bottom=0pt,
    interior style={fill=idiomsgreen}
  }
}

\newtcolorbox[auto counter,number within=section]{praproblem}{
  breakable,
  enhanced,
  colback=white,
  boxrule=0pt,
  arc=0pt,
  outer arc=0pt,
  title=Practice Problem~\thetcbcounter,
  fonttitle=\bfseries\sffamily\large\strut,
  coltitle=problemblue,
  colbacktitle=problemblue,
  title style={
    left color=orange!60,
    right color=white,
    middle color=white
  },
  overlay={
    \draw[line width=1.5pt,problemblue] (title.north west) -- (title.north east);
  }
}

\newtcolorbox[auto counter,number within=section]{tcbexercise}{
  breakable,
  enhanced,
  colback=white,
  boxrule=0pt,
  arc=0pt,
  outer arc=0pt,
  title=Exercise~\thetcbcounter,
  fonttitle=\bfseries\sffamily\large\strut,
  coltitle=problemblue,
  colbacktitle=problemblue,
  title style={exercisebgblue},
  overlay={
    \draw[line width=1.5pt,problemblue] (frame.south west) -- (frame.south east);
  }
}

\begin{document}

\section{A test section}

\begin{idioms}
Some test text.
\end{idioms}\par\bigskip

\begin{tcbexercise}
Some test text.
\end{tcbexercise}\par\bigskip

\begin{praproblem}
Some test text.
\end{praproblem}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.