I just ran into the same issue. (It's really annoying when trying to produce print-quality preprint versions of the paper.) Poking around in pnastwo.cls, I found the following fix:
Find the first line in pnastwo.cls which says
\ifx\@captype\xtable
Change this to
\ifx\@captype\table
Alternatively, if you don't want to touch the class file, you can
put the following into the preamble of your document:
% Fix wierd behavior which prevents table captions from appearing for
% tables in the body of the article
\makeatletter
\long\def\@makecaption#1#2{%
\ifx\@captype\table
\let\currtabcaption\relax
\gdef\currtabcaption{
\tabnumfont\relax #1. \tabtextfont\relax#2\par
\vskip\belowcaptionskip
}
\else
\vskip\abovecaptionskip
\sbox\@tempboxa{\fignumfont#1.\figtextfont\hskip.5em\relax #2}%
\ifdim \wd\@tempboxa >\hsize
\fignumfont\relax #1.\figtextfont\hskip.5em\relax#2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\fi
}
\makeatother
One additional comment: once this bug is fixed, you'll almost certainly run into another issue which you'd want fixed if you use the PNAS two-column class to produce production-quality output: Unless you define floats with the h "here" placement, it loses the labels, so all cross-referencing of figures and tables breaks. Here is the fix, for direct pasting into the document preamble. You can also patch up the macro \DonormalEndcol pnastwo.cls, it's the same mistake 6 times over...
% And another fix. PNAS class loses the label of floats unless they
% were defined with the [h] option (so not really floats at all). It
% all comes down to wrong scope in the following routine which pushes
% out the floats onto the page. This is the fixed version:
\makeatletter
\def\DonormalEndcol{%
%% top float ==>
\ifx\toporbotfloat\xtopfloat%
%% figure ==>
\ifcaptypefig%
\expandafter\gdef\csname topfloat\the\figandtabnumber\endcsname{%
\vbox{\vskip\PushOneColTopFig%
\unvbox\csname figandtabbox\the\loopnum\endcsname%
\vskip\abovefigcaptionskip%
\csname caption\the\loopnum\endcsname%
\csname letteredcaption\the\loopnum\endcsname%
\csname continuedcaption\the\loopnum\endcsname%
\csname letteredcontcaption\the\loopnum\endcsname
\ifredefining%
\csname label\the\loopnum\endcsname%
\expandafter\gdef\csname topfloat\the\loopnum\endcsname{}\fi}%
\vskip\intextfloatskip%%
\vskip-4pt %% probably an artifact of topskip??
}%
\else%
%% plate ==>
\ifcaptypeplate%
\expandafter\gdef\csname topfloat\the\figandtabnumber\endcsname{%
\vbox{\vskip\PushOneColTopFig%
\unvbox\csname figandtabbox\the\loopnum\endcsname
\vskip\abovefigcaptionskip
\csname caption\the\loopnum\endcsname
\csname letteredcaption\the\loopnum\endcsname
\csname continuedcaption\the\loopnum\endcsname
\csname letteredcontcaption\the\loopnum\endcsname
\ifredefining
\csname label\the\loopnum\endcsname
\expandafter\gdef\csname topfloat\the\loopnum\endcsname{}\fi}
\vskip\intextfloatskip %%
\vskip-4pt %% probably an artifact of topskip??
}%
\else% table ==>
\expandafter\gdef\csname topfloat\the\figandtabnumber\endcsname{%
\vbox{\vskip\PushOneColTopTab %%
\csname caption\the\loopnum\endcsname
\csname letteredcaption\the\loopnum\endcsname
\csname continuedcaption\the\loopnum\endcsname
\csname letteredcontcaption\the\loopnum\endcsname
\vskip\captionskip
\unvbox\csname figandtabbox\the\loopnum\endcsname
\ifredefining
\csname label\the\loopnum\endcsname
\expandafter\gdef\csname topfloat\the\loopnum\endcsname{}\fi
}\vskip\intextfloatskip %% why don't we need this?
\vskip-10pt}
\fi\fi%
%
\else% bottom float
%
\ifcaptypefig
\expandafter\gdef\csname botfloat\the\figandtabnumber\endcsname{%
\vskip\intextfloatskip
\vbox{\unvbox\csname figandtabbox\the\loopnum\endcsname
\vskip\abovefigcaptionskip
\csname caption\the\loopnum\endcsname
\csname letteredcaption\the\loopnum\endcsname%
\csname continuedcaption\the\loopnum\endcsname%
\csname letteredcontcaption\the\loopnum\endcsname%
\vskip\PushOneColBotFig%%
\ifredefining%
\csname label\the\loopnum\endcsname
\expandafter\gdef\csname botfloat\the\loopnum\endcsname{}\fi}}%
\else
\ifcaptypeplate
\expandafter\gdef\csname botfloat\the\figandtabnumber\endcsname{%
\vskip\intextfloatskip
\vbox{\unvbox\csname figandtabbox\the\loopnum\endcsname
\vskip\abovefigcaptionskip
\csname caption\the\loopnum\endcsname
\csname letteredcaption\the\loopnum\endcsname%
\csname continuedcaption\the\loopnum\endcsname%
\csname letteredcontcaption\the\loopnum\endcsname%
\vskip\PushOneColBotFig%%
\ifredefining%
\csname label\the\loopnum\endcsname
\expandafter\gdef\csname botfloat\the\loopnum\endcsname{}\fi}}%
\else% TABLE
\expandafter\gdef\csname botfloat\the\figandtabnumber\endcsname{%
\vskip\intextfloatskip
\vbox{\csname caption\the\loopnum\endcsname
\csname letteredcaption\the\loopnum\endcsname
\csname continuedcaption\the\loopnum\endcsname
\csname letteredcontcaption\the\loopnum\endcsname%
\vskip.5\intextfloatskip
\unvbox\csname figandtabbox\the\loopnum\endcsname%
\vskip\PushOneColBotTab
\ifredefining%
\csname label\the\loopnum\endcsname
\expandafter\gdef\csname botfloat\the\loopnum\endcsname{}\fi}}%
\fi\fi\fi}
\makeatother
Here is the kind of thing I think you want although I'm not sure. You can fiddle with the sizes to make the most of the space but you need things smaller than in the MWE unless you want more than 2 lines of sub-figures which is another option.
\documentclass[a4paper, 12pt]{article}
\usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%Graphs and Diagrams
%\usepackage{subgraphic}
\usepackage{subfig}
\usepackage[demo]{rotating} %remove 'demo' option for real file
\usepackage{float}
\usepackage[labelsep=newline,% line break after label
justification=centering,
singlelinecheck=off, font=bf]{caption}
\makeatletter% Set distance from top of page to first float
\setlength{\@fptop}{5pt}
\long\def\@makefigcaption#1#2{%
\vskip\abovecaptionskip
\footnotesize\textbf{#1.} \footnotesize#2
\ifdim \wd\@tempboxa >\hsize
\textbf{#1.} #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}
\makeatother
\begin{document}
\section{Appendix}
\centering
\begin{figure}[h]
\begin{turn}{90}
\begin{minipage}{.75\textheight}
\subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad
\subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}}\quad
\subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad
\subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad
\subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}}\quad
\subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad
\end{minipage}
\end{turn}
\end{figure}
\end{document}
Update
To move the figure downwards, you can insert some vertical space before and after, followed by a \clearpage
:
\documentclass[a4paper, 12pt]{article}
\usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%Graphs and Diagrams
%\usepackage{subgraphic}
\usepackage{subfig}
\usepackage[demo]{rotating} %remove 'demo' option for real file
\usepackage{float}
\usepackage[labelsep=newline,% line break after label
justification=centering,
singlelinecheck=off, font=bf]{caption}
\makeatletter% Set distance from top of page to first float
\setlength{\@fptop}{5pt}
\long\def\@makefigcaption#1#2{%
\vskip\abovecaptionskip
\footnotesize\textbf{#1.} \footnotesize#2
\ifdim \wd\@tempboxa >\hsize
\textbf{#1.} #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}
\makeatother
\begin{document}
\section{Appendix}
\vfill
\centering
\begin{figure}[h]
\begin{turn}{90}
\begin{minipage}{.75\textheight}
\subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad
\subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}}\quad
\subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad
\subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad
\subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}}\quad
\subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad
\end{minipage}
\end{turn}
\end{figure}
\vfill
\clearpage
New page
\end{document}
Update II
As requested, here is a way to customise the captions for figures and tables:
\documentclass[a4paper, 12pt]{article}
\usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%Graphs and Diagrams
%\usepackage{subgraphic}
\usepackage{subfig}
\usepackage[demo]{rotating} %remove 'demo' option for real file
\usepackage{float}
\usepackage[labelsep=newline,% line break after label
justification=centering,
singlelinecheck=off, font=bf]{caption}
\makeatletter% Set distance from top of page to first float
\setlength{\@fptop}{5pt}
\long\def\@makefigcaption#1#2{%
\vskip\abovecaptionskip
\footnotesize\textbf{#1.} \footnotesize#2
\ifdim \wd\@tempboxa >\hsize
\textbf{#1.} #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}
\makeatother
\DeclareCaptionLabelFormat{my-figures}{%
\def\tempa{figure}%
\def\tempb{#1}%
\ifx\tempa\tempb(\textbf{#2})\else{\centering(\textbf{#2})}}
\captionsetup{labelformat=my-figures,labelsep=quad}
\begin{document}
\section{Appendix}
\vfill
{\centering
\begin{figure}[h]
\begin{turn}{90}
\begin{minipage}{.75\textheight}
\subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad
\subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}}\quad
\subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.225\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad
\subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad
\subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}}\quad
\subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.225\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad
\caption{Figure Caption}
\end{minipage}
\end{turn}
\end{figure}}
\vfill
\clearpage
\begin{table}
\centering
\begin{tabular}{cc}
A & table\\
\end{tabular}
\caption{Table Caption}
\end{table}
\end{document}
Best Answer
Another possible solution is the rotation by 90 degrees. In cases that you do not want to use landscape environment. A sample of output is provided underneath.
I found the example Landscape figure in LaTeX and converted to the output:
Another possible solution would be the
minipage
. Sample of the output is provided below:I found some information from Rotating: Sideways figure with Section title. You can always modify the code based on your needs. The output of the code is: .
Personally I prefer the first sample, but depends your code and the expected output. Just try both and observe which one fits your needs.
Update:
I was sure that if I look my old files I could find a working example. Approximately a year ago that I started working with
LaTeX
I had the same idea with you to create a landscape picture (due to size) but I also wanted to have the section and text inside. Well I had found a solution but for different ways did not work for me but maybe it works for you. Although I do not recommend this solution to be used with text due to the difference text width (because of landscape). You can somehow suppress the document to fit the appropriate length but the result based on my criteria was not satisfying. A working example is provided underneath with the code:I have added several other "code tricks" that I managed to combine while I was implementing my solution based on my needs. I mean
geometry
package (very useful for really big figures, ganttcharts etc. Theadjustwidth
command to center a really big figure, ganttchart etc. Just play with the code and you will find many interesting things. This is a sample of the output:So in conclusion to your question. Yes it is possible to add a section in landscape with a figure and text in the same page.