我尝试使用threepartablex
包添加表格注释,但没有成功,但上标数字的位置不对。我该如何修复?
\documentclass[a4paper]{article}
\usepackage{lineno,hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
bookmarksnumbered,
citecolor=blue,
urlcolor=blue,
bookmarksopen=true}
\usepackage[
top=2.5cm,
left=2.5cm,
bottom=2.5cm,
right=2.5cm
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{ltablex}
\usepackage{threeparttable}
\usepackage[referable]{threeparttablex}
\usepackage{booktabs}
\begin{document}
\begin{ThreePartTable}
\begin{TableNotes}
\item[1] \label{tn1} First table note
\item[2] \label{tn2} Second table note
\end{TableNotes}
\begin{tabularx}{10cm}{p{5cm}p{5cm}}
\toprule
Text\tnotex{tn1}&Text\tnotex{tn1}\\
Text\tnotex{tn1}\tnotex{tn2}&Text\tnotex{tn1,tn2}\\
\bottomrule
\insertTableNotes
\end{tabularx}
\end{ThreePartTable}
\end{document}
答案1
我猜你会得到以下结果:
\documentclass[a4paper]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amssymb}
\usepackage[referable]{threeparttablex}
\usepackage{booktabs, ltablex}
\keepXColumns
\usepackage{lineno,hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
bookmarksnumbered,
citecolor=blue,
urlcolor=blue,
bookmarksopen=true}
\begin{document}
\begin{ThreePartTable}
\begin{TableNotes}[para,raggedright]
\item[1] \label{tn1} First table note
\item[2] \label{tn2} Second table note
\end{TableNotes}
\begin{tabularx}{10cm}{XX}
\toprule
Text\tnotex{tn1} & Text\tnotex{tn1}\\
Text\tnotex{tn1} \tnote{,} \tnotex{tn2} & Text\tnotex{tn2}\\
\bottomrule
\insertTableNotes
\end{tabularx}
\end{ThreePartTable}
\end{document}
笔记:
heperref
软件包应该在前言的末尾加载(极少数例外)tnotex{...}
将所有{...}
作为一个标签考虑- 对于一个单元格中的两个注释,
tnotex{...}
必须用空格分隔 - 对于两个注释之间的逗号,可能存在更好的解决方案,就像我上面使用的那样姆韦