Graphics, Figures & TablesCaption on a resized landscape Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
CharlieMAC
Posts: 19
Joined: Wed May 04, 2011 5:50 pm

Caption on a resized landscape Table

Post by CharlieMAC »

Hi everyone!!

I'm having troubles to insert the caption on a wide portrait table which has been resized to fit the page.

This is the code I'm using:

Code: Select all

\documentclass[letterpaper,10pt]{report}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[spanish]{babel}
\usepackage{float}
\usepackage{pdflscape}
\usepackage{array}
\usepackage{rotating}
\usepackage{afterpage}
\usepackage{caption}
\restylefloat{figure}

\begin{document}
\begin{landscape}
\centering
\resizebox{1.6\textheight}{!}
{
\begin{tabular}[ht!]{|l|r|r|r|r|r|r|r|r|r|r|r|r|}
\hline
\textit{1.2 Gastos administrativos} & \textit{172500,00 } & \textit{172500,00 } & \textit{172500,00
} & \textit{172500,00 } & \textit{172500,00 } & \textit{172500,00 } & \textit{172500,00 } &
\textit{172500,00 } & \textit{172500,00 } & \textit{172500,00 } & \textit{172500,00 } &
\textit{172500,00 } \\ \hline
1.2.1  Arriendo de Local(es) & 62500,00  & 62500,00  & 62500,00  & 62500,00  & 62500,00  & 62500,00 
& 62500,00  & 62500,00  & 62500,00  & 62500,00  & 62500,00  & 62500,00  \\ \hline
1.2.3  Reparación y mantenimiento de equipos & 5000,00  & 5000,00  & 5000,00  & 5000,00  & 5000,00 
& 5000,00  & 5000,00  & 5000,00  & 5000,00  & 5000,00  & 5000,00  & 5000,00  \\ \hline
1.2.7  Teléfonos & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00 
& 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  \\ \hline
1.2.8  Material y útiles de oficina & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  &
20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  \\ \hline
1.2.9  Electricidad & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  &
20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  & 20000,00  \\ \hline
1.2.10  Agua y desagüe  & 10000,00  & 10000,00  & 10000,00  & 10000,00  & 10000,00  & 10000,00  &
10000,00  & 10000,00  & 10000,00  & 10000,00  & 10000,00  & 10000,00  \\ \hline
1.2.11  Servicio de correo & 35000,00  & 35000,00  & 35000,00  & 35000,00  & 35000,00  & 35000,00  &
35000,00  & 35000,00  & 35000,00  & 35000,00  & 35000,00  & 35000,00  \\ \hline
\end{tabular}
% \caption*{Lorem ipsum}
}
\label{tab:Table1}
\end{landscape}
\end{document}
But it says "Caption outside float". If I use the table environment above tabular environment it says "Not in the par outer mode". So, I don't understand what's going on :(

Any suggestion?
Thanks in advance
Charlie

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Caption on a resized landscape Table

Post by localghost »

CharlieMAC wrote:[…] But it says "Caption outside float". […]
What do you expect if you try to add a caption to an object which is not inside a float environment (figure, table)?

Captions without a float environment can be placed by the \captionof command provided by the caption package.


Thorsten
Post Reply