1

I'm trying to create a landscape table, but I get an error message saying the caption is outside the float. I don't know how to fix it.

Here is the code.

\usepackage{lscape}
\begin{landscape}
    \small
    \begin{center}
    \caption{Central composite design in the original and coded (between brackets) form of the independent variables percentage of modifier (A), temperature  (B) and pressure (C) and experimental results for the response variables, retention factors of lycopene (k$_{1}$), beta-carotene (k$_{2}$), coenzyme Q10 (k$_{3}$) and lutein (k$_{4}$) and separation factors of the pairs lycopene/beta-carotene ($\alpha_{12}$), beta-carotene/coenzyme Q10 ($\alpha_{23}$) and coenzyme Q10/lutein ($\alpha_{34}$), between brackets the standard deviation.}
    \label{ANOVA4a}
    \begin{tabular}{P{1.0cm}|P{3cm}|P{2.9cm}|P{2.3cm}|P{1.5cm}|P{1.5cm}|P{1.5cm}|P{1.5cm}|P{1.5cm}|P{1.5cm}|P{1.5cm}}
    \hline
    \textbf{Run} & \multicolumn{3}{c}{\textbf{Factor}} & \multicolumn{7}{c}{\textbf{Response}}\\
    \hline
     & Percentage of modifier (A) & Temperature (B) & Pressure (C) & k$_{1}$ & k$_{2}$ & k$_{3}$ & k$_{4}$ & $\alpha_{12}$ & $\alpha_{23}$ & $\alpha_{34}$\\
    \hline
     1 & 24 (+1) & 25 (-1) & 2200 (+1) & 1.59 ($\pm$0.02) & 2.01 ($\pm$0.02) & 2.01 ($\pm$0.02) & 3.63 ($\pm$0.02) &    1.27 ($<$0.01) & 0.97 ($\pm$0.04) & 1.80 ($<$0.01)\\
     \hline
    \end{tabular}
    \end{center}
\end{landscape}
  • Please tell us how the P column type is defined. – Mico May 29 at 5:38
  • It was defined as \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}. Thank you. It worked. – Luciana May 29 at 15:39
1

landscape is the environment which helps to rotate the page, you need to give \begin{table}...\end{table}, refer the modified tags:

\documentclass{book}
\usepackage{lscape}

\begin{document}

\begin{landscape}
\begin{table}
    \small
    \begin{center}
    \caption{Central composite design in the original and coded (between brackets) form of the independent variables percentage of modifier (A), temperature  (B) and pressure (C) and experimental results for the response variables, retention factors of lycopene (k$_{1}$), beta-carotene (k$_{2}$), coenzyme Q10 (k$_{3}$) and lutein (k$_{4}$) and separation factors of the pairs lycopene/beta-carotene ($\alpha_{12}$), beta-carotene/coenzyme Q10 ($\alpha_{23}$) and coenzyme Q10/lutein ($\alpha_{34}$), between brackets the standard deviation.}
    \label{ANOVA4a}
    \begin{tabular}{p{1.0cm}|p{3cm}|p{2.9cm}|p{2.3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}}
    \hline
    \textbf{Run} & \multicolumn{3}{c}{\textbf{Factor}} & \multicolumn{7}{c}{\textbf{Response}}\\
    \hline
     & Percentage of modifier (A) & Temperature (B) & Pressure (C) & k$_{1}$ & k$_{2}$ & k$_{3}$ & k$_{4}$ & $\alpha_{12}$ & $\alpha_{23}$ & $\alpha_{34}$\\
    \hline
     1 & 24 (+1) & 25 (-1) & 2200 (+1) & 1.59 ($\pm$0.02) & 2.01 ($\pm$0.02) & 2.01 ($\pm$0.02) & 3.63 ($\pm$0.02) &    1.27 ($<$0.01) & 0.97 ($\pm$0.04) & 1.80 ($<$0.01)\\
     \hline
    \end{tabular}
    \end{center}
\end{table}
\end{landscape}

\end{document}

Better to use the rotating package instead of lscape and the tag is

\begin{sidewaystable}...\end{sidewaystable}

PS: I've changed your tabular alignment from P{1.0cm} to p{1.0cm}...

  • Thank you for correcting the code. P was defined as you mentioned – Luciana May 29 at 15:41
1

I'll assume that the P column type is a centered version of the basic p column type.

My main suggestion is to load the rotating package and use its sidewaystable environment.

enter image description here

\documentclass[10pt]{article} % or "11pt", "12pt", etc.
\usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters suitably
\usepackage{rotating} % for "sidewaystable" environment
\usepackage{array} % for "\newcolumntype" and "\extrarowheight" macros
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} % ??

\begin{document}

\begin{sidewaystable}
    %\centering
    %\small
    \setlength\extrarowheight{2pt} % for a more open "look"

    \caption{Central composite design in the original and coded (between brackets) form 
    of the independent variables percentage of modifier~(A), temperature~(B) and 
    pressure~(C) and experimental results for the response variables, retention 
    factors of lycopene~($k_{1}$), beta-carotene~($k_{2}$), coenzyme Q10~($k_{3}$) 
    and lutein~($k_{4}$) and separation factors of the pairs lycopene\slash 
    beta-carotene~($\alpha_{12}$), beta-carotene\slash coenzyme Q10~($\alpha_{23}$) 
    and coenzyme Q10\slash lutein~($\alpha_{34}$), between brackets the 
    standard deviation.}
    \label{ANOVA4a}

    \medskip
    \centering
    \begin{tabular}{|c|P{2.7cm}|P{2.5cm}|P{1.7cm}|*{7}{P{1.5cm}|}}
    \hline
    \textbf{Run} &
    \multicolumn{3}{c|}{\textbf{Factor}} &
    \multicolumn{7}{c|}{\textbf{Response}}\\
    \hline
     & Percentage of modifier (A)
     & Temperature (B)
     & Pressure (C)
     & $k_{1}$ & $k_{2}$ & $k_{3}$ & $k_{4}$
     & $\alpha_{12}$ & $\alpha_{23}$ & $\alpha_{34}$\\
    \hline
     1 & 24 ($+1$) & 25 ($-1$) & 2200 ($+1$)
     & 1.59 ($\pm0.02$) & 2.01 ($\pm0.02$) & 2.01 ($\pm0.02$)
     & 3.63 ($\pm0.02$) & 1.27 ($<0.01$)   & 0.97 ($\pm0.04$)
     & 1.80 ($<0.01$)\\
    \hline
    \end{tabular}
\end{sidewaystable}
\end{document} 

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.