0

I would like to include both tables and figures in landscape mode in combination with the endfloat package.

The problem is that, to my knowledge, I can assign the landscape environment only to either a table or figure via \DeclareDelayedFloatFlavour.

So, suppose I configure endfloat to show figures first and assign landscape to tables, i.e. \DeclareDelayedFloatFlavour{landscape}{table}. In the document, however, the table in landscape mode comes before the figure in landscape mode. Then it will show the table first.

I suspect there is an easy solution, but I could not find it. MWE is attached below.

\documentclass{article}

\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{pdflscape}
\usepackage[figuresfirst,nomarkers,nolists]{endfloat}
    \DeclareDelayedFloatFlavour{landscape}{table}
\begin{document}

\begin{landscape}
    \begin{table}
        \centering
        \caption{This should be second}
        \begin{tabular}{ |c|c|c| } 
             \hline
             cell1 & cell2 & cell3 \\ 
             cell4 & cell5 & cell6 \\ 
             cell7 & cell8 & cell9 \\ 
             \hline
        \end{tabular}
    \end{table}
\end{landscape}

\begin{landscape}
    \begin{figure}[h!]
        \centering
        \rule{1cm}{1cm}
        \caption{This should be first}
    \end{figure}
\end{landscape}

\end{document}

1 Answer 1

2

One solution could be to define new environments for tables and figures in landscape.

\documentclass{article}

\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{pdflscape}
\usepackage[figuresfirst,nomarkers,nolists]{endfloat}

% new environment for landscape tables    
\newenvironment{ltable}
  {\begin{landscape}}
  {\end{landscape}}
  
% new environment for landscape figures    
\newenvironment{lfigure}
  {\begin{landscape}}
  {\end{landscape}}

% assignment
\DeclareDelayedFloatFlavour{ltable}{table}
\DeclareDelayedFloatFlavour{lfigure}{figure}

\begin{document}

\begin{ltable}
    \begin{table}
        \centering
        \caption{This should be second}
        \begin{tabular}{ |c|c|c| } 
             \hline
             cell1 & cell2 & cell3 \\ 
             cell4 & cell5 & cell6 \\ 
             cell7 & cell8 & cell9 \\ 
             \hline
        \end{tabular}
    \end{table}
\end{ltable}

\begin{lfigure}
    \begin{figure}
        \centering
        \rule{1cm}{1cm}
        \caption{This should be first}
    \end{figure}
\end{lfigure}

\end{document}
1
  • I was worried about combining table and ltable etc., but they come out in the right order. Jun 21, 2021 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .