**1. 自定义两行之间距离 **
\vspace{3ex}
3ex 表示有3个x高 可以改为4ex等
2. scientific report 中等式不居中
因为模板中class样式中有fleqn
去掉class中的fleqn就可以了 即 \documentclass[fleqn,10pt]{wlscirep} 变成
\documentclass[10pt]{wlscirep}
补充: 如果全文要大量使用左对齐方式,可以采用在documentclass或者amsmath包前面加上参数fleqn,这样全局的默认对齐方式就是左对齐了。
\documentclass[fleqn]{article}或\usepackage[fleqn]{amsmath}
table
1、整个缩放
\resizebox{h-size}{v-size}{ \begin{tabular}
…
\end{tabular} }
\scalebox[0.7]{
}
2、调整高度
\renewcommand\arraystretch{2}%%%关键之处就是这一行,在table之前加这一行,表示伸缩为2倍,可以改1.5,就是1.5倍。
\begin{table}[h] \centering
\begin{tabular}{|p{1cm}|p{2cm}|} %% 这里的p{2cm}是设置每个格子宽度为2cm, 正常是{|c|c|}
这里则是把c直接换成p{}设置宽度了。
\end{tabular}
\caption{my table}
\end{table}
3、调整宽度
过宽:
\resizebox{\textwidth}{12mm}{ 可随机设置,调整到适合自己的大小为止}
过窄:
\setlength{\tabcolsep}{7mm}{%7可随机设置,调整到适合自己的大小为止}
列宽调整
若要调整每列的宽度到指定数值,可以将代码中的\begin{tabular}{c|ccc}
改为\begin{tabular}{p{xxx}|ccc}
其中花括号里面填写宽度数值,如5pt,10mm等。
一些参考链接
https://blog.csdn.net/ProgramChangesWorld/article/details/51867351
https://blog.csdn.net/Rained_99/article/details/79389189
https://blog.csdn.net/wbl90/article/details/52597429
latex 中table如果想合并:
https://blog.csdn.net/sinat_36301420/article/details/79334767
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{1} & 11 & 111 & 1111 & 11111 \\ %%这是关键 第一个2 表示我要跨2行,*不管,1 表示内容
\cline{2-5} %%%%这个地方是说画横线,因为不是有的地方行合并了,然后他的这一行就不画横线了,从2-5列画,如果只有第二列下面需要画画,那么写\cline{2-2}
& 22 & 222 & 2222 & 22222 \\
\hline
\end{tabular}
下面是table表头添加颜色
- 首先要加包
\usepackage{colortbl} \usepackage{color}
然后
\renewcommand\arraystretch{1.4} \begin{table}[ht] \centering \setlength{\tabcolsep}{10mm} \begin{tabular}{|c|p{2cm}|c|} \hline \rowcolor{gray!30} %%这个是表示下面这一行是灰色 !30 是透明度 Initial State & $\widetilde{K_{2}} \oplus$ TS & Final State \\ \hline \cellcolor{white}1 & 2 & 3 %其中1的背景颜色会变成白色
\cellcolor{}% 一个单元格的颜色,放在使用的单元格前面就可以
\columncolor{} %一列颜色