1
假设我加载以下包:
\documentclass{article}
\usepackage{calc}
\setlength\textwidth{6.5in}
\setlength\textheight{10in}\setlength\oddsidemargin{(\paperwidth-\textwidth)/2 - 1in}
\setlength\topmargin{(\paperheight-\textheight-\headheight-\headsep-\footskip)/2 - 1in}
\usepackage{amsmath, amssymb, array}
\usepackage{tabu, colortbl}
\usepackage[table]{xcolor}
\usepackage[cache=false]{minted}
\usepackage{xpatch}
\xpatchcmd{\minted}{\VerbatimEnvironment}{\VerbatimEnvironment\let\itshape\relax}{}{}
\usemintedstyle{bw}
2
如何缩小我的表格而不产生错误?
\scalebox{0.5}{
\begin{table}[ht]
\centering
\footnotesize
\renewcommand{\ttdefault}{qcr}
\begin{tabular}{rrlllrlllrllllrlrllrrrrrrrlrllllrrrrlr}
% border
& STATE\_\_ & BGN\_DATE & BGN\_TIME & TIME\_ZONE & COUNTY & COUNTYNAME & STATE & EVTYPE & BGN\_RANGE & BGN\_AZI & BGN\_LOCATI & END\_DATE & END\_TIME & COUNTY\_END & COUNTYENDN & END\_RANGE & END\_AZI & END\_LOCATI & LENGTH & WIDTH & F & MAG & FATALITIES & INJURIES & PROPDMG & PROPDMGEXP & CROPDMG & CROPDMGEXP & WFO & STATEOFFIC & ZONENAMES & LATITUDE & LONGITUDE & LATITUDE\_E & LONGITUDE\_ & REMARKS & REFNUM \\
\hline
1 & 1.00 & 4/18/1950 0:00:00 & 0130 & CST & 97.00 & MOBILE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 14.00 & 100.00 & 3.00 & 0.00 & 0.00 & 15.00 & 25.00 & K & 0.00 & & & & & 3040.00 & 8812.00 & 3051.00 & 8806.00 & & 1.00 \\
2 & 1.00 & 4/18/1950 0:00:00 & 0145 & CST & 3.00 & BALDWIN & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 2.00 & 150.00 & 2.00 & 0.00 & 0.00 & 0.00 & 2.50 & K & 0.00 & & & & & 3042.00 & 8755.00 & 0.00 & 0.00 & & 2.00 \\
3 & 1.00 & 2/20/1951 0:00:00 & 1600 & CST & 57.00 & FAYETTE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.10 & 123.00 & 2.00 & 0.00 & 0.00 & 2.00 & 25.00 & K & 0.00 & & & & & 3340.00 & 8742.00 & 0.00 & 0.00 & & 3.00 \\
4 & 1.00 & 6/8/1951 0:00:00 & 0900 & CST & 89.00 & MADISON & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.00 & 100.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 & & & & & 3458.00 & 8626.00 & 0.00 & 0.00 & & 4.00 \\
5 & 1.00 & 11/15/1951 0:00:00 & 1500 & CST & 43.00 & CULLMAN & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.00 & 150.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 & & & & & 3412.00 & 8642.00 & 0.00 & 0.00 & & 5.00 \\
6 & 1.00 & 11/15/1951 0:00:00 & 2000 & CST & 77.00 & LAUDERDALE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 1.50 & 177.00 & 2.00 & 0.00 & 0.00 & 6.00 & 2.50 & K & 0.00 & & & & & 3450.00 & 8748.00 & 0.00 & 0.00 & & 6.00 \\
% border
\end{tabular}
\end{table} }
完整代码:
\documentclass{article}
\usepackage{calc}
\setlength\textwidth{6.5in}
\setlength\textheight{10in}\setlength\oddsidemargin{(\paperwidth-\textwidth)/2 - 1in}
\setlength\topmargin{(\paperheight-\textheight-\headheight-\headsep-\footskip)/2 - 1in}
\usepackage{amsmath, amssymb, array}
\usepackage{tabu, colortbl}
\usepackage[table]{xcolor}
\usepackage[cache=false]{minted}
\usepackage{xpatch}
\xpatchcmd{\minted}{\VerbatimEnvironment}{\VerbatimEnvironment\let\itshape\relax}{}{}
\usemintedstyle{bw}
\scalebox{0.5}{
\begin{table}[ht]
\centering
\footnotesize
\renewcommand{\ttdefault}{qcr}
\begin{tabular}{rrlllrlllrllllrlrllrrrrrrrlrllllrrrrlr}
% border
& STATE\_\_ & BGN\_DATE & BGN\_TIME & TIME\_ZONE & COUNTY & COUNTYNAME & STATE & EVTYPE & BGN\_RANGE & BGN\_AZI & BGN\_LOCATI & END\_DATE & END\_TIME & COUNTY\_END & COUNTYENDN & END\_RANGE & END\_AZI & END\_LOCATI & LENGTH & WIDTH & F & MAG & FATALITIES & INJURIES & PROPDMG & PROPDMGEXP & CROPDMG & CROPDMGEXP & WFO & STATEOFFIC & ZONENAMES & LATITUDE & LONGITUDE & LATITUDE\_E & LONGITUDE\_ & REMARKS & REFNUM \\
\hline
1 & 1.00 & 4/18/1950 0:00:00 & 0130 & CST & 97.00 & MOBILE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 14.00 & 100.00 & 3.00 & 0.00 & 0.00 & 15.00 & 25.00 & K & 0.00 & & & & & 3040.00 & 8812.00 & 3051.00 & 8806.00 & & 1.00 \\
2 & 1.00 & 4/18/1950 0:00:00 & 0145 & CST & 3.00 & BALDWIN & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 2.00 & 150.00 & 2.00 & 0.00 & 0.00 & 0.00 & 2.50 & K & 0.00 & & & & & 3042.00 & 8755.00 & 0.00 & 0.00 & & 2.00 \\
3 & 1.00 & 2/20/1951 0:00:00 & 1600 & CST & 57.00 & FAYETTE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.10 & 123.00 & 2.00 & 0.00 & 0.00 & 2.00 & 25.00 & K & 0.00 & & & & & 3340.00 & 8742.00 & 0.00 & 0.00 & & 3.00 \\
4 & 1.00 & 6/8/1951 0:00:00 & 0900 & CST & 89.00 & MADISON & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.00 & 100.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 & & & & & 3458.00 & 8626.00 & 0.00 & 0.00 & & 4.00 \\
5 & 1.00 & 11/15/1951 0:00:00 & 1500 & CST & 43.00 & CULLMAN & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.00 & 150.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 & & & & & 3412.00 & 8642.00 & 0.00 & 0.00 & & 5.00 \\
6 & 1.00 & 11/15/1951 0:00:00 & 2000 & CST & 77.00 & LAUDERDALE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 1.50 & 177.00 & 2.00 & 0.00 & 0.00 & 6.00 & 2.50 & K & 0.00 & & & & & 3450.00 & 8748.00 & 0.00 & 0.00 & & 6.00 \\
% border
\end{tabular}
\end{table} }
答案1
我删除了一些列并用省略号替换:
\documentclass{article}
\usepackage{calc}
\setlength\textwidth{6.5in}
\setlength\textheight{10in}\setlength\oddsidemargin{(\paperwidth-\textwidth)/2 - 1in}
\setlength\topmargin{(\paperheight-\textheight-\headheight-\headsep-\footskip)/2 - 1in}
\usepackage{amsmath, amssymb, array}
\usepackage{tabu, colortbl}
\usepackage[table]{xcolor}
\usemintedstyle{bw}
\begin{table}[ht]
\centering
\footnotesize
\renewcommand{\ttdefault}{qcr}
\ttfamily
\rowcolors{2}{gray!20}{gray!5}
\begin{tabular}{rrlllrlllrllllrlrllrrrrrrrlrllllrrrrlr}
% border
& STATE\_\_ & BGN\_DATE & BGN\_TIME & TIME\_ZONE & COUNTY & COUNTYNAME & STATE & ... & REFNUM \\
\hline
1 & 1.00 & 4/18/1950 0:00:00 & 0130 & CST & 97.00 & MOBILE & AL & ... & 1.00 \\
2 & 1.00 & 4/18/1950 0:00:00 & 0145 & CST & 3.00 & BALDWIN & AL & ... & 2.00 \\
3 & 1.00 & 2/20/1951 0:00:00 & 1600 & CST & 57.00 & FAYETTE & AL & ... & 3.00 \\
4 & 1.00 & 6/8/1951 0:00:00 & 0900 & CST & 89.00 & MADISON & AL & ... & 4.00 \\
5 & 1.00 & 11/15/1951 0:00:00 & 1500 & CST & 43.00 & CULLMAN & AL & ... & 5.00 \\
6 & 1.00 & 11/15/1951 0:00:00 & 2000 & CST & 77.00 & LAUDERDALE & AL & ... & 6.00 \\
% border
\end{tabular}
\end{table}
答案2
将如此多的数据放入一个表中会很困难,您可以使其适合,但想想任何试图阅读这篇文章的人,特别是在无法放大的纸上。
避免缩放表格,如果确实必须,我会旋转表格并使用较小的字体大小:
\documentclass{article}
\usepackage{calc}
\setlength\textwidth{6.5in}
\setlength\textheight{10in}\setlength\oddsidemargin{(\paperwidth-\textwidth)/2 - 1in}
\setlength\topmargin{(\paperheight-\textheight-\headheight-\headsep-\footskip)/2 - 1in}
\usepackage{amsmath, amssymb, array,graphicx}
\newcommand\hd[1]{\rotatebox{90}{\bfseries #1 }}
\begin{document}
\begin{table}[ht]
\centering
\tiny
\setlength\tabcolsep{2pt}
\renewcommand{\ttdefault}{qcr}
\rotatebox{90}{\begin{tabular}{rrlllrlllrllllrlrllrrrrrrrlrllllrrrrlr}
% border
& \hd{STATE\_\_} & \hd{BGN\_DATE} & \hd{BGN\_TIME} & \hd{TIME\_ZONE} & \hd{COUNTY} & \hd{COUNTYNAME} &
\hd{STATE} & \hd{EVTYPE} & \hd{BGN\_RANGE} & \hd{BGN\_AZI} & \hd{BGN\_LOCATI} & \hd{END\_DATE} & \hd{END\_TIME} &
\hd{COUNTY\_END} & \hd{COUNTYENDN} & \hd{END\_RANGE} & \hd{END\_AZI} & \hd{END\_LOCATI} & \hd{LENGTH} & \hd{WIDTH} &
\hd{F} & \hd{MAG} & \hd{FATALITIES} & \hd{INJURIES} & \hd{PROPDMG} & \hd{PROPDMGEXP} & \hd{CROPDMG} & \hd{CROPDMGEXP} &
\hd{WFO} & \hd{STATEOFFIC} & \hd{ZONENAMES} & \hd{LATITUDE} & \hd{LONGITUDE} & \hd{LATITUDE\_E} & \hd{LONGITUDE\_} &
\hd{REMARKS} & \hd{REFNUM} \\
\hline
1 & 1.00 & 4/18/1950 0:00:00 & 0130 & CST & 97.00 & MOBILE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 14.00 & 100.00 & 3.00 & 0.00 & 0.00 & 15.00 & 25.00 & K & 0.00 & & & & & 3040.00 & 8812.00 & 3051.00 & 8806.00 & & 1.00 \\
2 & 1.00 & 4/18/1950 0:00:00 & 0145 & CST & 3.00 & BALDWIN & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 2.00 & 150.00 & 2.00 & 0.00 & 0.00 & 0.00 & 2.50 & K & 0.00 & & & & & 3042.00 & 8755.00 & 0.00 & 0.00 & & 2.00 \\
3 & 1.00 & 2/20/1951 0:00:00 & 1600 & CST & 57.00 & FAYETTE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.10 & 123.00 & 2.00 & 0.00 & 0.00 & 2.00 & 25.00 & K & 0.00 & & & & & 3340.00 & 8742.00 & 0.00 & 0.00 & & 3.00 \\
4 & 1.00 & 6/8/1951 0:00:00 & 0900 & CST & 89.00 & MADISON & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.00 & 100.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 & & & & & 3458.00 & 8626.00 & 0.00 & 0.00 & & 4.00 \\
5 & 1.00 & 11/15/1951 0:00:00 & 1500 & CST & 43.00 & CULLMAN & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 0.00 & 150.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 & & & & & 3412.00 & 8642.00 & 0.00 & 0.00 & & 5.00 \\
6 & 1.00 & 11/15/1951 0:00:00 & 2000 & CST & 77.00 & LAUDERDALE & AL & TORNADO & 0.00 & & & & & 0.00 & & 0.00 & & & 1.50 & 177.00 & 2.00 & 0.00 & 0.00 & 6.00 & 2.50 & K & 0.00 & & & & & 3450.00 & 8748.00 & 0.00 & 0.00 & & 6.00 \\
% border
\end{tabular}}
\end{table}
\end{document}