![如何使用 threepartablex 将多个表格注释放在一个单元格中](https://linux22.com/image/360937/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20threepartablex%20%E5%B0%86%E5%A4%9A%E4%B8%AA%E8%A1%A8%E6%A0%BC%E6%B3%A8%E9%87%8A%E6%94%BE%E5%9C%A8%E4%B8%80%E4%B8%AA%E5%8D%95%E5%85%83%E6%A0%BC%E4%B8%AD.png)
我尝试使用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{...}
必须用空格分隔 - 对于两个注释之间的逗号,可能存在更好的解决方案,就像我上面使用的那样姆韦