\begin{table}
\centering
\begin{center}
\begin{tabular}{p{1.25in}ddd}
\toprule
\multicolumn{1}{C{0.2in}}{Degree} & \multicolumn{1}{C{1.5in}}{$H^*(K(\Z_2,n+1);\Z_2)$} & \multicolumn{1}{C{1.5in}}{$H^*(K(\Z,n);\Z_2)$}\\
\midrule
n & & \iota_n \\
n+1 & \iota_{n+1} \tikzmark{a1} & \\
n+2 & \Sq^1\iota_{n+1} \tikzmark{a2} & \tikzmark{b1} \Sq^2\iota_n \\
&&\\
n+3 & \Sq^2\iota_{n+1} & \tikzmark{b2} \Sq^3\iota_n \\
& \Sq^2\Sq^1\iota_{n+1} & \\
&&\\
n+4 & \Sq^3\iota_{n+1} & \Sq^4\iota_n \\
& \Sq^2\Sq^1\iota_{n+1} \tikzmark{a3} & \\
&&\\
n+5 & \Sq^4\iota_{n+1} \tikzmark{a4} & \tikzmark{b3} \Sq^5\iota_n \\
& \Sq^3\Sq^1\iota_{n+1} & \\
&&\\
n+6 & \Sq^5\iota_{n+1} \tikzmark{a5} & \Sq^6\iota_{n+1} \\
& \Sq^4\Sq^1\iota_{n+1} \tikzmark{a6} & \tikzmark{b4} \Sq^4\Sq^2\iota_n \\
&&\\
n+7 & \Sq^6\iota_{n+1} \tikzmark{a7} & \Sq^7\iota_n \\
& \Sq^5\Sq^1\iota_{n+1} & \tikzmark{b5} \Sq^5\Sq^2\iota_n \\
& \Sq4\Sq^2\iota_{n+1} & \\
&&\\
n+8 & \Sq^7\iota_{n+1} \tikzmark{a8} & \Sq^8\iota_n \\
& \Sq^6\Sq^1\iota_{n+1} \tikzmark{a9} & \tikzmark{b6} \Sq^6\Sq^2\iota_n \\
& \Sq^5\Sq^2\iota_{n+1} & \\
& \Sq^4\Sq^2\Sq^1\iota_{n+1} \tikzmark{a10} & \\
&&\\
n+9 & \Sq^8\iota_{n+1} \tikzmark{a11} & \tikzmark{b7} \Sq^9\iota_n \\
& \Sq^7\Sq^1\iota_{n+1} \tikzmark{a12} & \tikzmark{b8} \Sq^7\Sq^2\iota_n \\
& \Sq^6\Sq^2\iota_{n+1} & \tikzmark{b9} \Sq^6\Sq^3\iota_n \\
& \Sq^5\Sq^2\Sq^1\iota_{n+1} & \\
&&\\
n+10 & \Sq^{9}\iota_{n+1} & \Sq^{10}\iota_n \\
& \Sq^8\Sq^1\iota_{n+1} & \tikzmark{b10} \Sq^8\Sq^2\iota_n \\
& \Sq^7\Sq^2\iota_{n+1} & \tikzmark{b11} \Sq^7\Sq^3\iota_n \\
& \Sq^6\Sq^3\iota_{n+1} & \\
& \Sq^6\Sq^2\Sq^1\iota_{n+1} & \\
\bottomrule
\end{tabular}
\begin{tikzpicture}[overlay, remember picture, yshift=.1\baselineskip, xshift=.1, shorten >=5pt, shorten <=0pt]
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a1}) -- ({pic cs:b1});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a2}) -- ({pic cs:b2});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a3}) -- ({pic cs:b3});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a4}) -- ({pic cs:b4});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a5}) -- ({pic cs:b5});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a6}) -- ({pic cs:b5});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a7}) -- ({pic cs:b6});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a8}) -- ({pic cs:b7});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a9}) -- ({pic cs:b8});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a10}) -- ({pic cs:b9});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a11}) -- ({pic cs:b10});
\draw [->] ([yshift=0pt, xshift=5pt]{pic cs:a12}) -- ({pic cs:b11});
\end{tikzpicture}
\end{center}
\label{default}
\end{table}
我有两个问题:
- 我如何使右两列的元素左对齐而不是右对齐?
- 表格太大,页面放不下 - 您可以在表格底部看到页码 29。我该如何调整大小或缩放以适合页面?
答案1
像这样:
您的代码片段没有前言,没有\newcommands
使用...不是很有帮助,所以以下 MWE 基于猜测,您实际上如何生成提供的图片:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,tikzmark}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\newcommand\Sq{\mathrm{Sq}}
\usepackage{showframe}
\begin{document}
\begin{table}
\centering
\begin{tabularx}{\textwidth}{l>{\setlength\hsize{0.4\hsize}$}R<{$}
>{\setlength\hsize{0.2\hsize}}X
>{\setlength\hsize{0.4\hsize}$}R<{$}
}
\toprule
\multicolumn{1}{c}{Degree}
& \multicolumn{2}{c}{$H^*(K(Z_2,n+1);Z_2)$}
& H^*(K(Z,n);Z_2) \\
\midrule
n & \iota_n && \\
n+1 & \iota_{n+1} \tikzmark{a1} && \\
n+2 & \Sq^1\iota_{n+1} \tikzmark{a2} && \tikzmark{b1} \Sq^2\iota_n \\
\addlinespace[1em]
n+3 & \Sq^2\iota_{n+1} && \tikzmark{b2} \Sq^3\iota_n \\
& \Sq^2\Sq^1\iota_{n+1} && \\
\addlinespace[1em]
n+4 & \Sq^3\iota_{n+1} && \Sq^4\iota_n \\
& \Sq^2\Sq^1\iota_{n+1} \tikzmark{a3} && \\
\addlinespace[1em]
n+5 & \Sq^4\iota_{n+1} \tikzmark{a4} && \tikzmark{b3} \Sq^5\iota_n \\
& \Sq^3\Sq^1\iota_{n+1} && \\
\addlinespace[1em]
n+6 & \Sq^5\iota_{n+1} \tikzmark{a5} && \Sq^6\iota_{n+1} \\
& \Sq^4\Sq^1\iota_{n+1} \tikzmark{a6} && \tikzmark{b4} \Sq^4\Sq^2\iota_n \\
\addlinespace[1em]
n+7 & \Sq^6\iota_{n+1} \tikzmark{a7} && \Sq^7\iota_n \\
& \Sq^5\Sq^1\iota_{n+1} && \tikzmark{b5} \Sq^5\Sq^2\iota_n \\
& \Sq4\Sq^2\iota_{n+1} && \\
\addlinespace[1em]
n+8 & \Sq^7\iota_{n+1} \tikzmark{a8} && \Sq^8\iota_n \\
& \Sq^6\Sq^1\iota_{n+1} \tikzmark{a9} && \tikzmark{b6} \Sq^6\Sq^2\iota_n \\
& \Sq^5\Sq^2\iota_{n+1} && \\
& \Sq^4\Sq^2\Sq^1\iota_{n+1} \tikzmark{a10} && \\
\addlinespace[1em]
n+9 & \Sq^8\iota_{n+1} \tikzmark{a11} && \tikzmark{b7} \Sq^9\iota_n \\
& \Sq^7\Sq^1\iota_{n+1} \tikzmark{a12} && \tikzmark{b8} \Sq^7\Sq^2\iota_n \\
& \Sq^6\Sq^2\iota_{n+1} && \tikzmark{b9} \Sq^6\Sq^3\iota_n \\
& \Sq^5\Sq^2\Sq^1\iota_{n+1} && \\
\addlinespace[1em]
n+10 & \Sq^{9}\iota_{n+1} && \Sq^{10}\iota_n \\
& \Sq^8\Sq^1\iota_{n+1} && \tikzmark{b10} \Sq^8\Sq^2\iota_n \\
& \Sq^7\Sq^2\iota_{n+1} && \tikzmark{b11} \Sq^7\Sq^3\iota_n \\
& \Sq^6\Sq^3\iota_{n+1} && \\
& \Sq^6\Sq^2\Sq^1\iota_{n+1} && \\
\bottomrule
\end{tabularx}
\begin{tikzpicture}[overlay, remember picture,
shorten >=5pt, shorten <=5pt]
\foreach \i [count=\j from 0] in {1,...,12}
{
\ifnum\i<6
\draw [->] (pic cs:a\i) -- (pic cs:b\i);
\else
\draw [->] (pic cs:a\i) -- (pic cs:b\j);
\fi
}
\end{tikzpicture}
\label{default}
\end{table}
\end{document}
编辑(1): 我还改进了 TikZ 代码。现在更加一致和简洁。
编辑(2): 重新检查表格代码后重新设计表格。通过添加空的虚拟列,可以获得更好的居中列头。