I wana ask a question. How to make a template latex like this?
1 Answer
The two boxes can be designed with a number of packages: bclogo
, mdframed
, tcolorbox
; the one having the crayon decoration on the left corresponds to a predefined style from the bclogo
package so I defined a new environment for this box using this package; for the other one, I decided to use tcolorbox
:
\documentclass[dvipsnames]{article}
\usepackage[tikz]{bclogo}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\newtcolorbox{framedex}{
boxrule=0.8pt,
enhanced,
colframe=Maroon,
colback=white,
arc=2pt,
top=10pt,
attach boxed title to top center={yshift=-2ex},
boxed title style={
colback=Maroon,
arc=2pt,
},
title={The title},
}
\newenvironment{framedcrayon}[2][]
{\begin{bclogo}[
logo=\bccrayon,
couleur=yellow!15,
arrondi=0.1,
couleurBord=Maroon,#1]{#2}
}
{\end{bclogo}}
\begin{document}
\begin{framedex}
\lipsum[4]
\end{framedex}
\begin{framedcrayon}{Title}
\lipsum[4]
\end{framedcrayon}
\end{document}
Just as an example, here's the code required to produce both framed boxes just using bclogo
:
\documentclass[dvipsnames]{article}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}
\newenvironment{framedcrayon}[2][]
{\begin{bclogo}[
logo=\bccrayon,
couleur=yellow!15,
arrondi=0.1,
couleurBord=Maroon,#1]{#2}
}
{\end{bclogo}}
\newenvironment{framedanswer}[2][]
{\renewcommand\bcStyleTitre[1]{
\hfill\tikz[overlay]\node[fill=Maroon,align=center,text=white,rounded corners=2pt,yshift=15pt] {\strut##1};\hfill}
\renewcommand\logowidth{0pt}
\begin{bclogo}[
logo=\bccrayon,
arrondi=0.1,
epBarre=0,
couleurBord=Maroon,#1]{#2}
}
{\end{bclogo}}
\begin{document}
\begin{framedanswer}{The title}
\lipsum[4]
\end{framedanswer}
\begin{framedcrayon}{Title}
\lipsum[4]
\end{framedcrayon}
\end{document}
-
Is there any way to make a list of this boxes. Like to add for the questions / answers boxes a list of boxes at the end of the document? Oct 26, 2015 at 20:57
-
@PeterEbelsberger Yes, Please feel free to open a new question about this. Oct 26, 2015 at 22:27
bclogo
package was used for creating the exercises in the picture! :)