![表格多行和 nameref](https://linux22.com/image/368202/%E8%A1%A8%E6%A0%BC%E5%A4%9A%E8%A1%8C%E5%92%8C%20nameref.png)
我有下表
基本上,我将\nameref{sec:USD}
其用作论文中我想链接到的子部分的参考。但是,我想知道是否可以使用多行包使其占据表格的多行,因为它不适合长标题。
\documentclass[11pt]{article}
\usepackage{nameref,hyperref,cleveref}
\usepackage{multirow}
\begin{document}
\begin{table}[!htb]
\caption{Summary of Models}
\label{table:table1}
\noindent
\begin{tabular*}{\textwidth}{l
@{\extracolsep{\fill}}*{6}{c}}
\toprule
\multirow{3}{*}{Model} & Number of & Number of & Number of &Average & Avg Adj. \\
& Factors & Sig. Factors & Sig. Factors& R-squared & R-squared & \\
& & Based on Avg & Based on Pct& & \\
\midrule
& 22 & 12 & 16 & 0.232 & 0.217 \\
% \nameref{sec:globalcurrmodel} &
% \nameref{sec:NestedRegModel} & 70 & 57 & 62 & 0.405 & 0.389 \\
\nameref{sec:xcurr_model} & 70 & 41 & 53 & 0.408 & 0.423 \\
\nameref{sec:NestedRegModel} & 69 & 61 & 62 & 0.562 & 0.545 \\
% \nameref{sec:NestedRegModelNoMkt} &
\nameref{sec:cross_sector} & 0 & 0 & 0 & 0 & 0 \\
\bottomrule
\end{tabular*}
\end{table}
\subsection{USD}
\label{sec:USD}
\subsection{EURO}
\label{sec:euro}
\subsection{JPY}
\label{sec:jpy}
\subsection{Global Sectors}
\label{sec:globalbase}
\subsection{Global Nested}
\label{sec:globalnestedreg}
\subsection{USD, JPY, EUR Cross-terms}
\label{sec:cross_sector}
\end{document}
非常感谢您的帮助。
答案1
对于这种用例,我将使用tabularx
类型X
列:
\documentclass[11pt]{article}
\usepackage{nameref,hyperref,cleveref}
\usepackage{multirow}
\usepackage{booktabs,tabularx}
\begin{document}
\begin{table}[!htb]
\caption{Summary of Models\label{table:table1}}
\small
\begin{tabularx}{\textwidth}{@{}X *{5}{c}@{}}
\toprule
\multirow{3}{*}{Model} & Number of & Number of & Number of &Average & Avg Adj. \\
& Factors & Sig. Factors & Sig. Factors& R-squared & R-squared \\
& & Based on Avg & Based on Pct& \\
\midrule
& 22 & 12 & 16 & 0.232 & 0.217 \\
% \nameref{sec:globalcurrmodel} &
% \nameref{sec:NestedRegModel} & 70 & 57 & 62 & 0.405 & 0.389 \\
\nameref{sec:xcurr_model} & 70 & 41 & 53 & 0.408 & 0.423 \\
\nameref{sec:NestedRegModel} & 69 & 61 & 62 & 0.562 & 0.545 \\
% \nameref{sec:NestedRegModelNoMkt} &
\nameref{sec:cross_sector} & 0 & 0 & 0 & 0 & 0 \\
\bottomrule
\end{tabularx}
\end{table}
\subsection{USD}
\label{sec:USD}
\subsection{EURO}
\label{sec:euro}
\subsection{JPY}
\label{sec:jpy}
\subsection{Global Sectors}
\label{sec:globalbase}
\subsection{Global Nested}
\label{sec:globalnestedreg}
\subsection{USD, JPY, EUR Cross-terms}
\label{sec:cross_sector}
\end{document}