5

How do I format the caption spacing:

![enter image description here][1]

 \begin{figure}[h]
 \centering
 \begin{minipage}{.5\textwidth}
  \centering
  \includegraphics[width=2in, height=2.5in] {JAR}
  \caption{Desired Jar for the Improvised Bioreactor}
  \label{fig:test1}
  \end{minipage}%
  \begin{minipage}{.5\textwidth}
    \centering
   \includegraphics[width=2in, height=2.5in] {PROJECTEDDESIGN}
   \caption{Projected Design for the Improvised Bioreactor}
  \label{fig:test2}
 \end{minipage}
 \end{figure}
5

Is this what you want?

\documentclass{article}
\usepackage[demo]{graphicx}     %% remove demo
\begin{document}
   \begin{figure}[h]
 \centering
 \begin{minipage}{.45\textwidth}
  \centering
  \includegraphics[width=2in, height=2.5in] {JAR}
  \caption{Desired Jar for the Improvised Bioreactor}
  \label{fig:test1}
  \end{minipage}%
  \hfill
  \begin{minipage}{.45\textwidth}
    \centering
   \includegraphics[width=2in, height=2.5in] {PROJECTEDDESIGN}
   \caption{Projected Design for the Improvised Bioreactor}
  \label{fig:test2}
 \end{minipage}
 \end{figure}
\end{document}

enter image description here

I have changed the width to 0.45\textwidth and added a \hfill in between the minipages.

Or with caption package, you can specify either width or margin

\documentclass{article}
\usepackage[demo]{graphicx}     %% remove demo
\usepackage{caption}
\captionsetup[figure]{margin=10pt}
\begin{document}
   \begin{figure}[h]
 \centering
 \begin{minipage}{.5\textwidth}
  \centering
  \includegraphics[width=2in, height=2.5in] {JAR}
  \caption{Desired Jar for the Improvised Bioreactor}
  \label{fig:test1}
  \end{minipage}%
  \begin{minipage}{.5\textwidth}
    \centering
   \includegraphics[width=2in, height=2.5in] {PROJECTEDDESIGN}
   \caption{Projected Design for the Improvised Bioreactor}
  \label{fig:test2}
 \end{minipage}
 \end{figure}
\end{document}
0

The packages caption and subcaption deliver great possibillities for formatting the captions and subcaptions. subcaption also delivers environments for subfigures (and subtables).

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

%% settings I like, change them as you wish:
\captionsetup{
    width=0.9\linewidth, % width of caption is 90% of current textwidth
    labelfont=bf,        % the label, e.g. figure 12, is bold
    font=small,          % the whole caption text (label + content) is small
    format=hang,         % no caption text under the label
}
\captionsetup[subfigure]{
    format=plain,   % but allowed in subfigure to save space
}


\begin{document}
   \begin{figure}[h]
   \centering
   \begin{subfigure}{.48\textwidth}
       \centering
       \includegraphics[width=2in, height=2.5in] {JAR}
       \caption{Desired Jar}
       \label{subfig:test1}
   \end{subfigure}%
   \hfill
   \begin{subfigure}{.48\textwidth}
       \centering
       \includegraphics[width=2in, height=2.5in] {PROJECTEDDESIGN}
       \caption{Projected Design}
       \label{subfig:test2}
    \end{subfigure}
    \caption{Two images for the Improvised Bioreactor, fig.~\subref{subfig:test1}: Desired Jar, fig.~\subref{subfig:test2}: Projected Design.}
    \label{fig:test1}
    \end{figure}
    As you can see in fig~\ref{subfig:test1}, blablabla
\end{document}

output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.