4

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.

\documentclass[11pt]{report}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[ngerman]{hyperref}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{physics}
\usepackage{setspace}
\usepackage{bm}
\usepackage{subfigure}
\usepackage{afterpage}
\usepackage{graphicx,color}
\graphicspath{{Abb/}}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{esvect}
\usepackage{longtable}
\usepackage{pdfpages}
\usepackage[section]{placeins}
\begin{document}
\begin{figure}[!ht]
\begin{minipage}{\linewidth}
    \centering
    \makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}    {$t/T=0.125$}}}%
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\\
    \makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.25$}}}%
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\\
    \makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.375$}}}%
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\\
    \makebox[20pt]{\raisebox{40pt}{\rotatebox[origin=c]{90}{$t/T=0.50$}}}%
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}\quad
    \includegraphics[width=0.28\textwidth]{test.jpg}
    \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{minipage}\hfill    %[1em]
\end{figure}

\end{document}
2
  • Welcome to TeX.SE.
    – Mico
    Commented Feb 24, 2019 at 20:03
  • 1
    The subfigure package is old and seriously deprecated. Don't use it. Use either the subfig or the subcaption package.
    – Mico
    Commented Feb 24, 2019 at 20:04

2 Answers 2

5

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.

enter image description here

\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}
2
  • Thank you very much! This is really great. You saved my thesis.:)
    – Gobrel
    Commented Feb 24, 2019 at 21:47
  • @Gobrel If this answer solved your problem, you should accept it, see How do you accept an answer?
    – CarLaTeX
    Commented Feb 25, 2019 at 7:52
5

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}

enter image description here

2
  • I think this tabularx-based solution is far simpler and more elegant than mine, which employs 12 separate subfigure environments.
    – Mico
    Commented Feb 24, 2019 at 21:38
  • Thank you very much! This is really a great feedback. Did not expect such a great support in that short amount of time. Thanks.:)
    – Gobrel
    Commented Feb 24, 2019 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .