- Questo topic ha 15 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 8 anni, 1 mese fa da .
-
Topic
-
Ciao a tutti.Per la tesi ho una tabella di 11 colonne con numerose variabili, e a meno di usare un corpo \tiny (praticamente serve la lente d’ingrandimento) non ci sta su una pagina sola.
Sto provando a usare l’accoppiata pdflscape e longtable, ma la compilazione si pianta sempre con errori ogni volta diversi e che non riesco a discernere l’origine nella massa dei dati. Io non so più che fare, mi potete dare un occhio?
Se avete altre soluzioni per gestire così tanti dati (purchè non sia riscrivere la tabella) sono bene accette.Ecco il codice incriminato:
Spoiler
`
% !TEX encoding = UTF-8
% !TEX TS-program = pdflatex
% !TEX spellcheck = it-IT
%
\documentclass[10pt,a4paper,twoside,openright,titlepage]{book}\usepackage{etex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage{mathpazo}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{caption}
\captionsetup{format=hang,labelfont=bf,tableposition=top,figureposition=bottom,font={sf,small}}
\usepackage[%
output-decimal-marker={,},%
per-mode=symbol,%
abbreviations=false,%
separate-uncertainty,%
]{siunitx}
\sisetup{
input-comparators,
list-final-separator = { \translate{e} },
list-pair-separator = { \translate{e} },
range-phrase = –,
}
\usepackage{pdflscape}
\usepackage{bookmark}
\usepackage{hyperref}\newcommand*{\h}{\hspace{5pt}}
\newcommand{\pval}{\emph{p-value}}\begin{document}
\begin{landscape}
\begin{longtable}{lcccccccccc}
%
%{lccccS[table-format=1.2]cS[table-format=1.4]S[table-format=1.2]cS[table-format=1.4]}
%
\caption{Fattori associati alla sospensione}
\label{tab:sosp}
%\toprule
\multirow{2}*{Variabile} & \multicolumn{2}{c}{No sospensione} & \multicolumn{2}{c}{Sospensione} & {OR} & IC 95\% & {\pval} & {adj. OR} & IC 95\% & {\pval} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
& N & \% & N & \% \\
%\midrule
\textbf{Genere} & & & & & & & 0.1177 & & & 0.2352 \\
\h Femmina & $276$ & $45.8$ & $162$ & $50.6$ & 1.26 & $0.95-1.67$ & & 1.21 & $0.88-1.65$ & \\
\h Maschio & $327$ & $54.2$ & $158$ & $49.4$ & 1 & & & 1 & & \\
\textbf{Età alla diagnosi} & & & & & & & 0.0001< & & & 0.2352 \\ \h $0-14$ & $223$ & $37$ & $188$ & $58.8$ & 2.10 & $1.48-2.98$ & & 1.07 & $0.67-1.71$ & \\ \h $\ge 14$ & $380$ & $63$ & $132$ & $41.2$ & 1 & & & 1 & & \\ \textbf{Epilessia} & & & & & & & 0.0083 & & & 0.5676 \\ \h Focale criptogenica & $177$ & $30.3$ & $94$ & $30$ & 1.65 & $1.10-2.48$ & & 0.97 & $0.53-1.76$ & \\ \h Focale idiopatica & $23$ & $3.9$ & $28$ & $9$ & 3.13 & $1.60-6.12$ & & 1.42 & $0.59-3.43$ & \\ \h Focale sintomatica & $174$ & $29.7$ & $56$ & $17.9$ & 1 & & & 1 & & \\ \h Gen. criptogenica/sint. & $21$ & $3.6$ & $16$ & $5.1$ & 2.14 & $1.01-4.51$ & & 1.53 & $0.65-3.57$ & \\ \h Gen. idiopatica & $155$ & $26.5$ & $100$ & $32$ & 1.91 & $1.27-2.88$ & & 0.80 & $0.43-1.52$ & \\ \h Indeterminata & $30$ & $5.1$ & $12$ & $3.8$ & 1.12 & $0.56-2.40$ & & 0.65 & $0.25-1.68$ & \\ \h Inclassificabile & $3$ & $0.5$ & $7$ & $2.2$ & 4.64 & $1.08-20.1$ & & 1.93 & $0.39-9.50$ & \\ \h Speciale & $2$ & $0.3$ & $0$ & $0$ & & & & & & \\ \h NA & $18$ & $$ & $7$ & $$ & & & & & & \\ \textbf{Eziologia} & & & & & & & 0.0614 & & & \\ \h Genetica & $171$ & $29.5$ & $108$ & $35.2$ & 1.63 & $1.11-2.39$ & & & $$ & \\ \h Indeterminata & $216$ & $37.2$ & $130$ & $42.3$ & 1.54 & $1.07-2.23$ & & & & \\ \h Metabolica & $5$ & $0.9$ & $0$ & $0$ & & $$ & & & $$ & \\ \h Strutturale & $188$ & $32.4$ & $69$ & $22.5$ & 1 & $$ & & & $$ & \\ \h NA & $23$ & $$ & $13$ & $$ & & $$ & & & $$ & \\ \textbf{Crisi focali} & & & & & & & 0.0208 & & & \\ \h Sì & $423$ & $70.1$ & $198$ & $61.9$ & 1 & $$ & & & $$ & \\ \h No & $180$ & $29.9$ & $122$ & $38.1$ & 1.43 & $1.06-1.93$ & & & & \\ \textbf{Neuroimaging} & & & & & & & 0.0001< & & & 0.0543 \\ \h Normale & $345$ & $60.2$ & $234$ & $76.5$ & 2.07 & $1.49-2.86$ & & 1.64 & $0.99-2.70$ & \\ \h Anormale & $228$ & $39.8$ & $72$ & $23.5$ & 1 & & & 1 & & \\ \h NA & $30$ & $$ & $14$ & $$ & & & & & & \\ \textbf{Esame neurologico} & & & & & & & 0.0258 & & & 0.8799 \\ \h Anormale & $91$ & $15.7$ & $33$ & $10.9$ & 1 & $$ & & 1 & $$ & \\ \h Normale & $490$ & $84.3$ & $270$ & $89.1$ & 1.66 & $1.06-2.59$ & & 0.96 & $0.53-1.73$ & \\ \h NA & $22$ & $$ & $17$ & $$ & & & & & & \\ \textbf{Esame psichico} & & & & & & & 0.0041 & & & 0.0423 \\ \h Anormale & $107$ & $19.1$ & $42$ & $13.9$ & 1 & $$ & & 1 & $$ & \\ \h Normale & $452$ & $80.9$ & $260$ & $86.1$ & 1.84 & $1.21-2.79$ & & 1.72 & $1.02-2.89$ & \\ \h NA & $44$ & $$ & $18$ & $$ & & & & & & \\ \textbf{Chirurgia} & & & & & & & 0.3888 & & & 0.8086 \\ \h Sì & $19$ & $3.2$ & $7$ & $2.2$ & 1 & $$ & & 1 & $$ & \\ \h No & $584$ & $96.8$ & $313$ & $97.8$ & 1.50 & $0.60-3.79$ & & 1.14 & $0.40-3.26$ & \\ %\bottomrule \end{longtable} \end{landscape} \end{document} `Per confronto la tabella come viene su una pagina sola:
Spoiler
`
% !TEX encoding = UTF-8
% !TEX TS-program = pdflatex
% !TEX spellcheck = it-IT
%
\documentclass[10pt,a4paper,twoside,openright,titlepage]{book}\usepackage{etex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage{lmodern}
\usepackage{microtype}\usepackage{crop}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{caption}
\captionsetup{format=hang,labelfont=bf,tableposition=top,figureposition=bottom,font={sf,small}}\usepackage[%
output-decimal-marker={,},%
per-mode=symbol,%
abbreviations=false,%
separate-uncertainty,%
]{siunitx}
\sisetup{
input-comparators,
list-final-separator = { \translate{e} },
list-pair-separator = { \translate{e} },
range-phrase = –,
%range-phrase = { \translate{a} },
}\usepackage{bookmark}
\usepackage{hyperref}\newcommand*{\h}{\hspace{5pt}}
\newcommand{\pval}{\emph{p-value}}\begin{document}
\begin{sidewaystable}
%\small
%\footnotesize
\tiny
\caption{Fattori associati alla sospensione}
\label{tab:sosp}
\centering
\begin{tabular}{lccccS[table-format=1.2]cS[table-format=1.4]S[table-format=1.2]cS[table-format=1.4]}
\toprule
\multirow{2}*{Variabile} & \multicolumn{2}{c}{No sospensione} & \multicolumn{2}{c}{Sospensione} & {OR} & IC 95\% & {\pval} & {adj. OR} & IC 95\% & {\pval} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
& N & \% & N & \% \\
\midrule
\textbf{Genere} & & & & & & & 0.1177 & & & 0.2352 \\
\h Femmina & $276$ & $45.8$ & $162$ & $50.6$ & 1.26 & $0.95-1.67$ & & 1.21 & $0.88-1.65$ & \\
\h Maschio & $327$ & $54.2$ & $158$ & $49.4$ & 1 & & & 1 & & \\
\textbf{Età alla diagnosi} & & & & & & & 0.0001< & & & 0.2352 \\ \h $0-14$ & $223$ & $37$ & $188$ & $58.8$ & 2.10 & $1.48-2.98$ & & 1.07 & $0.67-1.71$ & \\ \h $\ge 14$ & $380$ & $63$ & $132$ & $41.2$ & 1 & & & 1 & & \\ \textbf{Epilessia} & & & & & & & 0.0083 & & & 0.5676 \\ \h Focale criptogenica & $177$ & $30.3$ & $94$ & $30$ & 1.65 & $1.10-2.48$ & & 0.97 & $0.53-1.76$ & \\ \h Focale idiopatica & $23$ & $3.9$ & $28$ & $9$ & 3.13 & $1.60-6.12$ & & 1.42 & $0.59-3.43$ & \\ \h Focale sintomatica & $174$ & $29.7$ & $56$ & $17.9$ & 1 & & & 1 & & \\ \h Gen. criptogenica/sint. & $21$ & $3.6$ & $16$ & $5.1$ & 2.14 & $1.01-4.51$ & & 1.53 & $0.65-3.57$ & \\ \h Gen. idiopatica & $155$ & $26.5$ & $100$ & $32$ & 1.91 & $1.27-2.88$ & & 0.80 & $0.43-1.52$ & \\ \h Indeterminata & $30$ & $5.1$ & $12$ & $3.8$ & 1.12 & $0.56-2.40$ & & 0.65 & $0.25-1.68$ & \\ \h Inclassificabile & $3$ & $0.5$ & $7$ & $2.2$ & 4.64 & $1.08-20.1$ & & 1.93 & $0.39-9.50$ & \\ \h Speciale & $2$ & $0.3$ & $0$ & $0$ & & & & & & \\ \h NA & $18$ & $$ & $7$ & $$ & & & & & & \\ \textbf{Eziologia} & & & & & & & 0.0614 & & & \\ \h Genetica & $171$ & $29.5$ & $108$ & $35.2$ & 1.63 & $1.11-2.39$ & & & $$ & \\ \h Indeterminata & $216$ & $37.2$ & $130$ & $42.3$ & 1.54 & $1.07-2.23$ & & & & \\ \h Metabolica & $5$ & $0.9$ & $0$ & $0$ & & $$ & & & $$ & \\ \h Strutturale & $188$ & $32.4$ & $69$ & $22.5$ & 1 & $$ & & & $$ & \\ \h NA & $23$ & $$ & $13$ & $$ & & $$ & & & $$ & \\ \textbf{Crisi focali} & & & & & & & 0.0208 & & & \\ \h Sì & $423$ & $70.1$ & $198$ & $61.9$ & 1 & $$ & & & $$ & \\ \h No & $180$ & $29.9$ & $122$ & $38.1$ & 1.43 & $1.06-1.93$ & & & & \\ \textbf{Neuroimaging} & & & & & & & 0.0001< & & & 0.0543 \\ \h Normale & $345$ & $60.2$ & $234$ & $76.5$ & 2.07 & $1.49-2.86$ & & 1.64 & $0.99-2.70$ & \\ \h Anormale & $228$ & $39.8$ & $72$ & $23.5$ & 1 & & & 1 & & \\ \h NA & $30$ & $$ & $14$ & $$ & & & & & & \\ \textbf{Esame neurologico} & & & & & & & 0.0258 & & & 0.8799 \\ \h Anormale & $91$ & $15.7$ & $33$ & $10.9$ & 1 & $$ & & 1 & $$ & \\ \h Normale & $490$ & $84.3$ & $270$ & $89.1$ & 1.66 & $1.06-2.59$ & & 0.96 & $0.53-1.73$ & \\ \h NA & $22$ & $$ & $17$ & $$ & & & & & & \\ \textbf{Esame psichico} & & & & & & & 0.0041 & & & 0.0423 \\ \h Anormale & $107$ & $19.1$ & $42$ & $13.9$ & 1 & $$ & & 1 & $$ & \\ \h Normale & $452$ & $80.9$ & $260$ & $86.1$ & 1.84 & $1.21-2.79$ & & 1.72 & $1.02-2.89$ & \\ \h NA & $44$ & $$ & $18$ & $$ & & & & & & \\ \textbf{Chirurgia} & & & & & & & 0.3888 & & & 0.8086 \\ \h Sì & $19$ & $3.2$ & $7$ & $2.2$ & 1 & $$ & & 1 & $$ & \\ \h No & $584$ & $96.8$ & $313$ & $97.8$ & 1.50 & $0.60-3.79$ & & 1.14 & $0.40-3.26$ & \\ \bottomrule \end{tabular} \end{sidewaystable} \end{document} `Inoltre noterete che in ambedue i casi l’intestazione presenta un difetto grafico: “variabili” è allineato verticalmente in modo corretto, le altre etichette dopo le multicolumn invece no (sono allineate a sopra il cmidrule). Non sono riuscito a sistemare neanche quello 😳
Grazie!
- Devi essere connesso per rispondere a questo topic.