I am writing a TeX document with two columns in which I want to include figures at fixed positions on the pages. The positions should be as follows (see page 1 MWE):
- Wide figure at top/bottom of the page spanning both columns
- Small figures side-by-side in two columns at top/bottom of the page
In order to highlight the figures compared to the text, I want to add colored rules at the top and bottom of the figure. This works well as long as both figures are of the same size. However, if the sizes of the figures differ, the colored rules are shifted (see page 3 in the MWE).
How can I define a box or minipage environment with colored rules at the top and bottom with fixed size (e.g., width = \columnwidth, height = 5cm)?
Is it further possible to place my figures in these boxes/minipages and adjust their sizes without affecting the positions of the colored rules? It would be great, if the captions are positioned below the bottom rule (see screenshot).
Thank you very much for your help!
\documentclass[a4paper,10pt,twoside,twocolumn]{article}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{bbm}
\usepackage{threeparttable}
\usepackage{natbib}
\usepackage{rotating}
\usepackage{placeins}
\usepackage{geometry}
\usepackage{subcaption}
\usepackage{pdfpages}
\usepackage{wrapfig}
\usepackage{multirow}
\usepackage{setspace}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{fontspec}
\usepackage{stfloats}
\usepackage{tikz}
\begin{document}
\begin{figure*}[!b]
\begin{minipage}{\columnwidth}
{\color{red}\rule{\columnwidth}{0.04cm}}
\vspace{-0.25cm}
\scalebox{1.1}{\includegraphics[trim=6cm 18cm 2.5cm 2cm,clip=true,height=7cm]{Test.pdf}}
{\color{red}\rule{\columnwidth}{0.04cm}}
\captionof{table}{Test}\label{tab:Test1}
\end{minipage}\qquad
\begin{minipage}{\columnwidth}
{\color{red}\rule{\columnwidth}{0.04cm}}
\centering
\vspace{-0.25cm}
\scalebox{1.1}{\includegraphics[trim=6cm 18cm 2.5cm 2cm,clip=true,height=7cm]{Test.pdf}}
{\color{red}\rule{\columnwidth}{0.04cm}}
\captionof{table}{Test}\label{fig:Test2}
\end{minipage}
\end{figure*}
\lipsum
\begin{figure*}[!b]
\begin{minipage}{\columnwidth}
{\color{red}\rule{\columnwidth}{0.04cm}}
\vspace{-0.25cm}
\scalebox{1.1}{\includegraphics[trim=6cm 18cm 2.5cm 2cm,clip=true,height=7cm]{Test.pdf}}
{\color{red}\rule{\columnwidth}{0.04cm}}
\captionof{table}{Test}\label{tab:Test1}
\end{minipage}\qquad
\begin{minipage}{\columnwidth}
{\color{red}\rule{\columnwidth}{0.04cm}}
\centering
\vspace{-0.25cm}
\scalebox{1.1}{\includegraphics[trim=7.5cm 21cm 2.5cm 2cm,clip=true,height=7cm]{Test2.pdf}}
{\color{red}\rule{\columnwidth}{0.04cm}}
\captionof{table}{Test}\label{fig:Test2}
\end{minipage}
\end{figure*}
\lipsum
\end{document}