1

enter image description hereRequirement: Create a full page with a grid of team members. Each team member should have an image and a small description about them. Similar to what we see in a team members page.

Approach: Use subfigures within a figure environment. I've removed all captions. Please see code below:

Code:

\begin{figure*}%
%\captionsetup{font=small,labelfont=bf, width=.9\textwidth}
%% first three subfigures
\subfigure[Num/01]{%
%\captionsetup{font=small,labelfont=bf, width=.5\textwidth}
  \includegraphics[width =1.5in,angle=-90,origin=c]{graphics/PXL_20211215_102014392.jpg}%
}%
}
\hspace*{\fill}
\subfigure[Num/02]{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{graphics/PXL_20211215_102014392.jpg}%
}%
\hspace*{\fill}
\subfigure[Num/03]{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{graphics/PXL_20211215_102014392.jpg}%
}

%% second group of subfigures
\subfigure[Num/01]{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{graphics/PXL_20211215_102014392.jpg}%
}%
\hspace*{\fill}
\subfigure[Num/02]{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{graphics/PXL_20211215_102014392.jpg}%
}%
\hspace*{\fill}
\subfigure[Num/03]{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{graphics/PXL_20211215_102014392.jpg}%
%\caption{Scatter plots of 6 pics.}\label{fig:Scatter}
\end{figure*}

What Works: I get a 3X2 grid of images with the texts "Num/01" , "Num/02"...beside each of them.

Problem: Not able to figure out how to set a fixed width for the text associated with each subfigure. How do I insert line breaks in this text? Example if instead of "Num/01" I use a longer text such as "Dr. XYZ, Prof. of Tech. Innovation, PQR University", how do I put this in three separate lines instead of one single continuous line? Also, is it possible for me to set a fixed width fo this text so it wraps up within that same width?

Thanks for your help!!

enter image description here

3 Answers 3

2

Using minipages is a simple method of aligning captions and figures. The width of the caption and its position are controlled by the minipage arguments (used [c] here). Its format is set using \captionsetup

If you don't want (sub)captions to appear in the LoF, use \caption*, or do not use \caption at all inside the minipage:

\begin{minipage}[c]{0.12\textwidth}
    Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University 
    \end{minipage}
    \begin{minipage}[c]{0.20\textwidth}
        \includegraphics[angle=-90]{example-image-a}
    \end{minipage}
    \hfill
    \begin{minipage}[c]{0.12\textwidth}
        \footnotesize\RaggedRight   Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University 
    \end{minipage}

       ....

A

\documentclass[12pt,a4paper]{article}

\usepackage[left=2.00cm, right=2.00cm, top=4.00cm, bottom=3.00cm, showframe]{geometry}

\usepackage{graphicx}
\usepackage{caption}

\captionsetup[figure]{labelformat=empty, textfont=footnotesize,  margin=4pt, justification=RaggedRight}

\begin{document}


\begin{figure}[htb!]
    \setkeys{Gin}{width=1.5in} % width of all images
    \begin{minipage}[c]{0.12\textwidth}
        \caption{Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University} 
    \end{minipage}
    \begin{minipage}[c]{0.20\textwidth}
        \includegraphics[angle=-90]{example-image-a}
    \end{minipage}
    \hfill
    \begin{minipage}[c]{0.12\textwidth}
        \caption{Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University} 
    \end{minipage}
    \begin{minipage}[c]{0.2\textwidth}
        \includegraphics[angle=-90]{example-image-a}
    \end{minipage}\hfill
    \begin{minipage}[c]{0.12\textwidth}
        \caption{Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University} 
    \end{minipage}
    \begin{minipage}[c]{0.2\textwidth}
        \includegraphics[angle=-90]{example-image-a}
    \end{minipage}

    \bigskip
    \begin{minipage}[c]{0.12\textwidth}
    \caption{Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University} 
    \end{minipage}
    \begin{minipage}[c]{0.20\textwidth}
        \includegraphics[angle=-90]{example-image-b}
    \end{minipage}
    \hfill
    \begin{minipage}[c]{0.12\textwidth}
        \caption{Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University} 
    \end{minipage}
    \begin{minipage}[c]{0.2\textwidth}
        \includegraphics[angle=-90]{example-image-b}
    \end{minipage}\hfill
    \begin{minipage}[c]{0.12\textwidth}
        \caption{Dr. XYZ\\ Prof. of Tech. Innovation\\ PQR University} 
    \end{minipage}
    \begin{minipage}[c]{0.2\textwidth}
        \includegraphics[angle=-90]{example-image-b}
    \end{minipage}
\end{figure}

    
\end{document}  
1
  • 1
    Thanks a lot!! Using the Minipage environment solved the problem for me. I was able to simplify it further as I did not really need a separate minipage for the text.
    – imfundo
    Oct 24, 2022 at 10:42
1

I don't fully understand your question. I think there will be some good answers from others, but here is a hint for you first. It could solve your problem or help you make your MWE easier to understand.

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{mwe}

\begin{document}
\begin{figure*}
\begin{minipage}{0.2\linewidth}
\caption[caption]{A very long long \\\hspace{\textwidth}long long caption}
\end{minipage}%
\subfigure{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{example-image-a}}
\begin{minipage}{0.2\linewidth}
\caption[caption]{A very long long \\\hspace{\textwidth}long long caption}
\end{minipage}%
\subfigure{%
  \includegraphics[width =1.5in,angle=-90,origin=c]{example-image-b}}
\end{figure*}
\end{document}

enter image description here

1
  • 1
    Thanks Matt! This helped a lot!
    – imfundo
    Oct 24, 2022 at 10:55
1

This code is based on the solution provided by @Simon Despa . Thanks! Below is the code and the corresponding output.

enter image description here

\begin{figure*}[htb!]
    \setkeys{Gin}{width=1.5in} % width of all images
    \begin{minipage}[t]{0.20\textwidth}
        \includegraphics[]{graphics/Face-Deer.png} Dr. Animal \\Awesome
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Deer.png} Dr. Pulkit \\Awesome
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Owl.png} Dr. Animal \\Awesome
    \end{minipage}
    \hfill  
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Racoon.png} Dr. Animal \\Awesome
    \end{minipage}

    \bigskip
    \begin{minipage}[t]{0.20\textwidth}
        \includegraphics[]{graphics/Face-Lemur.png}  Dr. Animal \\Awesome
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Lemur.png}  Dr. Animal \\Awesome
    \end{minipage}\hfill
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Racoon.png} Dr. Animal \\Awesome
    \end{minipage}
    \hfill  
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Racoon.png} Dr. Animal \\Awesome
    \end{minipage}

    \bigskip
    \begin{minipage}[t]{0.20\textwidth}
        \includegraphics[]{graphics/Face-Lemur.png}  Dr. Animal \\Awesome
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Lemur.png}  Dr. Animal \\Awesome
    \end{minipage}\hfill
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Racoon.png} Dr. Animal \\Awesome
    \end{minipage}
    \hfill  
    \begin{minipage}[t]{0.2\textwidth}
        \includegraphics[]{graphics/Face-Racoon.png} Dr. Animal \\Awesome
    \end{minipage}
    
\end{figure*}

You must log in to answer this question.

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