ciao a tutti,
quando compilo ottengo una tabella su due pagine.
Le linee (ottenute con “midrule”) delle pagine di destra dovrebbero essere
il proseguimento ideale di quelle di sinistra.
Ma il titolo lungo della tabella lo impedisce.
Purtroppo non posso in nessun modo accorciare i titoli delle tabelle.
Qualche idea ? grazie,
Carlo
————————————————————————————
\documentclass[12pt,a4paper,twoside]{book}\usepackage[twoside]{geometry}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
%\usepackage{mathptmx}
%\usepackage[scaled=.90]{helvet}
%\usepackage{courier}\usepackage{setspace}
\usepackage{booktabs}
\usepackage{ccaption}
\usepackage{fancyhdr}
\pagestyle{fancy}
\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{0.5\marginparwidth}\fancypagestyle{plain}{%
\fancyhf{}
\fancyhead{}
\fancyhead[LE,RO]{{\thepage}}
\renewcommand{\headrulewidth}{0pt}
}%DEFINISCO ALCUNI COMANDI PER TABELLE
\newcommand{\cnum}[1]{\multicolumn{1}{c}{\footnotesize{#1}}}
\newcommand{\cnam}[1]{\multicolumn{1}{c}{\normalsize{#1}}}%parte superiore tabella
\newcommand{\uptable}[1]{
\begin{table}[t]
\caption{#1}
\begin{scriptsize}
%\centering
\begin{tabular*}{\textwidth}%
{@{\extracolsep{\fill}}l*8{r}}\midrule
& \cnum{(1)} &\cnum{(2)} &\cnum{(3)} &\cnum{(4)} &\cnum{(5)} &\cnum{(6)} &\cnum{(7)} &\cnum{(8)} \\
& \cnam{Piem.}&\cnam{Lig.} &\cnam{Lomb.} &\cnam{Veneto}&\cnam{Emilia} &\cnam{Tosc.} &\cnam{Marche}&\cnam{Umbria} \\
\midrule
& & & & & & & & \\
}% parte centrale:
\newcommand{\midtable}{
& & & & & & & & \\
\midrule
\end{tabular*}
\end{scriptsize}
\end{table}\begin{table}[!h]
\contcaption{cont.}
\begin{scriptsize}
%\centering
\begin{tabular*}{\textwidth}%
{@{\extracolsep{\fill}}l*8{r}}
\midrule
&\cnum{(9)} &\cnum{(10)} &\cnum{(11)} &\cnum{(12)} &\cnum{(13)} &\cnum{(14)} &\cnum{(15)}&\cnum{(16)} \\
&\cnam{Lazio}&\cnam{Abr.} &\cnam{Camp.} &\cnam{Puglie} &\cnam{Basil.} &\cnam{Calab.} &\cnam{Sic.}&\cnam{Sard.}\\
\midrule
& & & & & & & & \\
}% parte inferiore:
\newcommand{\lowtable}[1]{
& & & & & & & & \\
\midrule\end{tabular*}
\end{scriptsize}\vspace{0.1cm}
\footnotesize{Fonte: vedi testo, {#1}.}
\end{table}
}\makeatletter
\renewcommand{\fnum@table}[1]{\tablename~\thetable~~}
\makeatother\renewcommand\tablename{Tabella}
%Left aligned caption in tables
\makeatletter
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\makeatother%Vertical space over/under captions
\setlength{\abovecaptionskip}{0.1cm}
\setlength{\belowcaptionskip}{0.2cm}\begin{document}
\pagestyle{plain}
\chapter*{}
\newpage\begin{table}
\caption{Questo è un titolo lungo che occupa più di una rigaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (unità di misura)}
\begin{scriptsize}
\begin{tabular*}{\textwidth}%
{@{\extracolsep{\fill}}l*8{r}}
\midrule
& \cnum{(1)} &\cnum{(2)} &\cnum{(3)} &\cnum{(4)} &\cnum{(5)} &\cnum{(6)} &\cnum{(7)} &\cnum{(8)} \\
& \cnam{Piem.}&\cnam{Lig.} &\cnam{Lomb.} &\cnam{Veneto}&\cnam{Emilia} &\cnam{Tosc.} &\cnam{Marche}&\cnam{Umbria} \\
\midrule
& & & & & & & & \\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& & & & & & & & \\
\midrule
\end{tabular*}
\end{scriptsize}
\end{table}
%——————————————————————————————————————-
\begin{table}[!h]
\contcaption{cont.}\begin{scriptsize}
\begin{tabular*}{\textwidth}%
{@{\extracolsep{\fill}}l*8{r}}
\midrule
&\cnum{(9)} &\cnum{(10)} &\cnum{(11)} &\cnum{(12)} &\cnum{(13)} &\cnum{(14)} &\cnum{(15)}&\cnum{(16)} \\
&\cnam{Lazio}&\cnam{Abr.} &\cnam{Camp.} &\cnam{Puglie} &\cnam{Basil.} &\cnam{Calab.} &\cnam{Sic.}&\cnam{Sard.}\\
\midrule
& & & & & & & & \\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& 10,14&10,14 & 10,14& 10,14& 10,14& 10,14& 10,14&10,14\\
& & & & & & & & \\
\midrule\end{tabular*}
\end{scriptsize}\end{table}
\end{document}
Perché inserire decine di righe di codice che non usi affatto? Che c’entra questo con la sezione sulla tipografia? 🙄
`\contcaption{cont.\hspace*{\textwidth minus 80pt}\\\mbox{}}`
Togli la parte “minus 80pt” e guarda il messaggio di “Overfull” relativo, quindi riaggiungilo sostituendo 80pt con il numero che viene fuori.
Naturalmente lo specificatore [!h] è sbagliato. Così come l’uso degli inesistenti ambienti scriptsize; basta scrivere \scriptsize.
Ciao
Enrico