LaTeX Templates Câu hỏi bài tập 1

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{nccmath}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usetikzlibrary{decorations.pathmorphing, positioning}
\newcounter{mycounter}
\setlength{\parindent}{0pt}
\definecolor{myblue}{RGB}{0,163,217}
\usepackage{fontawesome}
\newcommand{\onestar}{\faStar~\faStarO~\faStarO}                                     % difficulty ratings. I you don't want the outlined but empty star, remove \faStarO.
\newcommand{\twostar}{\faStar~\faStar~\faStarO}
\newcommand{\threestar}{\faStar~\faStar~\faStar}
\usepackage{lipsum}                                                                  % for dummy text in the example boxes.
\begin{document}
\newtcolorbox{mybox}[1][\onestar]{                                                   % \onestar is the default difficulty.
    step=mycounter,                                                                  % boxes are automatically numbered    
    enhanced,
    colback=white,                                                                   % white background
    frame hidden,                                                                    % hide frame
    top=10pt, left=0pt, right=0pt,                                                   % top, left and right distances to the invisible borders of the box
    borderline north={1pt}{0pt}{green!75!black,                                      % green zig zag line
                                decoration={zigzag,
                                            amplitude=2pt,
                                            pre=moveto,pre length=4.25cm, 
                                            post length=6.75cm},
                                decorate},
    overlay={%
        \tikzset{overlay=false, draw=none, anchor=west}
        \node[fill=myblue, text=red,                                                 % background and textcolor of "Exercise" box
              minimum height=1.5em] at (frame.north west) (box1){\textbf{Exercise}}; % position of "Exercise" box
        \node[fill=myblue, text=red,                                                 % background and textcolor of exercise number box
              right = 1mm of box1,                                                   % position of exercise number box
              minimum height=1.5em] (box2){\textbf{\themycounter}}; 
        \node[text=orange, fill=white,                                               % background and textcolor of difficulty rating box
              right = 3mm of box2, ] (difficulty){#1};                               % position of difficulty rating box
    }}
\begin{mybox}[\onestar]
Simplifier les expressions suivantes:
\begin{enumerate}
    \item $A=\mfrac{5^3\times(3^2\times2)^{-1}}{3^{-1}\times(2^{-3}\times5)^2}$
    \item ...
\end{enumerate}
\end{mybox}
\begin{mybox}[\twostar]
\lipsum[1][1-3]
\begin{enumerate}
    \item \lipsum[1][1-1]
    \item ...
\end{enumerate}
\end{mybox}
\begin{mybox}[\threestar]
\lipsum[1][1-3]
\begin{enumerate}
    \item \lipsum[1][1-1]
    \item ...
\end{enumerate}
\end{mybox}
\begin{mybox}
\lipsum[1][1-3]
\begin{enumerate}
    \item \lipsum[1][1-1]
    \item ...
\end{enumerate}
\end{mybox}
\end{document}

Nguồn : Latex templates pro

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *