1. 去掉因ulem包产生的下划线(reference中的publication title)
Question:
一开始用ulem这个包是为了在字体下面插入波浪线(wavy curves),但是直接用
\usepackage{ulem}
的时候发现reference中突然出现了很多横线,并且这些横线只出现在pulication title下方。
Solution:
\usepackage[normalem]{ulem}
换成👆的语法即可去掉这些下划线
2. 在表格下方加入注释
Solution:
需要用到\usepackage{threeparttable}这个包,然后在\end{table}之前加入
#在\begin{tabular}之前加入
\begin{threeparttable}
\begin{tabular}
。。。。。。
\end{tabular}
\begin{tablenotes}
\item \footnotesize {Say blah blah blah}
\end{tablenotes}
\end{threeparttable}
可以根据需要在\item后面加上[*]或者[1]
3. 如何把两个表格拼在一起
Question:
如果出于某种原因需要把两个内容不完全一致的表格拼接在一起,要怎么实现呢?(这里主要是两个表格的列内容不完全一致,所以没有办法共用一个表头。)
Solution:
%开头加上这个包
\usepackage{tabularx}
-------------------------
\begin{table}
\renewcommand{\arraystretch}{1.05}%调节纵向距离(行间距)
\setlength{\tabcolsep}{5mm}{}%调节横向距离
\centering
\caption{My merged table}
\begin{tabularx}{1\linewidth}{cccc}
\toprule
parameter & value & parameter & value \\
\midrule
blah blah & a & blah blah & 2 \\
blah blah & 4 & blah blah & 17 \\
blah blah & 4 & blah blah & 4 \\
blah blah & 4 & blah blah & 128 \\
blah blah & 1 & blah blah & 6 \\
blah blah & 8 & blah blah & 48 \\
blah blah & 48 & blah blah & 32 \\
blah blah & 10 & blah blah & 16 \\
\end{tabularx}\vspace{1mm}
\setlength{\tabcolsep}{1.8mm}{}
\begin{tabularx}{1\linewidth}{cccccc}
\toprule
blah & bloo & bleeblee & bloo bloo & meeh & hoohaa \\
\midrule
xyz & 3ubfjdf & 14 & 64 & 4 & 444 \\
abc & fddf4 & 44 & 64 & 8 & 555 \\
mno & dsf4tv & 100 & 64 & 8 & 777 \\
\bottomrule
\end{tabularx}
\end{table}
结果如下:
4. 如何断开\cline使得不同组更加清晰
Question:
想实现类似下面的效果,只使用\cline的时候2015和2016下面的横线是连着的
Solution:
把\cline{2-5}\cline{6-9}换成
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
如果只用®或者(l)会出现横线向一侧倾斜的情况,加上(lr)会好很多
5. 如何解决\cmidrule带来的跨行文字不居中的问题
Question:
如图在使用\cmidrule时左边的跨行文字sample并没有垂直居中
Solution:
将原本的\multirow{2}{*}{Sample}替换成
\multirow{2}[3]{*}{Sample}
在这里[]中的数字是需要自己根据实际情况去调整的,这种方法可以实现视觉上的相对居中
参考:
- https://tex.stackexchange.com/questions/171648/how-to-merge-two-tabulars-into-a-single-table-the-width-of-the-column
- https://tex.stackexchange.com/questions/505986/merging-two-tables-together-one-on-top-of-the-other
- https://tex.stackexchange.com/questions/193317/underlined-journal-names-in-bibliographystyle-of-apacite-with-natbibapa-option
- https://tex.stackexchange.com/questions/211898/putting-several-footnotes-below-the-table
- https://tex.stackexchange.com/questions/156219/proper-centering-with-cmidrule-and-multi-row-and-column