Tabla demasiado ancha para la página

Tabla demasiado ancha para la página

Estoy intentando colocar una tabla bastante grande en mi página. Es demasiado ancho para la página. Probé algo como

\begin{longtable}{| p{0.14\textwidth} | p{0.14\textwidth} | 
p{0.14\textwidth} | p{0.14\textwidth} | p{0.14\textwidth} | 
p{0.14\textwidth} | p{0.14\textwidth} |}

porque tengo siete columnas.

Uno de los problemas que tengo ahora es que, como estoy usando scrartcl, el espacio de anotación también se incluye \textwidth, pero por supuesto quiero permanecer dentro de los límites normales.

Además, ya estoy usando el tamaño de las notas al pie, pero no separa las palabras --> si son demasiado largas, se escriben parcialmente en la siguiente columna.

Ahora necesito un método que ajuste la tabla al ancho de página "normal" (como se muestra en showframe) y también agregue un salto de línea o separe palabras, para evitar escribir en la siguiente columna.

No publiqué un ejemplo mínimo porque estoy abierto a todas las soluciones posibles (pero debería usar algo como longtable y, si es posible, ajustar el tamaño de la columna en relación con \textwidth).
(lo siento si esto parece un poco desordenado)

\begin{footnotesize}
\begin{center}
  \begin{longtable}{| p{0.14\textwidth} | p{0.14\textwidth} |
  p{0.14\textwidth} | p{0.14\textwidth} | p{0.14\textwidth} | 
  p{0.14\textwidth} | p{0.14\textwidth} |}
    \hline 
  \textbf{Variable} & \textbf{Kurzbezeichnung} & \textbf{Frage} & \textbf{type} & \textbf{value label} & \textbf{Range} & \textbf{missing value}\\
  \hline
  \endhead % all the lines above this will be repeated on every page
  ffhrwoggbgbgfieh & fefgogergeroigregb & fhoergregre & fhoerghergie & herogheggire & hgieghrgri & ngjreoigehrero\\
  \hline
  \caption{Alle Variablen von der Dokumentation aus dem Codebuch.}
  \label{tab:VarDoku}
  \end{longtable}
\end{center}
\end{footnotesize}

Respuesta1

No es posible que "Kurzbezeichnung" pueda caber en un ancho tan estrecho, así que lo abrevié a "KB".

\documentclass{article}
\usepackage{longtable,calc,array}

\newlength\alicewidth

\begin{document}

\begingroup\footnotesize
\setlength{\alicewidth}{\textwidth/7-2\tabcolsep-8\arrayrulewidth/7}
\begin{longtable}{|*{7}{>{\raggedright\arraybackslash}p{\alicewidth}|}}
\hline
\textbf{Variable} & \textbf{KB} & \textbf{Frage} &
  \textbf{type} & \textbf{value label} & \textbf{Range} & \textbf{missing value}\\
\hline
\endhead % all the lines above this will be repeated on every page

ffhrwo ggbgbg fieh & fefgo gerge roigr egb & fhoerg regre & fhoerg hergie &
 herogh eggire & hgieg hrgri & ngjreoi gehrero\\

\hline
\caption{Alle Variablen von der Dokumentation aus dem Codebuch.\label{tab:VarDoku}}
\end{longtable}
\endgroup

\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Usaría el ltablexpaquete, que combina las funcionalidades de longtabley tabularxy makecellpara tener un formato común para todos los encabezados de columna. Además, los títulos de las tablas suelen colocarsearribatabla, especialmente en el caso de tablas de varias páginas, para facilidad del lector:

\documentclass[a4paper]{scrartcl}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{caption, ltablex, makecell}%
\captionsetup{font=footnotesize, labelfont=sc}
\renewcommand\theadfont{\footnotesize\bfseries}
\usepackage{showframe} %
\renewcommand\ShowFrameLinethickness{0.3pt}
\renewcommand{\tabularxcolumn}[1]{>{\footnotesize\arraybackslash}p{#1}}

\begin{document}

\
\keepXColumns
\begin{tabularx}{\linewidth}{|*{7}{ X|}}
  \caption{Alle Variablen von der Dokumentation aus dem Codebuch.}\medskip
  \label{tab:VarDoku}\\
  \hline \thead{Variable} & \thead{Kurzbe- & & & & & \\zeichnung} & \thead{Frage} & \thead{Type} & \thead{Value\\ label} & \thead{Range} & \thead{Missing\\ value}\\
  \hline
  \endfirsthead
  \hline
  \thead{Variable} & \thead{Kurzbe- & & & & & \\zeichnung} & \thead{Frage} & \thead{type} & \thead{value\\ label} & \thead{Range} & \thead{missing\\ value}\\
  \hline
  \endhead % all the lines above this will be repeated on every page
  ffhrwogg bgbgfieh & fefgogerge roigregb & fhoergregre & fhoerghergie & herogheggire & hgieghrgri & ngjreoigeh rero \\

  \hline
\end{tabularx}

\end{document} 

ingrese la descripción de la imagen aquí

información relacionada