minipage 中 6 个表格的间距问题

minipage 中 6 个表格的间距问题

我在小页面中 6 个表格的正确对齐方面遇到了问题。我尝试使用 减少表格之间的空间\vspace{-x},但这种方法并不奏效。我目前拥有的表格如下: 在此处输入图片描述

但是,[a.23 a.24] 和 [a.25 a.26] 之间的间距太大,我找不到如何减小它的方法。我在 A.24 和 A.25 之间使用的空间(第一个上方)\noindent似乎减少了 [a.25 a.26] 和 [a.27 a.28] 之间的空间。我该如何改变它,或者是否有更智能的方法来执行此格式?我使用的源代码如下。

编辑:通过删除 \vspace 和 [1\width] 问题已修复。谢谢您的帮助!

\section{Results molar mass gradient}
\begin{table}[hbt!]
\vspace{-20mm}
  {\begin{minipage}[c][1\width]{
       0.5\textwidth}
       \centering
       \caption{Effectiveness factor of component A and percentage error for slow reaction.}
            \begin{tabular}{|l|l|l|l}
            \hline
            Model     & Effectiveness factor & Error {[}\%{]} \\ \hline
MS   & 0.98869 & 0      \\ \hline
FW   & 0.98868 & -0.001 \\ \hline
FW,M & 0.98867 & -0.002 \\ \hline
            \end{tabular}
            \label{postertest1effectiveness}
    \end{minipage}}
 \hfill     
  {\begin{minipage}[c][1\width]{
       0.45\textwidth}
       \centering
       \caption{Percentage error in fluxes at the edge of the particle for slow reaction.}
\begin{tabular}{|l|l|l|l|}
    \hline
        Model     & Flux A & Flux B & Flux C   \\ \hline
MS   & 0      & 0      & 0      \\ \hline
FW   & 0.04   & 0.06   & 0.16   \\ \hline
FW,M & 0.06   & 0.07   & 0.11    \\ \hline
\end{tabular}
\label{postertest1fluxedge}
    \end{minipage}}
    \vspace{-20mm}
    \noindent
      {\begin{minipage}[c][1\width]{
       0.5\textwidth}
       \centering
       \caption{Effectiveness factor of component A and percentage error for moderate reaction.}
            \begin{tabular}{|l|l|l|l}
            \hline
            Model     & Effectiveness factor & Error {[}\%{]} \\ \hline
MS   & 0.73   & 0      \\ \hline
FW   & 0.727  & -0.463 \\ \hline
FW,M & 0.725  & -0.649 \\ \hline
            \end{tabular}
            \label{postertest1effectiveness}
    \end{minipage}}
 \hfill     
  {\begin{minipage}[c][1\width]{
       0.45\textwidth}
       \centering
       \caption{Percentage error in fluxes at the edge of the particle for moderate reaction.}
\begin{tabular}{|l|l|l|l|}
    \hline
        Model     & Flux A & Flux B & Flux C   \\ \hline
MS   & 0      & 0      & 0      \\ \hline
FW   & 0.12   & 0.05   & 0.67   \\ \hline
FW,M & 0.12   & 0.13   & 0.54   \\ \hline
\end{tabular}
\label{postertest1fluxedge}
    \end{minipage}}
    \vspace{-20mm}
    \noindent
      {\begin{minipage}[c][1\width]{
       0.5\textwidth}
       \centering
       \caption{Effectiveness factor of component A and percentage error for fast reaction.}
            \begin{tabular}{|l|l|l|l}
            \hline
            Model     & Effectiveness factor & Error {[}\%{]} \\ \hline
MS   & 0.159  & 0      \\ \hline
FW   & 0.155  & -2.599 \\ \hline
FW,M & 0.155  & -2.471 \\ \hline
            \end{tabular}
            \label{postertest1effectiveness}
    \end{minipage}}
 \hfill     
  {\begin{minipage}[c][1\width]{
       0.45\textwidth}
       \centering
       \caption{Percentage error in fluxes at the edge of the particle for fast reaction.}
\begin{tabular}{|l|l|l|l|}
    \hline
        Model     & Flux A & Flux B & Flux C   \\ \hline
MS   & 0      & 0      & 0      \\ \hline
FW   & 0.84   & 1.76   & 9.60  \\ \hline
FW,M & 1.66   & 2.12   & 3.88   \\ \hline
\end{tabular}
\label{postertest1fluxedge}
    \end{minipage}}
\end{table}

答案1

  • 您没有提供任何有关文档的信息。因此我使用articledocumentclass
  • 对于表我使用tabularray包(更简单和更短的代码)
  • 对于带有数字的列,使用S列,使用tabularray语法Q[c, si={table-format=1.3}]

在此处输入图片描述

\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage[skip=1ex]{caption}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
\section{Results molar mass gradient}
    \begin{table}[hbt!]
    \centering
\begin{minipage}{0.4\textwidth}
   \centering
   \caption{Effectiveness factor of component A and percentage error for slow reaction.}
\begin{tblr}{hlines, vlines,
             colspec={l Q[c, si={table-format=1.5}] Q[c, si={table-format=-1.3}]},
             }
Model   & {{{Effectiveness factor}}} 
                    & {{{Error [\si{\%}]}}} \\
MS      & 0.98869   &  0                    \\
FW      & 0.98868   & -0.001                \\
FW,M    & 0.98867   & -0.002                \\ 
\end{tblr}
\label{postertest1effectiveness}
\end{minipage}
\hfil
\begin{minipage}{0.4\textwidth}
   \centering
   \caption{Percentage error in fluxes at the edge of the particle for slow reaction.}
\begin{tblr}{hlines, vlines,
             colspec={l *{3}{Q[c, si={table-format=1.2}]}},
             }
Model   & {{{Flux A}}}
                & {{{Flux B}}}
                        & {{{Flux C}}}  \\ 
MS      & 0     & 0     & 0         \\  
FW      & 0.04  & 0.06  & 0.16      \\  
FW,M    & 0.06  & 0.07  & 0.11      \\  
\end{tblr}
\label{postertest1fluxedge}
\end{minipage}

\bigskip
\begin{minipage}{0.4\textwidth}
   \centering
   \caption{Effectiveness factor of component A and percentage error for moderate reaction.}
\begin{tblr}{hlines, vlines,
             colspec={l *{2}{Q[c, si={table-format=1.3}]} },
             }
Model   & {{{Effectiveness factor}}}
                & {{{Error [\si{\%}]}}} \\
MS      & 0.73  & 0                     \\ 
FW      & 0.727 & -0.463                \\  
FW,M    & 0.725 & -0.649                \\  
\end{tblr}
\label{postertest1effectiveness}
\end{minipage}
\hfil
\begin{minipage}{0.4\textwidth}
   \centering
   \caption{Percentage error in fluxes at the edge of the particle for moderate reaction.}
\begin{tblr}{hlines, vlines,
             colspec={l *{3}{Q[c, si={table-format=1.2}]}},
             }
Model   & {{{Flux A}}}
                & {{{Flux B}}}
                        & {{{Flux C}}}  \\
MS      & 0     & 0     & 0             \\  
FW      & 0.12  & 0.05  & 0.67          \\ 
FW,M    & 0.12  & 0.13  & 0.54          \\ 
\end{tblr}
\label{postertest1fluxedge}
\end{minipage}

\bigskip
\begin{minipage}{0.4\textwidth}
   \centering
   \caption{Effectiveness factor of component A and percentage error for fast reaction.}
\begin{tblr}{hlines, vlines,
             colspec={l *{2}{Q[c, si={table-format=1.3}]}},
             }
Model   & {{{Effectiveness factor}}}
                & {{{Error [\si{\%}]}}} \\
MS      & 0.159 & 0                     \\ 
FW      & 0.155 & -2.599                \\
FW,M    & 0.155 & -2.471                \\
\end{tblr}
\label{postertest1effectiveness}
\end{minipage}
\hfil
\begin{minipage}{0.4\textwidth}
   \centering
   \caption{Percentage error in fluxes at the edge of the particle for fast reaction.}
\begin{tblr}{hlines, vlines,
             colspec={l *{3}{Q[c, si={table-format=1.2}]}},
             }
Model   & {{{Flux A}}}
            & {{{Flux B}}}
                    & {{{Flux C}}}  \\
MS   & 0    & 0     & 0             \\
FW   & 0.84 & 1.76  & 9.60          \\
FW,M & 1.66 & 2.12  & 3.88          \\
\end{tblr}
\label{postertest1fluxedge}
\end{minipage}
    \end{table}
\end{document}

相关内容