0

I am trying to make a result template in Overleaf. I have split my page into 5 parts using minipages. The upper half of my page has 3 minipages which allow me to have a text in between 2 images and I want it to have black background colour. While the lower half of my page is split into 2 minipages and I want them to have grey background colour. How can I do it? When I try \pagecolor{black}\color{white} it makes the entire page black.

Thanks to Fran for solving my issue above. But, now I'm stuck with their alignment.

Here's my current code:-

\documentclass[landscape]{article}
\usepackage[margin=0pt]{geometry}
\usepackage{xcolor,graphicx}
\usepackage[export]{adjustbox}
\usepackage{parskip}


\begin{document}
\pagecolor{gray!30}
\sffamily\bfseries
\fboxsep0.8cm
\colorbox{black}{\color{white}
\begin{minipage}{\dimexpr\linewidth-2\fboxsep}
\includegraphics[valign=c,width=.1\linewidth]{Zaariya.png}\hfil  
\parbox[c]{.75\linewidth}{\centering\Huge Sci\textcolor{red}{Q}uest 2\textcolor{red}{K}20 \par}\hfil  
\includegraphics[valign=c,width=.1\linewidth]{Niser_logo.png}
\end{minipage}}
\hspace{0.5cm}
\begin{minipage}[c]{0.4\textwidth}
\Large \textbf{Name:-} <<Students Name>>\\
\textbf{Class:-} <<His Class>>\\\vspace{1.2cm}
\textbf{Roll No:-} <<ROLL>> \\
\textbf{Marks:-}\\
\begin{itemize}
    \item \textbf{Subject 1 :} <<Marks1>>
    \item \textbf{Subject 2 :} <<Marks2>>
    \item \textbf{Subject 3 :} <<Marks3>>
    \item \textbf{Subject 4 :} <<Marks4>>
    \item \textbf{Total :} <<Total>>
\end{itemize}\vspace{1.3cm}
\textbf{Class Rank:-} <<Rank1>>\\
\textbf{Overall Rank:-} <<Rank2>>\\
\end{minipage}
\begin{minipage}[c]{0.6\textwidth}
\includegraphics[width=0.4\textwidth]{Bar_Graph.png}\\
\includegraphics[width=0.4\textwidth]{Subject_pie_chart.png}\\
\includegraphics[width=0.4\textwidth]{Tot_pie_chart.png}
\end{minipage}

\end{document}

Here's a picture of the result:- Result

I am trying to move both the text and the images to move more right but am unable to.

  • \colorbox{yourcolor}{yourminigage} ? – Fran Mar 05 '20 at 20:09
  • @Fran Can you please further explain? I'm new to this. – Shashank Saumya Mar 05 '20 at 20:16
  • I tried to use \colorbox but it just made the color around the text black and not the entire background. – Shashank Saumya Mar 05 '20 at 20:39
  • No, it should fill completely the minipage: :\documentclass{article} \usepackage{xcolor} \begin{document} \colorbox{blue!20}{\color{red} \begin{minipage}{4cm} Bla bla bla \par Bla bla bla \par Bla bla bla \par \end{minipage}} \end{document} Of course, the blue will be covered by the background of images ... except for PNG or PDF images with a transparent background. – Fran Mar 05 '20 at 21:07
  • OK, it is making the entire minipage of that colour, but it seems that my minipage's height is the same as the size of my text making it look like just a highlighted text. What I want to achieve is that my entire page have 2 different background colors. So that I get black background for my first 3 minipages and grey background for the last 2 minipages. – Shashank Saumya Mar 05 '20 at 21:23
  • You need some padding? Try with some like \fboxsep2cm (before of the \colorbox, of course). – Fran Mar 05 '20 at 21:27
  • I have added a figure which shows how my background should look like. Maybe that will help in understanding my question. As for the \fboxsep2cm it does not keep the background of a uniform rectangle shape as the minipages that I have created are of different sizes. – Shashank Saumya Mar 05 '20 at 22:00

1 Answers1

0

A point to start. BTW, you can look for some certificate ideas here.

mwe

\documentclass[landscape]{article}
\usepackage[margin=0pt]{geometry}
\usepackage{xcolor,graphicx}
\usepackage[export]{adjustbox}
\usepackage{parskip}
\begin{document}
\pagecolor{gray!30}
\sffamily\Huge\bfseries
\fboxsep2cm
\colorbox{black}{\color{white}
\begin{minipage}{\dimexpr\linewidth-2\fboxsep}
\includegraphics[valign=c,width=.1\linewidth]{example-image-9x16}\hfil  
\parbox[c]{.75\linewidth}{\centering Bla bla bla\par \textcolor{red}{B}la bla bla\par Bla bla bla\par}\hfil  
\includegraphics[valign=c,width=.1\linewidth]{example-image-9x16}
\end{minipage}}
\vfill
\centering
\hfill\includegraphics[valign=c,width=.2\linewidth]{example-image}\hfill
\parbox[c]{.6\linewidth}{\centering Bla bla bla\par \textcolor{red}{B}la bla bla\par Bla bla bla\par}\hfill 

\vfill\large

\hfill\parbox{.1\linewidth}{\centering President\vspace{1.5cm}\par\dotfill}
\hfill\parbox{.1\linewidth}{\centering Dean \vspace{1.5cm}\par\dotfill}  
\hfill\parbox{.1\linewidth}{\centering Lamp Holder \vspace{1.5cm}\par\dotfill}  
\hfill\mbox{}

\vfill

\end{document}
Fran
  • 80,769
  • This is what I was looking for. Also, can you tell me how to put 3 images along a vertical line at the place where you have put the 'example-image' (the one in the grey background) – Shashank Saumya Mar 06 '20 at 10:55
  • @ShashankSaumya Think in the images just like a big characters... How would you type "ABC" in a vertical column at this pace? Yes, one more minipage could be a good solution. – Fran Mar 06 '20 at 18:30
  • The mini page worked. But, for some reason it is making both my texts and images stick to the left and \hspace and \hfill did not seem to work for some reason. I have updated the question with my current code and its result. Can you please take a look and tell me what to do... – Shashank Saumya Mar 07 '20 at 07:04
  • A little bit of padding did the job. Thank you so much Fran – Shashank Saumya Mar 07 '20 at 18:20