A set to teach you how to draw parallel charts with LATEX

Many times when we are doing typesetting, do you have a headache because a single picture or table takes up a lot of space?
The following is an introduction to how to draw parallel charts:
No matter what form, minipage can be used to implement it. At the same time, it can be combined with the previous statement to complete the layout of parallel tables and figures with respective categories of captions.

Each chart has a 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}

The above method can be used to complete the juxtaposition of tables and figures. Note that there must be a statement in front; in addition, if you want two tables or figures to have only one caption, you can remove all the captions inside and define the caption outside.


\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}

Reference:
https://blog.csdn.net/carrie_0307/article/details/105173838

Other operations on latex charts:

Table adjusts column spacing and line spacing:

\renewcommand{
    
    \arraystretch}{
    
    1.3}%调行距
\setlength\tabcolsep{
    
    3pt}%调列距

おすすめ

転載: blog.csdn.net/weixin_42988382/article/details/123023550
おすすめ