我必须绘制类似这张表的地球化学数据表
即标题列,但样本列要多得多。当列太多时,表格必须在某一列处拆分,并在下一页继续;最重要的是,标题列必须重复(就像在环境中一样\longtable
,只是转置)。
这已经有点讨论https://stackoverflow.com/questions/3681498/very-wide-tables-in-latex
但是,这个问题只有手动解决方案。有没有进一步的进展来实现“按列拆分表格”的自动化?
(我认为,将过宽的表格转置成长表格对易读性没有多大帮助。)
% Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{tabular}{rrrrrrrrrrrrrrrrrrrrrrrrr}
Sample & Sample 1 & Sample 2 & Sample 3 & Sample 4 & Sample 5 & Sample 6 & Sample 7 & Sample 8 & Sample 9 & Sample 10 & Sample 11 & Sample 12 & Sample 13 & Sample 14 & Sample 15 & Sample 16 & Sample 17 & Sample 18 & Sample 19 & Sample 20 & Sample 21 & Sample 22 & Sample 23 & Sample 24 \\
Major element abundances (wt\%) & & & & & & & & & & & & & & & & & & & & & & & & \\
SiO2 & 25 & 81 & 36 & 75 & 23 & 21 & 65 & 84 & 1 & 59 & 38 & 16 & 3 & 56 & 29 & 34 & 3 & 59 & 55 & 17 & 2 & 81 & 59 & 43 \\
TiO2 & 48 & 96 & 0 & 90 & 61 & 72 & 83 & 16 & 10 & 1 & 40 & 83 & 35 & 31 & 76 & 31 & 57 & 8 & 83 & 100 & 14 & 12 & 48 & 69 \\
Al2O3 & 7 & 14 & 99 & 53 & 89 & 65 & 88 & 17 & 76 & 81 & 43 & 87 & 15 & 71 & 17 & 85 & 59 & 100 & 96 & 85 & 74 & 50 & 59 & 36 \\
Fe2O3 & 32 & 34 & 23 & 86 & 50 & 58 & 8 & 29 & 88 & 27 & 49 & 16 & 19 & 89 & 45 & 88 & 79 & 42 & 42 & 29 & 10 & 60 & 87 & 97 \\
FeOt & 35 & 42 & 83 & 0 & 55 & 51 & 35 & 11 & 43 & 44 & 69 & 30 & 49 & 55 & 56 & 4 & 74 & 72 & 98 & 94 & 14 & 35 & 59 & 34 \\
MnO & 64 & 48 & 52 & 65 & 61 & 16 & 73 & 56 & 73 & 54 & 75 & 7 & 18 & 84 & 52 & 38 & 46 & 91 & 59 & 90 & 31 & 84 & 54 & 32 \\
MgO & 48 & 97 & 83 & 47 & 43 & 41 & 37 & 71 & 92 & 57 & 76 & 36 & 8 & 37 & 94 & 6 & 50 & 57 & 80 & 63 & 25 & 18 & 85 & 16 \\
CaO & 56 & 11 & 68 & 49 & 6 & 20 & 31 & 74 & 72 & 24 & 39 & 38 & 68 & 69 & 73 & 23 & 40 & 32 & 63 & 93 & 28 & 56 & 12 & 18 \\
Na2O & 73 & 18 & 0 & 62 & 98 & 61 & 59 & 42 & 97 & 47 & 74 & 31 & 40 & 3 & 75 & 2 & 52 & 96 & 67 & 44 & 84 & 9 & 35 & 51 \\
K2O & 69 & 0 & 52 & 73 & 23 & 11 & 12 & 70 & 86 & 46 & 29 & 84 & 77 & 47 & 25 & 43 & 97 & 48 & 30 & 94 & 83 & 93 & 23 & 25 \\
P2O5 & 92 & 80 & 59 & 6 & 90 & 99 & 54 & 64 & 96 & 84 & 58 & 18 & 37 & 7 & 55 & 89 & 34 & 53 & 59 & 56 & 38 & 23 & 63 & 89 \\
LOI§ & 51 & 65 & 64 & 2 & 67 & 51 & 58 & 55 & 60 & 48 & 64 & 54 & 56 & 46 & 78 & 70 & 38 & 44 & 45 & 37 & 66 & 7 & 34 & 76 \\
Mg# & 20 & 27 & 34 & 40 & 66 & 3 & 7 & 42 & 19 & 85 & 35 & 24 & 31 & 40 & 14 & 39 & 31 & 100 & 0 & 41 & 19 & 14 & 75 & 5 \\
CIA & 24 & 57 & 1 & 80 & 86 & 72 & 38 & 11 & 51 & 23 & 49 & 94 & 43 & 65 & 15 & 5 & 41 & 21 & 32 & 83 & 22 & 16 & 63 & 51 \\
Trace element abundances (ppm) & & & & & & & & & & & & & & & & & & & & & & & & \\
V & 91 & 421 & 256 & 480 & 669 & 888 & 403 & 456 & 661 & 77 & 997 & 729 & 647 & 77 & 69 & 163 & 52 & 589 & 772 & 267 & 110 & 998 & 547 & 789 \\
Cr & 635 & 712 & 208 & 938 & 754 & 600 & 91 & 531 & 211 & 798 & 880 & 240 & 197 & 671 & 298 & 921 & 538 & 577 & 49 & 195 & 596 & 744 & 719 & 910 \\
Co & 288 & 182 & 672 & 825 & 197 & 466 & 204 & 803 & 943 & 321 & 444 & 134 & 471 & 22 & 191 & 188 & 457 & 481 & 288 & 971 & 475 & 906 & 261 & 243 \\
Ni & 492 & 234 & 46 & 62 & 213 & 531 & 808 & 557 & 599 & 356 & 681 & 487 & 929 & 36 & 729 & 84 & 962 & 918 & 260 & 688 & 373 & 363 & 679 & 51 \\
Cu & 675 & 494 & 754 & 743 & 119 & 404 & 142 & 402 & 120 & 643 & 576 & 135 & 870 & 205 & 639 & 775 & 549 & 82 & 933 & 222 & 55 & 567 & 672 & 354 \\
Zn & 440 & 656 & 667 & 193 & 305 & 758 & 814 & 660 & 811 & 519 & 885 & 488 & 223 & 182 & 120 & 448 & 58 & 830 & 173 & 473 & 847 & 809 & 22 & 456 \\
Ga & 782 & 639 & 282 & 906 & 595 & 39 & 901 & 73 & 825 & 330 & 937 & 860 & 48 & 920 & 968 & 150 & 967 & 838 & 819 & 997 & 430 & 635 & 959 & 672 \\
Rb & 422 & 930 & 404 & 581 & 916 & 747 & 970 & 87 & 343 & 784 & 843 & 339 & 919 & 398 & 827 & 265 & 216 & 382 & 772 & 17 & 770 & 745 & 543 & 224 \\
Sr & 468 & 17 & 860 & 996 & 938 & 416 & 594 & 506 & 226 & 572 & 507 & 432 & 54 & 484 & 517 & 629 & 793 & 721 & 743 & 481 & 306 & 948 & 387 & 239 \\
Pb & 429 & 280 & 83 & 495 & 980 & 715 & 225 & 540 & 58 & 513 & 653 & 149 & 893 & 918 & 553 & 879 & 136 & 266 & 900 & 811 & 942 & 706 & 344 & 528 \\
U & 669 & 507 & 455 & 714 & 83 & 39 & 83 & 175 & 466 & 940 & 794 & 232 & 600 & 327 & 590 & 723 & 597 & 759 & 377 & 214 & 372 & 627 & 746 & 102 \\
Cs & 408 & 615 & 657 & 539 & 612 & 907 & 615 & 820 & 650 & 133 & 870 & 605 & 691 & 190 & 741 & 245 & 370 & 486 & 269 & 475 & 258 & 320 & 909 & 204 \\
Y & 291 & 830 & 767 & 872 & 522 & 639 & 159 & 548 & 236 & 718 & 701 & 762 & 965 & 323 & 770 & 688 & 22 & 11 & 930 & 329 & 657 & 778 & 432 & 581 \\
Zr & 902 & 131 & 233 & 211 & 399 & 315 & 730 & 852 & 76 & 973 & 350 & 887 & 201 & 895 & 691 & 885 & 223 & 830 & 690 & 477 & 424 & 756 & 659 & 166 \\
Nb & 594 & 969 & 833 & 663 & 243 & 154 & 197 & 104 & 317 & 834 & 901 & 891 & 997 & 934 & 328 & 261 & 982 & 581 & 781 & 933 & 625 & 783 & 711 & 354 \\
Ba & 790 & 957 & 606 & 730 & 754 & 928 & 646 & 0 & 389 & 71 & 616 & 434 & 107 & 126 & 692 & 118 & 983 & 24 & 281 & 808 & 743 & 381 & 139 & 856 \\
La & 624 & 859 & 233 & 176 & 540 & 138 & 188 & 475 & 478 & 203 & 614 & 53 & 435 & 694 & 66 & 860 & 628 & 271 & 338 & 799 & 924 & 877 & 777 & 721 \\
Ce & 826 & 471 & 327 & 809 & 496 & 180 & 378 & 155 & 61 & 345 & 736 & 341 & 201 & 634 & 393 & 932 & 498 & 334 & 29 & 319 & 254 & 79 & 691 & 52 \\
Pr & 476 & 447 & 951 & 786 & 450 & 717 & 248 & 790 & 561 & 259 & 748 & 104 & 881 & 804 & 385 & 676 & 435 & 815 & 634 & 234 & 809 & 105 & 471 & 529 \\
Nd & 758 & 523 & 672 & 159 & 405 & 597 & 657 & 307 & 28 & 28 & 30 & 273 & 74 & 189 & 403 & 326 & 19 & 735 & 121 & 992 & 26 & 723 & 243 & 927 \\
Sm & 307 & 422 & 764 & 933 & 197 & 180 & 956 & 276 & 347 & 492 & 534 & 760 & 904 & 247 & 0 & 518 & 593 & 714 & 223 & 619 & 634 & 39 & 265 & 445 \\
Eu & 463 & 194 & 627 & 954 & 32 & 940 & 824 & 229 & 58 & 684 & 780 & 761 & 348 & 464 & 39 & 577 & 432 & 920 & 425 & 799 & 3 & 207 & 208 & 398 \\
Gd & 863 & 274 & 512 & 718 & 770 & 900 & 221 & 674 & 342 & 553 & 522 & 945 & 880 & 23 & 605 & 544 & 214 & 987 & 348 & 445 & 763 & 893 & 607 & 162 \\
Tb & 162 & 547 & 73 & 216 & 420 & 242 & 451 & 196 & 987 & 649 & 184 & 256 & 218 & 86 & 962 & 203 & 37 & 494 & 286 & 663 & 612 & 549 & 537 & 594 \\
Dy & 265 & 21 & 889 & 312 & 756 & 94 & 976 & 188 & 147 & 839 & 527 & 442 & 849 & 948 & 570 & 553 & 902 & 290 & 81 & 758 & 759 & 598 & 344 & 104 \\
Ho & 218 & 503 & 999 & 465 & 573 & 586 & 122 & 991 & 241 & 710 & 182 & 87 & 965 & 746 & 90 & 638 & 35 & 122 & 389 & 892 & 815 & 617 & 116 & 895 \\
Er & 571 & 932 & 738 & 653 & 986 & 430 & 992 & 432 & 823 & 542 & 444 & 702 & 524 & 58 & 248 & 914 & 697 & 420 & 913 & 754 & 596 & 429 & 995 & 927 \\
Tm & 551 & 72 & 654 & 819 & 593 & 7 & 110 & 707 & 535 & 74 & 142 & 150 & 610 & 564 & 859 & 451 & 832 & 822 & 938 & 877 & 954 & 430 & 41 & 657 \\
Yb & 815 & 643 & 650 & 217 & 962 & 612 & 926 & 524 & 559 & 500 & 822 & 630 & 901 & 525 & 407 & 563 & 575 & 161 & 505 & 166 & 207 & 680 & 418 & 478 \\
Lu & 106 & 597 & 551 & 650 & 391 & 850 & 589 & 649 & 6 & 277 & 129 & 566 & 109 & 922 & 767 & 173 & 525 & 250 & 449 & 662 & 221 & 831 & 969 & 479 \\
Hf & 100 & 833 & 566 & 331 & 36 & 589 & 33 & 785 & 862 & 447 & 469 & 284 & 329 & 116 & 608 & 256 & 665 & 41 & 74 & 527 & 479 & 300 & 800 & 51 \\
Ta & 337 & 757 & 903 & 411 & 745 & 638 & 243 & 584 & 336 & 477 & 994 & 307 & 349 & 981 & 572 & 364 & 822 & 609 & 198 & 478 & 922 & 854 & 819 & 130 \\
Th & 1000 & 520 & 222 & 998 & 774 & 88 & 843 & 259 & 424 & 845 & 884 & 739 & 666 & 673 & 531 & 934 & 322 & 682 & 754 & 944 & 153 & 779 & 20 & 890 \\
\end{tabular}
答案1
原始版本(以下版本)尝试在表格中减少语法更改,而该版本引入了更多的更改,但可以轻松更改分页符而无需进行任何编码,并且不需要每页具有相同数量的列。
代码里有使用注释。
\documentclass[twoside]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{caption}
\newcounter{tablepage}
\makeatletter
% #1 no of pages
% #2 caption
% #3 table
% table usesnormal tabular except
% Replace & by \thbreak after column(s) you want repeated.
% replace & by \tbreak at points you want page to break.
% must be a \tbreak before final \\
% any nested tabulars must be inside {} to hide the &
% \multicolumn is allowed but can not span a break.
% might want to replace \cleardoublepage by a cmmand to get onto left pf speread
% the tabular preamble needs as many columns (including heading columns) as the
% page with the most columns.
\long\def\widesplit#1#2#3{%
\def\row{\rowz\c@tablepage}%
\cleardoublepage
\setcounter{tablepage}{0}%
\loop
\refstepcounter{tablepage}%
\noindent\begin{minipage}{\columnwidth}\centering
\ifnum\c@tablepage=\@ne
\captionof{table}{#2}%
\else
\captionof*{table}{#2 (page \thetablepage\ of #1)}%
\fi
#3\end{minipage}%
\clearpage
\ifnum#1>\c@tablepage
\repeat}
\begin{document}
\def\rowa#1\thbreak#2\tbreak#3\\{#1\\}
\def\rowz#1{%
\ifnum#1=\@ne
\expandafter\rowa
\else
\expandafter\rowq\expandafter{\the\numexpr#1-1\expandafter\relax\expandafter}%
\fi}
\def\rowq#1#2\thbreak#3\tbreak{\rowz{#1}#2\thbreak}
\centering
\footnotesize
\widesplit{5}{some boring numbers}{%
\begin{tabular}{>\bfseries{l}rrrrr}
\row
Sample \thbreak Sample 1 & Sample 2 & Sample 3 & Sample 4 & Sample 5 \tbreak Sample 6 & Sample 7 & Sample 8 & Sample 9 & Sample 10 \tbreak Sample 11 & Sample 12 & Sample 13 & Sample 14 & Sample 15 \tbreak Sample 16 & Sample 17 & Sample 18 & Sample 19 & Sample 20 \tbreak Sample 21 & Sample 22 & Sample 23 & Sample 24 \tbreak\\[2ex]
\row
\rlap{Major element abundances (wt\%)} \thbreak & & & & \tbreak & & & & \tbreak & & & & \tbreak & & & & \tbreak & & & \tbreak\\
\row
SiO2 \thbreak 25 & 81 & 36 & 75 & 23 \tbreak 21 & 65 & 84 & 1 & 59 \tbreak 38 & 16 & 3 & 56 & 29 \tbreak 34 & 3 & 59 & 55 & 17 \tbreak 2 & 81 & 59 & 43 \tbreak\\
\row
TiO2 \thbreak 48 & 96 & 0 & 90 & 61 \tbreak 72 & 83 & 16 & 10 & 1 \tbreak 40 & 83 & 35 & 31 & 76 \tbreak 31 & 57 & 8 & 83 & 100 \tbreak 14 & 12 & 48 & 69 \tbreak\\
\row
Al2O3 \thbreak 7 & 14 & 99 & 53 & 89 \tbreak 65 & 88 & 17 & 76 & 81 \tbreak 43 & 87 & 15 & 71 & 17 \tbreak 85 & 59 & 100 & 96 & 85 \tbreak 74 & 50 & 59 & 36 \tbreak\\
\row
Fe2O3 \thbreak 32 & 34 & 23 & 86 & 50 \tbreak 58 & 8 & 29 & 88 & 27 \tbreak 49 & 16 & 19 & 89 & 45 \tbreak 88 & 79 & 42 & 42 & 29 \tbreak 10 & 60 & 87 & 97 \tbreak\\
\row
FeOt \thbreak 35 & 42 & 83 & 0 & 55 \tbreak 51 & 35 & 11 & 43 & 44 \tbreak 69 & 30 & 49 & 55 & 56 \tbreak 4 & 74 & 72 & 98 & 94 \tbreak 14 & 35 & 59 & 34 \tbreak\\
\row
MnO \thbreak 64 & 48 & 52 & 65 & 61 \tbreak 16 & 73 & 56 & 73 & 54 \tbreak 75 & 7 & 18 & 84 & 52 \tbreak 38 & 46 & 91 & 59 & 90 \tbreak 31 & 84 & 54 & 32 \tbreak\\
\row
MgO \thbreak 48 & 97 & 83 & 47 & 43 \tbreak 41 & 37 & 71 & 92 & 57 \tbreak 76 & 36 & 8 & 37 & 94 \tbreak 6 & 50 & 57 & 80 & 63 \tbreak 25 & 18 & 85 & 16 \tbreak\\
\row
CaO \thbreak 56 & 11 & 68 & 49 & 6 \tbreak 20 & 31 & 74 & 72 & 24 \tbreak 39 & 38 & 68 & 69 & 73 \tbreak 23 & 40 & 32 & 63 & 93 \tbreak 28 & 56 & 12 & 18 \tbreak\\
\row
Na2O \thbreak 73 & 18 & 0 & 62 & 98 \tbreak 61 & 59 & 42 & 97 & 47 \tbreak 74 & 31 & 40 & 3 & 75 \tbreak 2 & 52 & 96 & 67 & 44 \tbreak 84 & 9 & 35 & 51 \tbreak\\
\row
K2O \thbreak 69 & 0 & 52 & 73 & 23 \tbreak 11 & 12 & 70 & 86 & 46 \tbreak 29 & 84 & 77 & 47 & 25 \tbreak 43 & 97 & 48 & 30 & 94 \tbreak 83 & 93 & 23 & 25 \tbreak\\
\row
P2O5 \thbreak 92 & 80 & 59 & 6 & 90 \tbreak 99 & 54 & 64 & 96 & 84 \tbreak 58 & 18 & 37 & 7 & 55 \tbreak 89 & 34 & 53 & 59 & 56 \tbreak 38 & 23 & 63 & 89 \tbreak\\
\row
LOI§ \thbreak 51 & 65 & 64 & 2 & 67 \tbreak 51 & 58 & 55 & 60 & 48 \tbreak 64 & 54 & 56 & 46 & 78 \tbreak 70 & 38 & 44 & 45 & 37 \tbreak 66 & 7 & 34 & 76 \tbreak\\
\row
Mg\# \thbreak 20 & 27 & 34 & 40 & 66 \tbreak 3 & 7 & 42 & 19 & 85 \tbreak 35 & 24 & 31 & 40 & 14 \tbreak 39 & 31 & 100 & 0 & 41 \tbreak 19 & 14 & 75 & 5 \tbreak\\
\row
CIA \thbreak 24 & 57 & 1 & 80 & 86 \tbreak 72 & 38 & 11 & 51 & 23 \tbreak 49 & 94 & 43 & 65 & 15 \tbreak 5 & 41 & 21 & 32 & 83 \tbreak 22 & 16 & 63 & 51 \tbreak\\[2ex]
\row
\rlap{Trace element abundances (ppm)} \thbreak & & & & \tbreak & & & & \tbreak & & & & \tbreak & & & & \tbreak & & & \tbreak\\
\row
V \thbreak 91 & 421 & 256 & 480 & 669 \tbreak 888 & 403 & 456 & 661 & 77 \tbreak 997 & 729 & 647 & 77 & 69 \tbreak 163 & 52 & 589 & 772 & 267 \tbreak 110 & 998 & 547 & 789 \tbreak\\
\row
Cr \thbreak 635 & 712 & 208 & 938 & 754 \tbreak 600 & 91 & 531 & 211 & 798 \tbreak 880 & 240 & 197 & 671 & 298 \tbreak 921 & 538 & 577 & 49 & 195 \tbreak 596 & 744 & 719 & 910 \tbreak\\
\row
Co \thbreak 288 & 182 & 672 & 825 & 197 \tbreak 466 & 204 & 803 & 943 & 321 \tbreak 444 & 134 & 471 & 22 & 191 \tbreak 188 & 457 & 481 & 288 & 971 \tbreak 475 & 906 & 261 & 243 \tbreak\\
\row
Ni \thbreak 492 & 234 & 46 & 62 & 213 \tbreak 531 & 808 & 557 & 599 & 356 \tbreak 681 & 487 & 929 & 36 & 729 \tbreak 84 & 962 & 918 & 260 & 688 \tbreak 373 & 363 & 679 & 51 \tbreak\\
\row
Cu \thbreak 675 & 494 & 754 & 743 & 119 \tbreak 404 & 142 & 402 & 120 & 643 \tbreak 576 & 135 & 870 & 205 & 639 \tbreak 775 & 549 & 82 & 933 & 222 \tbreak 55 & 567 & 672 & 354 \tbreak\\
\row
Zn \thbreak 440 & 656 & 667 & 193 & 305 \tbreak 758 & 814 & 660 & 811 & 519 \tbreak 885 & 488 & 223 & 182 & 120 \tbreak 448 & 58 & 830 & 173 & 473 \tbreak 847 & 809 & 22 & 456 \tbreak\\
\row
Ga \thbreak 782 & 639 & 282 & 906 & 595 \tbreak 39 & 901 & 73 & 825 & 330 \tbreak 937 & 860 & 48 & 920 & 968 \tbreak 150 & 967 & 838 & 819 & 997 \tbreak 430 & 635 & 959 & 672 \tbreak\\
\row
Rb \thbreak 422 & 930 & 404 & 581 & 916 \tbreak 747 & 970 & 87 & 343 & 784 \tbreak 843 & 339 & 919 & 398 & 827 \tbreak 265 & 216 & 382 & 772 & 17 \tbreak 770 & 745 & 543 & 224 \tbreak\\
\row
Sr \thbreak 468 & 17 & 860 & 996 & 938 \tbreak 416 & 594 & 506 & 226 & 572 \tbreak 507 & 432 & 54 & 484 & 517 \tbreak 629 & 793 & 721 & 743 & 481 \tbreak 306 & 948 & 387 & 239 \tbreak\\
\row
Pb \thbreak 429 & 280 & 83 & 495 & 980 \tbreak 715 & 225 & 540 & 58 & 513 \tbreak 653 & 149 & 893 & 918 & 553 \tbreak 879 & 136 & 266 & 900 & 811 \tbreak 942 & 706 & 344 & 528 \tbreak\\
\row
U \thbreak 669 & 507 & 455 & 714 & 83 \tbreak 39 & 83 & 175 & 466 & 940 \tbreak 794 & 232 & 600 & 327 & 590 \tbreak 723 & 597 & 759 & 377 & 214 \tbreak 372 & 627 & 746 & 102 \tbreak\\
\row
Cs \thbreak 408 & 615 & 657 & 539 & 612 \tbreak 907 & 615 & 820 & 650 & 133 \tbreak 870 & 605 & 691 & 190 & 741 \tbreak 245 & 370 & 486 & 269 & 475 \tbreak 258 & 320 & 909 & 204 \tbreak\\
\row
Y \thbreak 291 & 830 & 767 & 872 & 522 \tbreak 639 & 159 & 548 & 236 & 718 \tbreak 701 & 762 & 965 & 323 & 770 \tbreak 688 & 22 & 11 & 930 & 329 \tbreak 657 & 778 & 432 & 581 \tbreak\\
\row
Zr \thbreak 902 & 131 & 233 & 211 & 399 \tbreak 315 & 730 & 852 & 76 & 973 \tbreak 350 & 887 & 201 & 895 & 691 \tbreak 885 & 223 & 830 & 690 & 477 \tbreak 424 & 756 & 659 & 166 \tbreak\\
\row
Nb \thbreak 594 & 969 & 833 & 663 & 243 \tbreak 154 & 197 & 104 & 317 & 834 \tbreak 901 & 891 & 997 & 934 & 328 \tbreak 261 & 982 & 581 & 781 & 933 \tbreak 625 & 783 & 711 & 354 \tbreak\\
\row
Ba \thbreak 790 & 957 & 606 & 730 & 754 \tbreak 928 & 646 & 0 & 389 & 71 \tbreak 616 & 434 & 107 & 126 & 692 \tbreak 118 & 983 & 24 & 281 & 808 \tbreak 743 & 381 & 139 & 856 \tbreak\\
\row
La \thbreak 624 & 859 & 233 & 176 & 540 \tbreak 138 & 188 & 475 & 478 & 203 \tbreak 614 & 53 & 435 & 694 & 66 \tbreak 860 & 628 & 271 & 338 & 799 \tbreak 924 & 877 & 777 & 721 \tbreak\\
\row
Ce \thbreak 826 & 471 & 327 & 809 & 496 \tbreak 180 & 378 & 155 & 61 & 345 \tbreak 736 & 341 & 201 & 634 & 393 \tbreak 932 & 498 & 334 & 29 & 319 \tbreak 254 & 79 & 691 & 52 \tbreak\\
\row
Pr \thbreak 476 & 447 & 951 & 786 & 450 \tbreak 717 & 248 & 790 & 561 & 259 \tbreak 748 & 104 & 881 & 804 & 385 \tbreak 676 & 435 & 815 & 634 & 234 \tbreak 809 & 105 & 471 & 529 \tbreak\\
\row
Nd \thbreak 758 & 523 & 672 & 159 & 405 \tbreak 597 & 657 & 307 & 28 & 28 \tbreak 30 & 273 & 74 & 189 & 403 \tbreak 326 & 19 & 735 & 121 & 992 \tbreak 26 & 723 & 243 & 927 \tbreak\\
\row
Sm \thbreak 307 & 422 & 764 & 933 & 197 \tbreak 180 & 956 & 276 & 347 & 492 \tbreak 534 & 760 & 904 & 247 & 0 \tbreak 518 & 593 & 714 & 223 & 619 \tbreak 634 & 39 & 265 & 445 \tbreak\\
\row
Eu \thbreak 463 & 194 & 627 & 954 & 32 \tbreak 940 & 824 & 229 & 58 & 684 \tbreak 780 & 761 & 348 & 464 & 39 \tbreak 577 & 432 & 920 & 425 & 799 \tbreak 3 & 207 & 208 & 398 \tbreak\\
\row
Gd \thbreak 863 & 274 & 512 & 718 & 770 \tbreak 900 & 221 & 674 & 342 & 553 \tbreak 522 & 945 & 880 & 23 & 605 \tbreak 544 & 214 & 987 & 348 & 445 \tbreak 763 & 893 & 607 & 162 \tbreak\\
\row
Tb \thbreak 162 & 547 & 73 & 216 & 420 \tbreak 242 & 451 & 196 & 987 & 649 \tbreak 184 & 256 & 218 & 86 & 962 \tbreak 203 & 37 & 494 & 286 & 663 \tbreak 612 & 549 & 537 & 594 \tbreak\\
\row
Dy \thbreak 265 & 21 & 889 & 312 & 756 \tbreak 94 & 976 & 188 & 147 & 839 \tbreak 527 & 442 & 849 & 948 & 570 \tbreak 553 & 902 & 290 & 81 & 758 \tbreak 759 & 598 & 344 & 104 \tbreak\\
\row
Ho \thbreak 218 & 503 & 999 & 465 & 573 \tbreak 586 & 122 & 991 & 241 & 710 \tbreak 182 & 87 & 965 & 746 & 90 \tbreak 638 & 35 & 122 & 389 & 892 \tbreak 815 & 617 & 116 & 895 \tbreak\\
\row
Er \thbreak 571 & 932 & 738 & 653 & 986 \tbreak 430 & 992 & 432 & 823 & 542 \tbreak 444 & 702 & 524 & 58 & 248 \tbreak 914 & 697 & 420 & 913 & 754 \tbreak 596 & 429 & 995 & 927 \tbreak\\
\row
Tm \thbreak 551 & 72 & 654 & 819 & 593 \tbreak 7 & 110 & 707 & 535 & 74 \tbreak 142 & 150 & 610 & 564 & 859 \tbreak 451 & 832 & 822 & 938 & 877 \tbreak 954 & 430 & 41 & 657 \tbreak\\
\row
Yb \thbreak 815 & 643 & 650 & 217 & 962 \tbreak 612 & 926 & 524 & 559 & 500 \tbreak 822 & 630 & 901 & 525 & 407 \tbreak 563 & 575 & 161 & 505 & 166 \tbreak 207 & 680 & 418 & 478 \tbreak\\
\row
Lu \thbreak 106 & 597 & 551 & 650 & 391 \tbreak 850 & 589 & 649 & 6 & 277 \tbreak 129 & 566 & 109 & 922 & 767 \tbreak 173 & 525 & 250 & 449 & 662 \tbreak 221 & 831 & 969 & 479 \tbreak\\
\row
Hf \thbreak 100 & 833 & 566 & 331 & 36 \tbreak 589 & 33 & 785 & 862 & 447 \tbreak 469 & 284 & 329 & 116 & 608 \tbreak 256 & 665 & 41 & 74 & 527 \tbreak 479 & 300 & 800 & 51 \tbreak\\
\row
Ta \thbreak 337 & 757 & 903 & 411 & 745 \tbreak 638 & 243 & 584 & 336 & 477 \tbreak 994 & 307 & 349 & 981 & 572 \tbreak 364 & 822 & 609 & 198 & 478 \tbreak 922 & 854 & 819 & 130 \tbreak\\
\row
Th \thbreak 1000 & 520 & 222 & 998 & 774 \tbreak 88 & 843 & 259 & 424 & 845 \tbreak 884 & 739 & 666 & 673 & 531 \tbreak 934 & 322 & 682 & 754 & 944 \tbreak 153 & 779 & 20 & 890 \tbreak\\
\end{tabular}}
\end{document}
这是手动选择的中断,但您只需将其作为一个表输入,并且只提供一次标题列,因此比明确使用两个表格更容易。
\documentclass{article}
\usepackage{array}
\def\widesplit#1{%
\cleardoublepage
\def\row##1##2{##1}%
#1%
\clearpage
\def\row##1##2{##2}%
#1%
\clearpage
}
\begin{document}
\widesplit{%
\begin{tabular}{>{\bfseries}c|*{13}{c}}
head 1
\row{&a&b&c&d&e&f&g&h&i&j&k&l&m}{&n&o&p&q&r&s&t&u&v&w&x&y&z}\\
head 2
\row{&a&b&c&d&e&f&g&h&i&j&k&l&m}{&n&o&p&q&r&s&t&u&v&w&x&y&z}\\
head 3
\row{&A&B&C&D&E&F&G&H&I&J&K&L&M}{&N&O&P&Q&R&S&T&U&V&W&X&Y&Z}
\end{tabular}%
}
\end{document}
原始版本:
可以根据手头的表格定制此变体,因此在表格中添加已编辑的问题并根据评论的要求添加标题。
\documentclass[twoside]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{caption}
\long\def\widesplit#1#2{%
\cleardoublepage
\let\row\rowa
\noindent\begin{minipage}{\textwidth}\centering
\captionof{table}{#1}%
#2\end{minipage}%
\clearpage
\let\row\rowb
\noindent\begin{minipage}{\textwidth}\centering
\captionof*{table}{#1 (continued)}%
#2\end{minipage}%
\cleardoublepage
\let\row\rowc
\noindent\begin{minipage}{\textwidth}\centering
\captionof*{table}{#1 (continued)}%
#2\end{minipage}%
\clearpage
\let\row\rowd
\noindent\begin{minipage}{\textwidth}\centering
\captionof*{table}{#1 (continued)}%
#2\end{minipage}%
\clearpage
}
\begin{document}
\def\rowa#1\\{#1\\}
\def\rowb#1&{\rowa#1&}
\def\rowc#1&{\rowb#1&}
\def\rowd#1{\rowc#1&\\}
\centering
\footnotesize
\widesplit{some boring numbers}{%
\begin{tabular}{>{\bfseries}l*{12}r}
\row
Sample & Sample 1 & Sample 2 & Sample 3 & Sample 4 & Sample 5 & Sample 6 & Sample 7 & Sample 8 & Sample 9 & Sample 10 & Sample 11 & Sample 12 & Sample 13 & Sample 14 & Sample 15 & Sample 16 & Sample 17 & Sample 18 & Sample 19 & Sample 20 & Sample 21 & Sample 22 & Sample 23 & Sample 24 \\[2ex]
\row
Major element abundances (wt\%)\hspace{-3cm} & & & & & & & & & & & & & & & & & & & & & & & & \\
\row
SiO2 & 25 & 81 & 36 & 75 & 23 & 21 & 65 & 84 & 1 & 59 & 38 & 16 & 3 & 56 & 29 & 34 & 3 & 59 & 55 & 17 & 2 & 81 & 59 & 43 \\
\row
TiO2 & 48 & 96 & 0 & 90 & 61 & 72 & 83 & 16 & 10 & 1 & 40 & 83 & 35 & 31 & 76 & 31 & 57 & 8 & 83 & 100 & 14 & 12 & 48 & 69 \\
\row
Al2O3 & 7 & 14 & 99 & 53 & 89 & 65 & 88 & 17 & 76 & 81 & 43 & 87 & 15 & 71 & 17 & 85 & 59 & 100 & 96 & 85 & 74 & 50 & 59 & 36 \\
\row
Fe2O3 & 32 & 34 & 23 & 86 & 50 & 58 & 8 & 29 & 88 & 27 & 49 & 16 & 19 & 89 & 45 & 88 & 79 & 42 & 42 & 29 & 10 & 60 & 87 & 97 \\
\row
FeOt & 35 & 42 & 83 & 0 & 55 & 51 & 35 & 11 & 43 & 44 & 69 & 30 & 49 & 55 & 56 & 4 & 74 & 72 & 98 & 94 & 14 & 35 & 59 & 34 \\
\row
MnO & 64 & 48 & 52 & 65 & 61 & 16 & 73 & 56 & 73 & 54 & 75 & 7 & 18 & 84 & 52 & 38 & 46 & 91 & 59 & 90 & 31 & 84 & 54 & 32 \\
\row
MgO & 48 & 97 & 83 & 47 & 43 & 41 & 37 & 71 & 92 & 57 & 76 & 36 & 8 & 37 & 94 & 6 & 50 & 57 & 80 & 63 & 25 & 18 & 85 & 16 \\
\row
CaO & 56 & 11 & 68 & 49 & 6 & 20 & 31 & 74 & 72 & 24 & 39 & 38 & 68 & 69 & 73 & 23 & 40 & 32 & 63 & 93 & 28 & 56 & 12 & 18 \\
\row
Na2O & 73 & 18 & 0 & 62 & 98 & 61 & 59 & 42 & 97 & 47 & 74 & 31 & 40 & 3 & 75 & 2 & 52 & 96 & 67 & 44 & 84 & 9 & 35 & 51 \\
% shortened as tex.sx system complained answer too long
\row
Th & 1000 & 520 & 222 & 998 & 774 & 88 & 843 & 259 & 424 & 845 & 884 & 739 & 666 & 673 & 531 & 934 & 322 & 682 & 754 & 944 & 153 & 779 & 20 & 890 \\
\end{tabular}}
\end{document}
答案2
\widesplit
也适用于 longtable......
longtable
+ widesplit
:太棒了……超长的桌子,宽度和高度都很高
最近我制作了一个 6000 页的 pdf,运行完美(7 列 x 3000 行)
这是我的例子(简短)
\documentclass[]{article}
\usepackage{longtable}
\usepackage{array}
\textheight = 20cm
\textwidth = 18cm
\topmargin = -2cm
\oddsidemargin= -1cm
\parindent = 0mm
% Title Page
%\title{Prueba Reporte}
%\author{Hernan Neuman}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\addtolength{\headheight}{100pt} % espacio para la raya
\renewcommand{\headrulewidth}{0pt} % grosor 0.5pt
\def\widesplit#1{%
\def\row##1##2##3{##1}
#1
\clearpage
\def\row##1##2##3{##2}
#1
\clearpage
\def\row##1##2##3{##3}
#1
\clearpage
}
%%% ---------------- Cabecera ---------
\lhead{\setlength{\unitlength}{1mm}
\begin{picture}(0,0)
% Figura
\put(0,0){\includegraphics[width=1\textwidth]{imagenes/header.png}}
% Texto
\put(0,0){
\parbox[t]{90mm}{
\begin{flushright}
\begin{scriptsize}
\textsf{}
\end{scriptsize}
\end{flushright}
}
}
\end{picture}}
%%% ---------------- Pie de pagina ---------
\begin{document}
\begin{center}
\begin{longtable}{|p{3cm}|l|p{3cm}|c|p{3cm}|p{3cm}|l|p{3cm}|l|p{3cm}|l|}\hline
\multicolumn{5}{|l|}{ORDEN DE ADQUISICI'ON} \\
\hline
$Industrias Dayan$ & $0241-555-66-77$ & $Calle$ & $Numero Telefonico$ & $Ciudad$ \\
\hline
\end{longtable}
\end{center}
\begin{center}
\widesplit{%
\begin{longtable}{|*{8}{p{5.600000cm}|}}\hline
\row{$loc\_case$&$ state$&$ loc\_rack$}{$ taxes\_id$&$ track\_incoming$&$ track\_outgoing$}{$ track\_production$&$ price\_margin$} \endhead \hline
\row{loc\_case& state& loc\_rack :D }{ taxes\_id& track\_incoming& track\_outgoing :D }{ track\_production& price\_margin} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & In Development& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & End of Lifecycle& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\row{ False & False& False :D }{ False& False& False :D }{ False& 1.0} \\\hline
\end{longtable}
}
\end{center}
\end{document}
PD: 抱歉我的英文不好 xD