10
votes

Comment puis-je limiter la taille de mes cellules \ multicolonnes dans une longue mesure?

J'ai une table vraiment longue en latex qui couvre plusieurs pages et que (comme il est maintenant) aussi trop large pour la page.

J'utilise l'emballage à long terme avec chaque largeur de colonne spécifiée avec le p {largeur} code> commande. p>

Le problème est que la plupart des lignes contiennent un appel multicolonné et ne respectent donc pas le préambule p {largeur} code> , qui provoque une largeur totale de la table d'être trop grande. P>

Exemple minimal: P>

\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} 


0 commentaires

3 Réponses :


7
votes

Avez-vous essayé d'utiliser | p {} | pour l'option de formatage sur \ multicolumn ?

deviner juste ici.


4 commentaires

Travaillé comme un charme. Merci pour la réponse rapide!


@Irus Le deuxième argument à \ Multicolumn est un spécificateur de format qui prend la même signification que dans le deuxième argument sur un environnement tabulaire . Voir Stackoverflow.com/Questtions/440228/... Pour un résumé de la manière de l'utiliser. La situation de MICA ici est une affaire d'angle intéressante où il s'appuie sur des largeurs de colonne fixes et des objets d'ouverture multicolonne à trop.


Ok, maintenant je comprends comment utiliser cela. Merci!


La somme des largeurs n'est pas suffisante, surtout si vous avez beaucoup de colonnes fusionnées. Voir tex.stackexchange.com/questions/204911/...



1
votes

\ begin {long tardif} {p {2.8cm} p {2.8cm} a travaillé pour moi ..


0 commentaires

2
votes

Vous devez donner un paramètre de taille aux multicolonnes, même s'il existe une taille de préambule. L'exemple suivant est une cellule multicolonne de la taille de la largeur de table: xxx


0 commentaires