2

I'm making a report with a latex editor. I have a caption made up by two pictures in a column. The picture below is larger than that of above, and I use center envirorment without 'figure' in order to obtain the pictures aligned. I only use \includegraphics. Does anybody know how can I put the pictures a 'subcaption' like (a),(b) withou the figure envirorment?? because if I use it the picture below appears not aligned. Thanks

  • The figure environment has nothing to do with alignment. You can use the center environment inside the figure environment, or better still use \centering. – Ian Thompson Oct 1 '14 at 8:42
  • I've tried, but the picture below is not aligned..The fact is that this picture (the large picture below) was made with mathematica coupling two different figures, and I think that it can't be aligned within the figure or center environment for this reason... – user25578 Oct 1 '14 at 9:03
  • As I said, the figure environment has nothing to do with alignment. You will need to provide a complete example code that reproduces the problem in order to get help. You can make images available for download from elsewhere and add links to your question if necessary. – Ian Thompson Oct 1 '14 at 9:11
  • Your approach is, well, hackish. We understand you have two pictures, one larger than the other. But the layout depends on the page layout. You mention a column, so is it a two column layout of the whole text? You see, we can't just give two or three commands which solve your issue now, because it depends on the setup of your report. – Keks Dose Oct 1 '14 at 9:19
1

Here two different packages are used subcaption and subfig for demonstration. Without figure environment, one could use minipage environment with columnwidth setting and seek helps from

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

If List of Figures is desired then use \caption{...}, \listofigures commands and compile twice to get the proper rendering.

enter image description here

Code

\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}
  • This is essentially what \captionof of the capt-of package does. But since you're using subcaption, the command \captionof is already available: \captionof{figure}{<text>} – egreg Oct 1 '14 at 13:23
  • Thanks for the insights @egreg. Should find time to study those package codes. Anyway, the proposal is what I know of to tackle such question. Appreciated. – Jesse Oct 1 '14 at 14:04

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.