在我们排版的很多时候,你是否因单图或者单表占用了大量空间而感到头疼。
下面介绍如何绘制出并列的图表:
不论何种形式,总之都可以采用minipage来进行实现,同时配合前面的声明来完成表和图的并列且带有各自类别的caption的排版。
图表各一个caption:
\makeatletter
\newcommand\tabcaption{
\def\@captype{
table}\caption}
\newcommand\figcaption{
\def\@captype{
figure}\caption}
\makeatother
\begin{
figure}
\centering
\begin{
minipage}[c]{
0.45\textwidth}
\begin{
tabular}{
cccc}
\toprule[0.5mm]
xxxx % 在这里是自己的表格
....
\end{
tabular}
\tabcaption{
xxxxxxxxxxxxx}
\end{
minipage}
\hspace{
8mm} % 用于控制间距
\begin{
minipage}[c]{
0.45\textwidth}
\includegraphics[scale=0.5]{
文件名}
\figcaption{
xxxxxxxx}
\end{
minipage}
\end{
figure}
采用上述方式就可以完成表和图的并列,注意前面必须要有声明;另外如果想要两个表或图只有一个caption的话,可以把里面的caption都去掉,在外面定义caption即可。
\begin{
figure}
\centering
\begin{
minipage}[c]{
0.45\textwidth}
\begin{
tabular}{
cccc}
\toprule[0.5mm]
xxxx % 在这里是自己的表格
....
\end{
tabular}
\end{
minipage}
\hspace{
8mm} % 用于控制间距
\begin{
minipage}[c]{
0.45\textwidth}
\includegraphics[scale=0.5]{
文件名}
\end{
minipage}
\caption{
xxxxxxxxx}
\end{
figure}
参考:
https://blog.csdn.net/carrie_0307/article/details/105173838
latex其他关于图表的操作:
表调整列距和行距:
\renewcommand{
\arraystretch}{
1.3}%调行距
\setlength\tabcolsep{
3pt}%调列距