4

enter image description here

Why isn't the table adjusting the text to make line breaks when necessary? Can I make them manually? What could be done to fix these margins?

Edit: MWE below:

\documentclass[a4paper,12pt,spanish]{article}
\usepackage{multirow}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage[spanish]{babel}
\usepackage{graphicx}
\begin{document}
\begin{center}
\begin{tabular}{|r|ccccc|}
\hline
   & Descripción & Narración & Diálogo & Exposición & Argumentación \\
\hline
  Técnico-científico &  &  &  & Habitual & \\
  Jurídico-administrativo &  &  &  &  & \\
  Humanístico &  &  &  & Estudio & Ensayo\\
  Periodístico &  &  &  & Noticia & Art. opinión\\
  Literario & Descripción & Novela & Teatro & \multicolumn{2}{c|}{Lengua literaria}\\
\hline
\end{tabular}
\end{center}
\end{document}

Edit 2: Problem remains when changing tabular with tabu. Aditionally, it gives me a non fatal error when compiling: Overfull \hbox (57.79063 too wide) (page 2), lines 112-123. Since this table appears in the page 2 and the code lines match too, it probably wants to tell me something, but I don't know what it means.

1 Answers1

6

Your tabular preamble only specifies r and c columns such entres are like \mbox and do not allow line breaking. Thus your table is too wide for the page and LaTex reports:

Overfull \hbox (56.68524pt too wide) in paragraph at lines 12--23

You should not ignore such warnings.

LaTeX does not centre too-wide material it just sticks out into the right margin.

These are still a bit wide but show possible alternatives

\documentclass[a4paper,12pt,spanish]{article}
\usepackage{multirow}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage[spanish]{babel}
\usepackage{graphicx}
\begin{document}
\begin{center}

X\dotfill X


\begin{tabular}{|r|ccccc|}
\hline
   & Descripción & Narración & Diálogo & Exposición & Argumentación \\
\hline
  Técnico-científico &  &  &  & Habitual & \\
  Jurídico-administrativo &  &  &  &  & \\
  Humanístico &  &  &  & Estudio & Ensayo\\
  Periodístico &  &  &  & Noticia & Art. opinión\\
  Literario & Descripción & Novela & Teatro & \multicolumn{2}{c|}{Lengua literaria}\\
\hline
\end{tabular}

{\footnotesize

\begin{tabular}{|r|ccccc|}
\hline
   & Descripción & Narración & Diálogo & Exposición & Argumentación \\
\hline
  Técnico-científico &  &  &  & Habitual & \\
  Jurídico-administrativo &  &  &  &  & \\
  Humanístico &  &  &  & Estudio & Ensayo\\
  Periodístico &  &  &  & Noticia & Art. opinión\\
  Literario & Descripción & Novela & Teatro & \multicolumn{2}{c|}{Lengua literaria}\\
\hline
\end{tabular}

}


\begin{tabular}{|p{2.5cm}|ccccc|}
\hline
   & Descripción & Narración & Diálogo & Exposición & Argumentación \\
\hline
  Técnico-científico &  &  &  & Habitual & \\
  Jurídico-administrativo &  &  &  &  & \\
  Humanístico &  &  &  & Estudio & Ensayo\\
  Periodístico &  &  &  & Noticia & Art. opinión\\
  Literario & Descripción & Novela & Teatro & \multicolumn{2}{c|}{Lengua literaria}\\
\hline
\end{tabular}

\end{center}
\end{document}
Moriambar
  • 11,466
David Carlisle
  • 757,742
  • What exactly does {|p{2.5cm} do in your third example? – dfhsfhdsfdhsdfgjsfgjdsdfgjsfgj Mar 10 '13 at 21:33
  • It makes a column of width 2.5cm that allows lines to break (like \parbox{2.5}{...} ) This is very basic latex usage, you might like to start with a basic introduction such as "the not so short introduction" or other guides see http://tex.stackexchange.com/questions/11/what-is-the-best-book-to-start-learning-latex/583#583 – David Carlisle Mar 10 '13 at 21:40
  • I think I got it... Thanks for the link, will take a look! I've been only using LaTeX for around 2 or 3 days, and to learn what I'm doing is pass all my lecture notes to LaTeX format, so I can face errors like this and handle them correctly. – dfhsfhdsfdhsdfgjsfgjdsdfgjsfgj Mar 10 '13 at 21:42