0

I have been making an assignment for for the qualification on the course for my wife, in landscape form using long table. It is turning to be larger than the page. I'm inexperienced in matters of LaTeX.

  1. As well as to adjust the table in page?
  2. The is large text area!! Like going to try adjusting the text, someone know how to make?

I thank you in advance.

enter image description here

\documentclass[12pt, a4paper]{article}

\usepackage[brazil]{babel}      
\usepackage[latin1]{inputenc}     
\usepackage[T1]{fontenc}        
\usepackage{mathpazo}           

%\usepackage{indentfirst}               

\setlength{\parskip}{2mm}
\usepackage[a4paper,top=2.554cm,bottom=2.554cm,left=2.554cm,right=2.554cm]{geometry} 

\usepackage{a4wide}             

\usepackage{setspace}           


\usepackage{color}              
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[colorlinks=true,
            linkcolor=black,
            urlcolor=blue,
            citecolor=black]{hyperref}

%\usepackage{hyperref}          

\usepackage{url}

\usepackage{textcomp}           

\usepackage{siunitx}     
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{array}              
\usepackage{booktabs}           
\usepackage{tabularx}           
\usepackage{longtable}          
\usepackage{lscape}             

\usepackage[pdftex]{graphicx}
\graphicspath{{./imagens/}}

% \usepackage{helvet}
% \renewcommand{\familydefault}{\sfdefault}

\usepackage{fancyhdr}       


%\linespread{1.3}

%\usepackage[round,sort,nonamebreak]{natbib} % 
%\bibpunct{(}{)}{;}{a}{,}{,}

\usepackage[square, comma, authoryear, sort&compress, nonamebreak]{natbib}

\usepackage{fancyhdr}

==================================================================================================================================================

\newpage
\begin{landscape}

\begin{table}[!h]
\centering
\begin{longtable}{c|c|c|c|>{\arraybackslash}p{6.5cm}@{}}
\hline
Desenho do Estudo & Principais Resultados & Ano  & Referência \\ \hline

Caracterização física de frutos e sementes de goiaba-da-costa-rica, produzidos em Manaus-Amazonas & O fruto apresentou atributos favoráveis ao aproveitamento industrial, como o elevado rendimento em polpa (94$\%$) O número elevado de sementes por fruto representa uma característica facilitadora à propagação e produção de mudas. &     85,00    & 80,80    \\

Manganês            & mg    &   0,09     &  0,15    \\ \hline
\end{longtable}
\caption{Estudos Sobre Aplicação dos Resíduos da Goiaba.}
\label{cqsg}
\end{table}

\end{landscape}
\newpage   
  • Welcome to TeX.SX! Please make your example compilable with an minimal working example (MWE), that illustrates your problem. – Bobyandbob Nov 4 '17 at 14:05
  • BTW: longtable in table makes not sense. table is a float but longtable should have page breaks that cannot be in floats. You should use either tabular in table or longtable without table. And you have declared 5 columns but using only 4. Maybe you should either use 4 p-columns or 4 c-columns and \multicolumn with p-columns for the long texts inside the columns. – Schweinebacke Nov 4 '17 at 14:09
  • Can you help me? With a sample code! I need the text to fit in the first two columns. Long texts. – Júnior Mabulla Nov 4 '17 at 14:15
1

You can use the ltxtable package, which brings the functionalities of longtable to tabularx. I also loaded caption to adjust the caption width and have a decent vertical spacing between caption and table. Needless in this case to load longtable, tabularx and array in this case.

It's better to use the utf8 inputenc, as it is the default in most modern TeX editors, and to declare default language with the document class, so that all packages depending on the language be aware of it

\documentclass[12pt, a4paper, brazil]{article}

\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}

\setlength{\parskip}{2mm}
\usepackage[a4paper,top=2.554cm,bottom=2.554cm,left=2.554cm,right=2.554cm]{geometry}
\usepackage[utf8]{inputenc} 

\usepackage{setspace}

\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{url}

\usepackage{textcomp}

\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{bigstrut} 
\usepackage{booktabs}
\usepackage{caption} 
\usepackage{ltablex}
\usepackage{lscape}

\usepackage{fancyhdr}
\usepackage[square, comma, authoryear, sort&compress, nonamebreak]{natbib}
\usepackage[colorlinks=true,
            linkcolor=black,
            urlcolor=blue,
            citecolor=black]{hyperref}

\begin{document}

\begin{landscape}
\centering\setlength{\extrarowheight}{2pt}
\keepXColumns\captionsetup{width=\linewidth}
\begin{tabularx}{\linewidth}{|X|X|c|c|}%>{\arraybackslash}p{6.5cm}@{}}
\caption{Estudos Sobre Aplicação dos Resíduos da Goiaba.}
\label{cqsg}\\
\hline
\endfirsthead%
 \hline \endfoot
Desenho do Estudo & Principais Resultados & Ano & Referência \\ \hline

Caracterização física de frutos e sementes de goiaba-da-costa-rica, produzidos em Manaus-Amazonas & O fruto apresentou atributos favoráveis ao aproveitamento industrial, como o elevado rendimento em polpa (94$\%$) O número elevado de sementes por fruto representa uma característica facilitadora à propagação e produção de mudas. & 85,00 & 80,80 \\
Manganês & mg & 0,09 & 0,15 \bigstrut[t]
\end{tabularx}

\end{landscape}

\end{document}

enter image description here

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.