Graphics, Figures & TablesFigure with four Sub-figures across two Pages

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
giant30
Posts: 13
Joined: Tue Feb 28, 2012 11:59 am

Figure with four Sub-figures across two Pages

Post by giant30 »

Dear all,

I have a figure fig.1 consists of 4 sub-figures, 1(a),1(b),1(c), and 1(d).
I want to write a latex code to include the first two sub-figures in the current page and the rest two figures in the next page. i.e. 1(a) and 1(b) in the current page and 1(c) and 1(d) in the next page.
so how can i do it? I use Miktex, 2.6, x64 bits under Texnicenter.

thanks..
sam..

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Figure with four Sub-figures across two Pages

Post by Stefan Kottwitz »

Hi Sam,

for subfigures, I would use the subfig package or the subcaption package. However, I would not split a figure in two figures and still use the same figure number. For example, a page reference would not be definite, for example there can be an issue in the list of figures. Before you really decide to do this, have a look at good books in the field and compare.

Btw. regarding LaTeX specific problems, TeX distribution, operating system and editor usually don't matter.

Stefan
LaTeX.org admin
giant30
Posts: 13
Joined: Tue Feb 28, 2012 11:59 am

Figure with four Sub-figures across two Pages

Post by giant30 »

Stefan_K wrote:Hi Sam,

for subfigures, I would use the subfig package or the subcaption package. However, I would not split a figure in two figures and still use the same figure number. For example, a page reference would not be definite, for example there can be an issue in the list of figures. Before you really decide to do this, have a look at good books in the field and compare.

Btw. regarding LaTeX specific problems, TeX distribution, operating system and editor usually don't matter.

Stefan
Hi Stefan,
All right, I'll have a look at \subfig package, \subfloat and \ContinuedFloat and do my best..
thanks for the reply..
best regards
sam..
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure with four Sub-figures across two Pages

Post by localghost »

giant30 wrote:[…] I have a figure fig.1 consists of 4 sub-figures, 1(a),1(b),1(c), and 1(d). I want to write a latex code to include the first two sub-figures in the current page and the rest two figures in the next page. i.e. 1(a) and 1(b) in the current page and 1(c) and 1(d) in the next page. […]
I have no problem with this example.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{hyperref}

\begin{document}
  \listoffigures

  \begin{figure}[!p]
    \centering
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-1:dummy}
    \end{subfigure}

    \medskip
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-2:dummy}
    \end{subfigure}
    \caption{Dummy figure}
    \label{fig:dummy}
  \end{figure}

  \begin{figure}[!p]
    \ContinuedFloat
    \captionsetup{list=no}
    \centering
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-3:dummy}
    \end{subfigure}

    \medskip
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-4:dummy}
    \end{subfigure}
    \caption{Dummy figure (cont.)}
    \label{fig:dummy-cont}
  \end{figure}
\end{document}

Thorsten
Attachments
Figure-continued.pdf
The output as obtained by the given code.
(42.05 KiB) Downloaded 878 times
giant30
Posts: 13
Joined: Tue Feb 28, 2012 11:59 am

Figure with four Sub-figures across two Pages

Post by giant30 »

localghost wrote:I have no problem with this example.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{hyperref}

\begin{document}
  \listoffigures

  \begin{figure}[!p]
    \centering
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-1:dummy}
    \end{subfigure}

    \medskip
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-2:dummy}
    \end{subfigure}
    \caption{Dummy figure}
    \label{fig:dummy}
  \end{figure}

  \begin{figure}[!p]
    \ContinuedFloat
    \captionsetup{list=no}
    \centering
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-3:dummy}
    \end{subfigure}

    \medskip
    \begin{subfigure}[b]{0.75\linewidth}
      \rule{\linewidth}{0.75\linewidth}
      \caption{First sub-figure}
      \label{subfig-4:dummy}
    \end{subfigure}
    \caption{Dummy figure (cont.)}
    \label{fig:dummy-cont}
  \end{figure}
\end{document}

Thorsten
Dear Thorsten,
thanks for the reply..
the example which you gave me didn't work at all.. So i used the easiest way by splitting the four sub-figures into two figures, each has two sub-figures. what to do? i had no choice..
thanks again,
regards
sam..
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure with four Sub-figures across two Pages

Post by localghost »

giant30 wrote:[…] the example which you gave me didn't work at all. […]
This is an absolutely inadequate problem description. Tell us exactly what does not work e. g. by giving the concrete error messages from the log file.
giant30 wrote:[…] So i used the easiest way by splitting the four sub-figures into two figures, each has two sub-figures. […]
This is exactly what my example does (see attachment of my last reply). With the only difference that the second figure environment contains the \ContinuedFloat command from the caption package.
giant30
Posts: 13
Joined: Tue Feb 28, 2012 11:59 am

Figure with four Sub-figures across two Pages

Post by giant30 »

localghost wrote:
giant30 wrote:[…] the example which you gave me didn't work at all. […]
This is an absolutely inadequate problem description. Tell us exactly what does not work e. g. by giving the concrete error messages from the log file.
giant30 wrote:[…] So i used the easiest way by splitting the four sub-figures into two figures, each has two sub-figures. […]
This is exactly what my example does (see attachment of my last reply). With the only difference that the second figure environment contains the \ContinuedFloat command from the caption package.
Dear Thorsten,
thank you for the kind reply,
when i tried to use the code shown above, i got these errors:

Code: Select all

! Package subcaption Error: This package can't be used in cooperation
(subcaption)                with the subfigure package.

See the subcaption package documentation for explanation.
Type  H <return>  for immediate help.
 ...  

! Missing number, treated as zero.
<to be read again> 
                   }
l.455     \begin{subfigure}[b]{0.75\linewidth}
                                              
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
...
Note that I use the following code as a preamble.

Code: Select all

\documentclass[a4paper,oneside,12pt]{D:/My_thesis/Classes/MyReport}
\usepackage{epstopdf}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{hyperref}
under "LaTeX -> PDF".

Best regards
sam.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Figure with four Sub-figures across two Pages

Post by sommerfee »

giant30 wrote:! Package subcaption Error: This package can't be used in cooperation
(subcaption) with the subfigure package.
You can't mix the subfigure, subfig, and subcaption packages. You have to decide which one to take, and you can take only one of them.
Note that: i use the following code as a preamble:
\documentclass[a4paper,oneside,12pt]{D:/My_thesis/Classes/MyReport}
If seems to me that "MyReport" loads the subfigure package, so you can't load the subfig or subcaption package afterwards.
giant30
Posts: 13
Joined: Tue Feb 28, 2012 11:59 am

Figure with four Sub-figures across two Pages

Post by giant30 »

sommerfee wrote:
giant30 wrote:! Package subcaption Error: This package can't be used in cooperation
(subcaption) with the subfigure package.
You can't mix the subfigure, subfig, and subcaption packages. You have to decide which one to take, and you can take only one of them.
Note that: i use the following code as a preamble:
\documentclass[a4paper,oneside,12pt]{D:/My_thesis/Classes/MyReport}
If seems to me that "MyReport" loads the subfigure package, so you can't load the subfig or subcaption package afterwards.
Dear sommerfee,
thanks for the reply..
All right, I'll act on it and let you know ASAP,
best regards..
sam
Post Reply