How to put text above column in minipage?
First off, don't use the subfigure
package: It is seriously deprecated.
The following code employs the subcaption
package, which provides an environment called subfigure
. The three subfigure
environments in the first row are given \caption*
, allowing the insertion of unnumbered captions.
\documentclass[11pt,demo,ngerman]{report} % don't use 'demo' option in real document
%\usepackage{ucs} % do you really need this package?
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
%\usepackage{amsmath} % is loaded automatically by 'mathtools'
\usepackage{mathtools,physics,esvect,bm}
\usepackage{setspace}
%%%%%\usepackage{subfigure} % <--- this package is deprecated
\usepackage{subcaption} % use 'subcaption' package instead
\usepackage{afterpage,graphicx,xcolor}
\graphicspath{{Abb/}}
\usepackage{tabularx,booktabs,longtable}
\usepackage{pdfpages}
\usepackage[section]{placeins}
\usepackage{hyperref} % load this package LAST
\begin{document}
\begin{figure}[!ht]
\makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.125$}}}%
\begin{subfigure}[b]{0.3\textwidth}
\caption*{A word}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\caption*{B word}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\caption*{C word}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}
\bigskip
\makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.25$}}}%
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}
\bigskip
\makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.375$}}}%
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}
\bigskip
\makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.50$}}}%
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{test.jpg}
\end{subfigure}
\caption{I am using the subcaption package. I have an arrangement of total 12 figures. They are sorted in 3 columns with 4 rows in total.
The Code works fine, I have a caption which is perfect. My only problem is, how can I get text over each column? No a), b) and c). I want only a word, or Maybe 2 words above each column.}
\label{fig:sub1}
\end{figure}
\end{document}
As the images and short texts are arranged in a table-like way, here is a variant that uses a tabularx
in order to arrange text and images:
\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document}
\begin{figure}[!ht]
\begin{tabularx}{\linewidth}{lCCC}
& my short text & my short text & my short text\\
\makebox[1\baselineskip]{\raisebox{40pt}{\rotatebox[origin=c]{90} {$t/T=0.125$}}}%
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}\\
\makebox[1\baselineskip]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.25$}}}%
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}\\
\makebox[1\baselineskip]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.375$}}}%
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}\\
\makebox[1\baselineskip]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.50$}}}%
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}
& \includegraphics[width=\hsize]{test.jpg}
\end{tabularx}
\caption{I am using the subfigure package. I have an arrangement of total 12 figures. They are sorted in 3 columns with 4 rows in total.
The Code works fine, I have a caption which is perfect. My only problem is, how can I get text over each column? No a), b) and c). I want only a word, or Maybe 2 words above each column.}
\label{fig:sub1}
\end{figure}
\end{document}