字幕格式

字幕格式

如何格式化标题间距:

![在此处输入图片描述][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}

答案1

这是你想要的吗?

\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}

在此处输入图片描述

我已将宽度改为,并在 s 之间0.45\textwidth添加了 a 。\hfillminipage

或者使用caption包,您可以指定widthmargin

\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}

答案2

这些软件包为格式化标题和子标题提供了很大的可能性。caption还为子图(和子表)提供了环境。subcaptionsubcaption

\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}

输出

相关内容