Graphics, Figures & Tables ⇒ Figure with four Sub-figures across two Pages
Figure with four Sub-figures across two Pages
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..
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
- Stefan Kottwitz
- Site Admin
- Posts: 10350
- Joined: Mon Mar 10, 2008 9:44 pm
Figure with four Sub-figures across two Pages
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
Figure with four Sub-figures across two Pages
Hi Stefan,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
All right, I'll have a look at \subfig package, \subfloat and \ContinuedFloat and do my best..
thanks for the reply..
best regards
sam..
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Figure with four Sub-figures across two Pages
I have no problem with this example.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. […]
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 879 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Figure with four Sub-figures across two Pages
Dear Thorsten,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
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..
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Figure with four Sub-figures across two Pages
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:[…] the example which you gave me didn't work at all. […]
This is exactly what my example does (see attachment of my last reply). With the only difference that the secondgiant30 wrote:[…] So i used the easiest way by splitting the four sub-figures into two figures, each has two sub-figures. […]
figure
environment contains the \ContinuedFloat
command from the caption package.Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Figure with four Sub-figures across two Pages
Dear Thorsten,localghost wrote: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:[…] the example which you gave me didn't work at all. […]This is exactly what my example does (see attachment of my last reply). With the only difference that the secondgiant30 wrote:[…] So i used the easiest way by splitting the four sub-figures into two figures, each has two sub-figures. […]figure
environment contains the\ContinuedFloat
command from the caption package.
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.)
...
Code: Select all
\documentclass[a4paper,oneside,12pt]{D:/My_thesis/Classes/MyReport}
\usepackage{epstopdf}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{hyperref}
Best regards
sam.
Figure with four Sub-figures across two Pages
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.giant30 wrote:! Package subcaption Error: This package can't be used in cooperation
(subcaption) with the subfigure package.
If seems to me that "MyReport" loads the subfigure package, so you can't load the subfig or subcaption package afterwards.Note that: i use the following code as a preamble:
\documentclass[a4paper,oneside,12pt]{D:/My_thesis/Classes/MyReport}
Figure with four Sub-figures across two Pages
Dear sommerfee,sommerfee wrote: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.giant30 wrote:! Package subcaption Error: This package can't be used in cooperation
(subcaption) with the subfigure package.
If seems to me that "MyReport" loads the subfigure package, so you can't load the subfig or subcaption package afterwards.Note that: i use the following code as a preamble:
\documentclass[a4paper,oneside,12pt]{D:/My_thesis/Classes/MyReport}
thanks for the reply..
All right, I'll act on it and let you know ASAP,
best regards..
sam