Question

J'ai une table très longue qui couvre en LATEX plusieurs pages et est (comme il est maintenant) aussi trop large pour la page.

J'utilise le package longtable avec chaque largeur de la colonne spécifiée par la commande p{width}.

Le problème est que la plupart des lignes contiennent un appel multicolonne, et ne sont donc pas adhérer à la commande p{width} préambule, ce qui provoque la largeur totale de la table est trop grande.

Exemple minimal:

\begin{longtable}{|p{1in}|p{0.75in}|p{0.5in}|p{0.5in}|>{p{1in}|p{1in}|}
\caption{some cap} \label{somelable}\\
\hline
\multicolumn{2}{|c|}{\textbf{Text Header One}} & \multicolumn{2}{|c|}{\textbf{Text Header Two}} & \multirow{2}{*}{\textbf{Three}} & \multirow{2}{*}{\textbf{Four}} \tabularnewline \cline{1-4}
\textbf{Five} & \textbf{Six} & \textbf{Seven} & \textbf{Eight} &  & \tabularnewline \hline
Some Text String & Longer Text String Here & More Text Here & Text Example & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hlineExample Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & width of box & text & Text & Text  \tabularnewline \hline
\end{longtable} 

Je chargeais longtable dans mon préambule, et en cours d'exécution pdflatex à plusieurs reprises (comme indiqué dans la documentation longtable). Il compile avec 0 avertissements et 0 erreurs.

Comment puis-je obtenir des cellules "étroites" normales?

Était-ce utile?

La solution

Vous avez essayé d'utiliser |p{<sum of widths>}| pour l'option de formatage à \multicolumn?

Il suffit de deviner ici.

Autres conseils

Vous devez donner un paramètre de taille à multicolonnes, même si il y a une taille préambule. L'exemple suivant est une cellule multicolonne de la taille de la largeur de la table:

\begin{tabular}{p{0.3\textwidth} p{0.7\textwidth}}
\multicolumn{2}{ p{\textwidth}} {YOUR TEXT HERE}
\end{tabular}

\ begin {{p} longtable {} p {2.8cm 2.8cm} a fonctionné pour moi ..

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top