1

In order to make an exam, I used the tabular environment, but it still boring, i want to make the something with the nice template tcolorbox, how can use it:

\documentclass[11pt,a4paper]{article}
\usepackage[top=1cm, bottom=1cm, left=1.5cm, right=1.5cm]{geometry}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage[most]{tcolorbox}
\usepackage{eso-pic}
\usepackage{mathrsfs}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{cancel}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{pgf,tikz,pgfplots}
 \usepackage{varwidth}
\usepackage{listings}
\usepackage{pstricks-add}
\usepackage{tikz,tkz-tab}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usepackage{siunitx}
\usetikzlibrary{arrows}
\usepackage{mdframed}
\usepackage{hyperref}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz,lmodern}
\begin{document}

%%%%%%%%%%%%%%%%%    the head        %%%%%%%%%%%%%%%%%
\begin{tabular}[l]{p{0.2\textwidth}   p{0.4\textwidth}  p{0.29\textwidth}} 
\textbf{Ecole:....}
&\hspace{01.5cm}  \textbf{Examen regional -2020-}
& \textbf{Année scolaire: 2019-2020  }
\end{tabular}

%%%%%%%%%%%%%%%%%%%% tabular %%%%%%%%%%%%%%%%%%
\begin{tabular}[c]{|p{0.9\textwidth } |p{0.02\textwidth}|} \hline & \\
\fbox{   \textbf{Exercice 1 (1.5pts)}}
& \\\vspace{0.1cm}
Résoudre les deux équations suivantes:
 &\\
$1$)\hspace{2cm} $3x-2=7+5x$ \quad .
& $0.5$\\
$2$)\hspace{2cm} $x^2-4+(2x+5)(x+2)=0$ \quad .
&$1$\\ 
\hline
\multicolumn{2}{c}{}\\
\hline
&\\
\fbox{  \textbf{Exercice 2 (4pts)} }
&\\
\vspace{0.1cm}
On considère le système suivant: 
\begin{eqnarray}\nonumber (E):\left\{
 \begin{array}{lll}
  3x-y=6\\ x+2y=16
 \end{array}\right.
\end{eqnarray} & \\ 
 \hspace{0.2cm} $1- $ est ce qu le paire $(5;9)$ est une solution pour $(E)$ \quad & $2$ \\
\hspace{0.2cm} $2- $ résoudre $(E)$. \quad & $2$
 \vspace{0.3cm} \\
\hline
\multicolumn{2}{c}{}\\
\hline
&\\
%\vspace{0.2cm}
\fbox{\textbf{Exercice 3 (5pts)} }
&\\
%\vspace{0.5cm}
\vspace{0.1cm}
 &\\
 soit h une fonction linéaire, telle que: $h(x)=8x$. & \\
 \hspace{0.2cm} $1-$ calculer l'image de 1 par la fonction h \quad  . &$2.5$\\
\hspace{0.2cm} $2-$ tracer graphiquement la fonction $h$ \quad  . &$2.5$\\
&\\
\hline
\multicolumn{2}{c}{}\\

\end{tabular}  

\end{document}

enter image description here

1
  • Not an answer to your question but two things: the mdframed environment has an option to show nicely (pages 27 and 28) the points in each box. The other thing is that you could use \renewcommand\half{,5} to have the french style half point. – Ivan May 17 '20 at 14:08
2

Something similar to your exam with tcolorbox could be done with following code. I don't know how to avoid still boring concept, but from here you can design what you want.

\documentclass[11pt,a4paper]{article}
\usepackage[top=1cm, bottom=1cm, left=1.5cm, right=1.5cm]{geometry}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage[most]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\newtcolorbox[auto counter]{exercice}[2][]{%
    enhanced, breakable,
    sharp corners,
    colframe=black,
    colback=white,
    boxrule=1pt,
    coltitle=black,
    colbacktitle=white,
    attach boxed title to top left={yshift=-1pt},
    title={Exercice~\thetcbcounter\ (#2pts)},
    boxed title style={sharp corners, boxrule=1pt},
    fonttitle=\bfseries,
    right=2mm,
    overlay={\draw ([xshift=-1.1cm]frame.north east)--([xshift=-1.1cm]frame.south east);},
    #1
}

\begin{document}

%%%%%%%%%%%%%%%%%    the head        %%%%%%%%%%%%%%%%%
\noindent\textbf{Ecole:....}\hfill\textbf{Examen regional -2020-}\hfill\textbf{Année scolaire: 2019-2020}

%%%%%%%%%%%%%%%%%%%% tabular %%%%%%%%%%%%%%%%%%
\begin{exercice}{1.5}
Résoudre les deux équations suivantes:
\begin{enumerate}
\item $3x-2=7+5x$ \hfill 0.5
\item $x^2-4+(2x+5)(x+2)=0$ \hfill 1.0
\end{enumerate} 
\end{exercice}

\begin{exercice}[coltitle=red]{4}
On considère le système suivant: 
\[(E):\begin{cases}3x-y=6\\x+2y=16\end{cases}\]
\begin{enumerate}
\item est ce qu le paire $(5;9)$ est une solution pour $(E)$\hfill 2.0
\item résoudre (E).\hfill 2.0
\end{enumerate}
\end{exercice}

\begin{exercice}[colback=black!5]{5}
Soit $h$ une fonction linéaire, telle que: $h(x)=8x$.
\begin{enumerate}
\item calculer l'image de 1 par la fonction $h$\hfill 2.5
\item tracer graphiquement la fonction $h$\hfill 2.5
\end{enumerate}
\end{exercice}

\end{document}

enter image description here

0

in preamble (before \begin{document}, add this code:

\newcounter{mycounter} 
\setcounter{mycounter} 

1- before the 1st question add this code:

\framebox(40,15){Exercize 3 point}\quad\arabic{mycounter}\stepcounter{mycounter} - 

2- past the code in (1-) befor 2nd and 3rd and... question.

Regards

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.