生活随笔
收集整理的這篇文章主要介紹了
Latex画三线格
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
四、Latex畫三線格
首先導入\usepackage{booktabs}包,具體使用如下:
\begin
{table
*}[!t
]
% increase table row spacing
, adjust to taste
\renewcommand
{\arraystretch
}{1.3}
\caption
{An Example of three line Table
}
\label
{table_3
}
\centering
\begin
{tabular
}{llll
}
\toprule
%A
& N
=3 1 &N
=5 & N
=7 & N
=9 \\
%Loss function
& Steg
-img
PSNR(db
) & Deco
-img
PSNR(db
) & Steg
-img SSIM
& Deco
-img SSIM \\
Database
&Basic model
& Antique's model
& Our model \\
\midrule
ImageNet
&0.831 &0.806 &0.789 \\
COCO
&0.795 &0.769 &0.746 \\
\bottomrule
\end
{tabular
}
\end
{table
*}
結果如下:
如果覺得表格長度不符合,可以自己調整。
表格太短:
\setlength{\tabcolsep}{7mm}{XXXX} ,調整表格寬度, 效果為”按頁面寬度調整表格”。7mm可以自己根據表格調整,一直到文檔寬度。
\begin
{table
*}[h
]
% increase table row spacing
, adjust to taste
\renewcommand
{\arraystretch
}{1.3}
\caption
{An Example of three line Table
}
\label
{table_3
}
\centering
\setlength
{\tabcolsep
}{10mm
}{
\begin
{tabular
}{llll
}
\toprule
%A
& N
=3 1 &N
=5 & N
=7 & N
=9 \\
%Loss function
& Steg
-img
PSNR(db
) & Deco
-img
PSNR(db
) & Steg
-img SSIM
& Deco
-img SSIM \\
Database
&Basic model
& Antique's model
& Our model \\
\midruleImageNet
&0.831 &0.806 &0.789 \\COCO
&0.795 &0.769 &0.746 \\\bottomrule
\end
{tabular
}}
\end
{table
*}
效果如下:
2.表格過寬
\resizebox{\textwidth}{15mm}{XXXX} ,根據表格內容自動調整表格寬度。
{15mm}是可以根據自己文章和表格來調整的。
\begin
{table
}[!t
]
% increase table row spacing
, adjust to taste
%\renewcommand
{\arraystretch
}{1.3}
\textbf
{Table
2}~~PSNR and SSIM of steganography and decoded information\\
\label
{table_1
}
\centering
\setlength
{\tabcolsep
}{1.2mm
}{
\begin
{tabular
}{lllll
}
\toprule
Loss function
&\tabincell
{c
}{Steg
-img\\
PSNR(db
)} &\tabincell
{c
}{Deco
-img\\
PSNR(db
)} &\tabincell
{c
}{Steg
-img\\SSIM
} &\tabincell
{c
}{Deco
-img\\SSIM
} \\
\midrule
MSE
& 27.97 & 26.30 &0.8592 &0.8301 \\
SSIM
& 1.0000 &1.0000 &1.0000 &1.0000 \\
MSE
+SSIM
&7.2632 &14.3913 &21.0323 &27.3171 \\
\bottomrule
\end
{tabular
}}
\end
{table
}
tabincell是表格內換行的命令,自定義的,需在文章前添加 \newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
效果:
其中第二個表格是正常的,第一個是調整后的表格。
總結
以上是生活随笔為你收集整理的Latex画三线格的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。