latex近日问题集锦

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}

在这里[]中的数字是需要自己根据实际情况去调整的,这种方法可以实现视觉上的相对居中

参考:

  1. https://tex.stackexchange.com/questions/171648/how-to-merge-two-tabulars-into-a-single-table-the-width-of-the-column
  2. https://tex.stackexchange.com/questions/505986/merging-two-tables-together-one-on-top-of-the-other
  3. https://tex.stackexchange.com/questions/193317/underlined-journal-names-in-bibliographystyle-of-apacite-with-natbibapa-option
  4. https://tex.stackexchange.com/questions/211898/putting-several-footnotes-below-the-table
  5. https://tex.stackexchange.com/questions/156219/proper-centering-with-cmidrule-and-multi-row-and-column
  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值