2

I've created a table with http://www.tablesgenerator.com/ and wrapped it with

\afterpage{
\begin{landscape}
\begin{longtabu}{X}

to rotate the table and fit it to as many pages it needs.

My code looks like the following:

\afterpage{
\begin{landscape}
\begin{longtabu}{X}
\begin{tabularx}{0.5\textheight}{X|l}
\begin{tabular}{|l|l|l|l|l|l|l|l|}
% Header
% Content
\end{tabular}
\end{tabularx}
\end{longtabu}
\end{landscape}
}

The problem is: it's not being rotated and it's overflowing the page space. What should I do?

EDIT

I forgot to mention. The first lines of my document are:

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{float}
\usepackage{listings}
\usepackage{color}
\usepackage{tabularx}
\restylefloat{table}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{afterpage}

\input{TesePack}

\begin{document}

\frontmatter
\thispagestyle{empty}

\input{Capa}

\cleardoublepage

\pagebreak
% Table of Contents
% ---------------------------------------------------------------
\tableofcontents
% ---------------------------------------------------------------

\mainmatter
\cleardoublepage

EDIT

Ok, maybe it's wasn't clear enough. The code it's here:

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{float}
\usepackage{listings}
\usepackage{color}
\usepackage{tabularx}
\restylefloat{table}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{afterpage}

\input{TesePack}

\begin{document}

\frontmatter
\thispagestyle{empty}

\input{Capa}

\cleardoublepage

\pagebreak
% Table of Contents
% ---------------------------------------------------------------
     \tableofcontents
% ---------------------------------------------------------------

\mainmatter
\cleardoublepage

% ---------------------------------------------------------------
% Chapter 1 - Descrição do estudo de caso
% ---------------------------------------------------------------
\chapter{Descrição do estudo de caso}
\label{descricao}
\input{descricao}


\end{document}

And the "descricao" file, which my table is included, it's here:

\afterpage{
\begin{landscape}
\begin{longtabu}{X}
\begin{tabularx}{0.5\textheight}{X|l}
\begin{tabular}{|l|l|l|l|l|l|l|l|}
\hline
\multicolumn{1}{|c}{\multirow{2}{*}{\textbf{Atividade de Suporte}}} & \multicolumn{1}{|c|}{\multirow{2}{*}{\textbf{Ligação com a cadeia de fornecedores (insumos)}}} & \multicolumn{5}{c}{\textbf{Atividades Primárias}}                                                                                                                                                                                                                                                                                                                                                                             & \multicolumn{1}{|c|}{\multirow{2}{*}{\textbf{Ligação com a cadeia de distribuidores}}} \\ \cline{3-7}
                                                                    &                                                                                                & \multicolumn{1}{|c}{\textbf{Logística Interna}}                                                                                             & \multicolumn{1}{|c}{\textbf{Operações}}                                & \multicolumn{1}{|c}{\textbf{Logística Externa}} & \multicolumn{1}{|c}{\textbf{Marketing e Vendas}}        & \multicolumn{1}{|c|}{\textbf{Serviços}}                                                    &                                                                                        \\ \hline
\textbf{Aquisição}                                                  & Dados das Agências de Saúde                                                                    & \begin{tabular}[c]{@{}c@{}}<span style="line-height: 1.5em;">Equipe</span>\\ <span style="line-height: 1.5em;">Hardware</span>\end{tabular} & Subentende-se a utilização de um software de gerenciamento do workflow & Não se aplica                                   & Não se aplica                                           & Realização de parcerias com Agências Internacionais de Saúde                               & Não se aplica                                                                          \\ \hline
\textbf{Tecnologia e Desenvolvimento}                               & Agrega valor com os dados fornecidos das empresas parceiras                                    & Transferência de tecnologia agregando valor ao conhecimento                                                                                 & Não se aplica                                                          & Não se aplica, pois o produto próprio           & Não se aplica, pois o projeto está no inicio            & Melhorar o algoritmo para dar mais precisão as previsões                                   & Permitir um acesso mais rápido a informação sobre as previsões                         \\ \hline
\textbf{Administração de Recursos Humanos}                          & Estabelecer parcerias com agências de saúde                                                    & Recrutamento de profissionais qualificados                                                                                                  & Manter atualização constante de treinamento especializado              & Não se aplica                                   & Não se aplica                                           & Tornar transparente as formas de acesso dos clientes à empresa para a correção do problema & Não se aplica                                                                          \\ \hline
\textbf{Sistemas de Administração}                                  & Garantir a privacidade dos usuários                                                            & Controle dos dados fornecidos pelas Agências de Saúde                                                                                       & Acompanhamento dos dados atualizados sobre gripe no mundo              & Não se aplica                                   & Acompanhamento de notícias relacionadas ao produto para & Apresentação dos resuldados através do site próprio                                        & Não se aplica                                                                          \\ \hline
\end{tabular}
\end{tabularx}
\end{longtabu}
\end{landscape}
}

As I told in the comments section, I'm new to Latex, so I don't really know what I'm doing. I want to create a landscaped table and it's a long one. I've created the code with tablesgenerator.com, as I told you, and I though wrapping it around \begin{landscape} would rotate it. But it doesn't and I don't know why

12
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – jub0bs
    Dec 9, 2013 at 22:37
  • 1
    It is far from clear what output you are trying to get. You have a tabular inside a tabularx inside a longtabu, which seems like 2 table environments too many:-) longtabu will break over a page but tabularx and tabular will not, so essentially you just have the inner tabular, the tabularx and longtabu can not do anything useful Dec 9, 2013 at 22:41
  • Please don't post multiple unconnected fragments, post a single (smal) complete document that shows the problem Dec 9, 2013 at 22:42
  • I'm new to Latex, so I don't really know what I'm doing. I want to create a landscaped table and it's a long one. I've created the code with tablesgenerator.com, as I told you, and I though wrapping it around \begin{landscape} would rotate it. That's all..
    – Frias
    Dec 9, 2013 at 22:43
  • Ok, I'll edit my question
    – Frias
    Dec 9, 2013 at 22:44

1 Answer 1

3

This isn't quite right but will get you started, please in future make a complete single document, as here. Note there were many errors in the use of | in \multicolumn, you should only put rules on the right, except for the first column. Also you need to not use l columns as they don't allow the cell contents to wrap.

enter image description here

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{pdflscape}
\usepackage{longtable,multirow}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\chapter{Descrição do estudo de caso}
\label{descricao}


\begin{landscape}\tiny
\begin{longtable}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|}
\hline
\multirow{2}{2cm}{\centering\textbf{Atividade de Suporte}} & 
\multirow{2}{2cm}{\centering\textbf{Ligação com a cadeia de fornecedores (insumos)}}&
\centering\textbf{Atividades Primárias} &
\multirow{2}{5cm}{\centering\textbf{Ligação com a cadeia de distribuidores}}\\ \cline{3-7}
                                                                    &                                                                                                & \centering\textbf{Logística Interna} & \centering\textbf{Operações}& \centering \textbf{Logística Externa} & \centering \textbf{Marketing e Vendas} &
 \centering\textbf{Serviços}   &                                                                                        \\ \hline
\textbf{Aquisição}                                                  & Dados das Agências de Saúde                                                                    & \ttfamily\begin{tabular}[c]{@{}c@{}}<span style="line-height: 1.5em;">Equipe</span>\\ <span style="line-height: 1.5em;">Hardware</span>\end{tabular} & Subentende-se a utilização de um software de gerenciamento do workflow & Não se aplica                                   & Não se aplica                                           & Realização de parcerias com Agências Internacionais de Saúde                               & Não se aplica                                                                          \\ \hline
\textbf{Tecnologia e Desenvolvimento}                               & Agrega valor com os dados fornecidos das empresas parceiras                                    & Transferência de tecnologia agregando valor ao conhecimento                                                                                 & Não se aplica                                                          & Não se aplica, pois o produto próprio           & Não se aplica, pois o projeto está no inicio            & Melhorar o algoritmo para dar mais precisão as previsões                                   & Permitir um acesso mais rápido a informação sobre as previsões                         \\ \hline
\textbf{Administração de Recursos Humanos}                          & Estabelecer parcerias com agências de saúde                                                    & Recrutamento de profissionais qualificados                                                                                                  & Manter atualização constante de treinamento especializado              & Não se aplica                                   & Não se aplica                                           & Tornar transparente as formas de acesso dos clientes à empresa para a correção do problema & Não se aplica                                                                          \\ \hline
\textbf{Sistemas de Administração}                                  & Garantir a privacidade dos usuários                                                            & Controle dos dados fornecidos pelas Agências de Saúde                                                                                       & Acompanhamento dos dados atualizados sobre gripe no mundo              & Não se aplica                                   & Acompanhamento de notícias relacionadas ao produto para & Apresentação dos resuldados através do site próprio                                        & Não se aplica                                                                          \\ \hline
\end{longtable}
\end{landscape}



\end{document}
8
  • It doesn't work.. This is what I get: tinypic.com/r/1jmh48/5
    – Frias
    Dec 10, 2013 at 0:24
  • @LuizFernando Are you using pdflatex?, what viewer was that? The code above produces the image above with pdflatex. Dec 10, 2013 at 0:26
  • i'm using texmaker
    – Frias
    Dec 10, 2013 at 0:32
  • @LuizFernando texmaker is an editor, it must be using some version of Tex in the background. What does your .log file say at the top? Dec 10, 2013 at 0:33
  • Ohh I see. "This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatex 2012.10.29) "
    – Frias
    Dec 10, 2013 at 0:37

You must log in to answer this question.

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