Wie kann ich das einschränken der Größe von meinem \multicolumn Zellen in einer longtable?

StackOverflow https://stackoverflow.com/questions/1110961

  •  12-09-2019
  •  | 
  •  

Frage

Ich habe eine sehr lange Tabelle in LaTeX, die sich über mehrere Seiten erstreckt und ist (wie es jetzt ist) auch zu breit für die Seite.

Ich bin mit der longtable-Paket mit jeder Spalte der Breite angegeben mit den p{width} Befehl.

Das problem ist, dass die meisten Zeilen enthalten einen mehrspaltigen nennen, und damit sind nicht die Einhaltung der Präambel p{width} Befehl, der bewirkt, dass die gesamte Breite der Tabelle zu groß zu sein.

Minimal Beispiel:

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

Ich bin laden von longtable in meine Präambel und ausführen von pdflatex mehrmals (wie in der longtable-Dokumentation).Es kompiliert mit 0 Warnungen und 0 Fehler.

Wie bekomme ich die normale "schmale" Zellen?

War es hilfreich?

Lösung

Haben Sie versucht, mit |p{<sum of widths>}| für die Formatierung option \multicolumn?

Hier nur raten.

Andere Tipps

Sie haben eine Größe parameter multicolumns obwohl es eine Präambel Größe.Das nächste Beispiel ist eine mehrspaltige Zelle von der Größe des Tisches Breite:

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

\begin{longtable}{p{2,8 cm} p{2,8 cm} für mich gearbeitet..

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top