4

I would like to put an image in over all the tcolorbox of a raster.

But in the 1st example this image is not at the top.

I try to put the image on the right tcolorbox but I didn't manage to make the tcolorbox have the same height as the 1st row of the raster.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[frenchb]{babel}
\usepackage[table,x11names]{xcolor}
\usepackage{tcolorbox}
\tcbuselibrary{skins, raster}
\usepackage{multicol}
\usepackage[paper=a4paper, margin={1cm,3cm},
headsep=0.5cm, headheight=2.2cm,]{geometry}

\usepackage{MnSymbol}

\usepackage{frcursive}
\usepackage{comicneue}

\usepackage{mwe}

\parindent=0mm
\begin{document}
\begin{tcbitemize}[raster columns=4, raster equal height,]
  \tcbitem[raster multirow=2, blankest]
  \begin{tcbitemize}[raster columns=1, raster rows=2]
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1]
    Prénom : \hrulefill

    Date : \hrulefill/\hrulefill/\hrulefill
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1,
    overlay={\node[] at (frame.north east) {\includegraphics[width=10mm]{example-image-a}};},]
    Signature des parents :
  \end{tcbitemize}
  \tcbitem[raster multicolumn=3, raster multirow=2,
  colback=white, colframe=SkyBlue1]
  \comicneue{\textbf{Évaluation d'Histoire {\LARGE $\filledstar$} CE2}}

  \comicneue{Le découpage du temps}

  Connaissances :


\end{tcbitemize}


\begin{tcbitemize}[raster columns=4, raster equal height,]
  \tcbitem[raster multirow=2, blankest]
  \begin{tcbitemize}[raster columns=1, raster rows=2]
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1]
    Prénom : \hrulefill

    Date : \hrulefill/\hrulefill/\hrulefill
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1,]
    Signature des parents :
  \end{tcbitemize}

  \tcbitem[raster multicolumn=3, raster multirow=1]%, blankest]
  \begin{tcbitemize}[raster columns=1]
    \tcbitem[enhanced, colback=white, colframe=SkyBlue1,
    overlay={
      \node[] at (frame.west) {\includegraphics[width=10mm]{example-image-a}};}]
    \comicneue{\textbf{Évaluation d'Histoire {\LARGE $\filledstar$} CE2}}

    \comicneue{Le découpage du temps}

    Connaissances :

  \end{tcbitemize}
\end{tcbitemize}

\begin{tcbitemize}[raster columns=4, raster equal height,]
  \tcbitem[raster multirow=2, blankest]
  \begin{tcbitemize}[raster columns=1, raster rows=2]
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1]
    Prénom : \hrulefill

    Date : \hrulefill/\hrulefill/\hrulefill
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1,]
    Signature des parents :
  \end{tcbitemize}

  \tcbitem[raster multicolumn=3, raster multirow=1, blankest]
  \begin{tcbitemize}[raster columns=1]
    \tcbitem[enhanced, colback=white, colframe=SkyBlue1,
    overlay={
      \node[] at (frame.west) {\includegraphics[width=10mm]{example-image-a}};}]
    \comicneue{\textbf{Évaluation d'Histoire {\LARGE $\filledstar$} CE2}}

    \comicneue{Le découpage du temps}

    Connaissances :

  \end{tcbitemize}
\end{tcbitemize}
\end{document}

enter image description here

I would like : enter image description here

  • I don't understand where the image should appear. Can you provide a screen shot or a sketch of what you expect? – user31729 Oct 3 '17 at 12:55
  • I just post an image of the wanted result – flav Oct 3 '17 at 13:10
4

The frame.west of the vertically larger box is the right position, but multirow needs an explicit raster height=... value in order to get the correct position. The compilation shows a clear warning about this and the manual of tcolorbox specifies this as well.

In order to get the image to the left, use xshift=... in the \node of the overlay option.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[frenchb]{babel}
\usepackage[table,x11names]{xcolor}
\usepackage{tcolorbox}
\tcbuselibrary{skins, raster}
\usepackage{multicol}
\usepackage[paper=a4paper, margin={1cm,3cm},
headsep=0.5cm, headheight=2.2cm,]{geometry}

\usepackage{MnSymbol}

\usepackage{frcursive}
\usepackage{comicneue}

\usepackage{mwe}

\parindent=0mm
\begin{document}
\begin{tcbitemize}[raster columns=4, raster equal height,raster height=0.25\textheight]
  \tcbitem[raster multirow=2, blankest]
  \begin{tcbitemize}[raster columns=1, raster rows=2]
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1]
    Prénom : \hrulefill
    Date : \hrulefill/\hrulefill/\hrulefill
    \tcbitem[left=1mm, right=1mm, enhanced,
    colback=white, colframe=SkyBlue1,
    ]
    Signature des parents :
  \end{tcbitemize}
  \tcbitem[enhanced,raster multicolumn=3, raster multirow=2,
  colback=white, colframe=SkyBlue1,    overlay={\node[] at (frame.west) {\includegraphics[width=10mm]{example-image-a}};}]
  \comicneue{\textbf{Évaluation d'Histoire {\LARGE $\filledstar$} CE2}}

  \comicneue{Le découpage du temps}

  Connaissances :


\end{tcbitemize}
\end{document}

enter image description here

4

Christian Hupfer solved your question but I would like to provide an alternative solution using poster library instead of raster.

tcolorbox-poster library provides tools for distributing tcolorboxes over a grid (just like raster) but with a more flexible capabilities. As an example boxes can have any size, even not multiple of rows or columns. The drawback is that the distribution is restricted to be on one page, posters are not breakable like rasters.

As an example I've reproduced your three boxes distribution with a little variation. The initial grid is formed by two rows and four columns. The first column will be occupied by left boxes and the rest of the area will be covered by the right box.

In this case, the left column is distributed en two different boxes, top left box uses 60% of a row height while the bottom left box will covers the available space. As, now, the intersection point is not on frame.west, I've placed the figure over second box corner.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[frenchb]{babel}
\usepackage[table,x11names]{xcolor}
\usepackage{tcolorbox}
\tcbuselibrary{skins, raster, poster}
\usepackage{multicol}
\usepackage[paper=a4paper, margin={1cm,3cm},
headsep=0.5cm, headheight=2.2cm,]{geometry}

\usepackage{MnSymbol}

\usepackage{frcursive}
\usepackage{comicneue}

\parindent=0mm
\begin{document}
\begin{tcbposter}[
    poster = {height=.25\textheight, spacing = 2mm, columns=4, rows=2},
    boxes = {enhanced, colback=white, colframe=SkyBlue1}
    ]
    \posterbox[left=1mm, right=1mm]
        {name=prenom, column=1,row=1, rowspan=0.6}
        {Prénom : \hrulefill\\ Date : \hrulefill/\hrulefill/\hrulefill}
    \posterbox{column=2,row=1, span=3, rowspan=2}
        {%
        \comicneue{\textbf{Évaluation d'Histoire {\LARGE $\filledstar$} CE2}}

        \comicneue{Le découpage du temps}

        Connaissances:
        }
    \posterbox[left=1mm, right=1mm, 
        overlay={\node[shift={(1mm,1mm)}] at (frame.north east) 
            {\includegraphics[width=1cm]{example-image-A}};}]
        {column=1, between= prenom and bottom}
        {Signature des parents:}
\end{tcbposter}
\end{document}

enter image description here

  • "+1" for all your answers. – Sebastiano Oct 4 '17 at 11:46

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.