沒有圖形環境的標題

沒有圖形環境的標題

我正在用乳膠編輯器做報告。我的標題由一欄中的兩張圖片組成。下面的圖片比上面的圖片大,我使用沒有“圖形”的中心環境以獲得對齊的圖片。我只使用 \includegraphics。有誰知道如何在沒有圖形環境的情況下將圖片添加為“子標題”,如(a)、(b)?因為如果我使用它,下面的圖片就會顯得不對齊。謝謝

答案1

這裡使用兩個不同的包subcaption進行subfig演示。沒有figure環境,可以利用有minipage環境的環境columnwidth,尋求協助

\makeatletter
\def\@captype{figure}
\makeatother

如果List of Figures需要,請使用\caption{...},\listofigures命令並編譯兩次以獲得正確的渲染。

在此輸入影像描述

程式碼

\documentclass[]{report}
\usepackage[showframe,margin=2cm]{geometry}
   \usepackage[utf8]{inputenc}
   \usepackage[T1]{fontenc}
   \usepackage{multicol}
   \columnsep=10pt 
   \columnseprule=3pt 
%   \usepackage{subfig}       % for subfloat
   \usepackage{subcaption}    % for subcaptionbox
   \usepackage{graphicx} 
   %\usepackage{amsfonts, amsmath, amsthm, amssymb} 
   \usepackage{lipsum}


\begin{document}
\listoffigures

\begin{multicols}{2} 

\lipsum[1-3]
\vfill
\columnbreak

% to run this session, please disable `sufig` package and enable `subcaption` package

\subsection*{Subcaptionbox section}
\noindent
\begin{minipage}{\columnwidth}
\makeatletter
\def\@captype{figure}
\makeatother
  \centering
  \subcaptionbox{Above  \label{fig:above}}{%
  \includegraphics[width=0.5\columnwidth]{example-image-a}}\\
  \subcaptionbox{Below  \label{fig:below}}{%
  \includegraphics[width=0.8\columnwidth]{example-image-b} }
  \caption{Two figures}\label{Fig}
\end{minipage}

% to run this session, please disable `subcaption` package and enable `subfig` package

%\subsection*{Subfloat section}
%
%\noindent
%\begin{minipage}{\columnwidth}
%\makeatletter
%\def\@captype{figure}
%\makeatother
% \centering
%  \subfloat[Above]{%
%  \includegraphics[width=0.5\columnwidth]{example-image-a}
%  \label{fig:above}
%}\\
%  \subfloat[Below]{%
%  \includegraphics[width=0.8\columnwidth]{example-image-b}
%  \label{fig:below}
%}
%  \caption{Two figures,\label{Fig}}
%\end{minipage}
\end{multicols}
\end{document}

相關內容