如何在双列文档类中将子表用作单列?

如何在双列文档类中将子表用作单列?

我有以下基本\twocolumn设置https://tex.stackexchange.com/a/307286/127048,在这里我想放置一个并排的表格,subtable因为它在单列中:

\documentclass[5p,times]{elsarticle}
\usepackage{lipsum}
\begin{document}
\section{Start}

\end{document}

是否可以应用以下解决方案表格并排无法运行因为它应用于单个列。我尝试将@Zarko 的解决方案放入 \twocolumn[{ ... }]块中,但遇到了以下错误:LaTeX Error: Not in outer par mode.

尝试过的方法:

\documentclass[5p,times]{elsarticle}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{subcaption}
\usepackage{siunitx}
\begin{document}
\section{Start}
\twocolumn[
{
    \begin{table}[ht]
        \footnotesize
        \setlength\tabcolsep{0pt}
        \begin{subtable}[b]{0.48\linewidth}
            \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lll}
              \hline
              \textbf{Symbol} & {\textbf{Value}}   & \textbf{Notes}   \\
              \hline
              h               & \SI{10668}{m}      & Altitude         \\
              $\rho$          & \SI{0.379}{kg/m^3} & Air density      \\
              Ma              & 0.90               & Mach number      \\
              $\theta = 0$
                              & \SI{2.86}{\degree} & Initial attitude \\
              \hline
            \end{tabular*}
            \caption{Flight conditions}
        \end{subtable}
        \hfill
        \begin{subtable}[b]{0.48\linewidth}
            \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lll}
              \hline
              \textbf{Symbol} & {\textbf{Value}} & \textbf{Notes}  \\
              \hline
              A               & \SI{18.22}{m^2}  & Wing area       \\
              b               & \SI{0.379}{m}    & Wing span       \\
              c               & \SI{2.91}{m}     & Wing mean chord \\
              AR              & 2.45             & Aspect ratio    \\
              e               & 0.92             & Oswald factor   \\
              \hline
            \end{tabular*}
            \caption{Geometric data}
        \end{subtable}
    \end{table}
}]
\lipsum[1-2]
\end{document}

答案1

抱歉,您的问题没有完全说明您想要什么。如果您喜欢table在页面底部有浮动(如果在插入点后有足够的空间),那么您会看到,如果包stfloats提供了您想要的内容:

\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{subcaption}
\usepackage{siunitx}
\usepackage{stfloats}

\begin{document}
\section{Start}
\lipsum[1]
    \begin{table*}[b]
\begin{subtable}[b]{0.48\linewidth}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lll}
  \hline
  \textbf{Symbol} & {\textbf{Value}}   & \textbf{Notes}   \\
  \hline
  h               & \SI{10668}{m}      & Altitude         \\
  $\rho$          & \SI{0.379}{kg/m^3} & Air density      \\
  Ma              & 0.90               & Mach number      \\
  $\theta = 0$
                  & \SI{2.86}{\degree} & Initial attitude \\
  \hline
\end{tabular*}
\caption{Flight conditions}
\end{subtable}
\hfill
\begin{subtable}[b]{0.48\linewidth}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lll}
  \hline
  \textbf{Symbol} & {\textbf{Value}} & \textbf{Notes}  \\
  \hline
  A               & \SI{18.22}{m^2}  & Wing area       \\
  b               & \SI{0.379}{m}    & Wing span       \\
  c               & \SI{2.91}{m}     & Wing mean chord \\
  AR              & 2.45             & Aspect ratio    \\
  e               & 0.92             & Oswald factor   \\
  \hline
\end{tabular*}
\caption{Geometric data}
\end{subtable}
    \end{table*}

\lipsum[2-9]
\end{document}

在此处输入图片描述

答案2

为了使两个表跨越两列,可以使用cuted带有\begin{strip}...的包\end{strip}

这两个表\footnotesize没有必要适合。

表格位于 内minipage,因此它们不是浮点数,因此有必要使用\captionof{table}{<text>}而不是\caption

\begin{minipage}[b] ..使两个标题对齐。

A

\documentclass[5p,times]{elsarticle}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{subcaption}
\usepackage{siunitx}

\usepackage{calc}

\usepackage{cuted}% added <<<<<<<<<<<<<<<<<<<<

\begin{document}
    
\section{Start}

1.      \lipsum[1-2] (END)

\begin{strip} % added <<<<<<<<<<<<<

    \begin{minipage}[b]{\dimexpr0.5\textwidth-0.5\columnsep}
        \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lll}
            \hline
            \textbf{Symbol} & {\textbf{Value}}   & \textbf{Notes}   \\
            \hline
            h               & \SI{10668}{m}      & Altitude         \\
            $\rho$          & \SI{0.379}{kg/m^3} & Air density      \\
            Ma              & 0.90               & Mach number      \\
            $\theta = 0$
            & \SI{2.86}{\degree} & Initial attitude \\
        \hline
        \end{tabular*}
    \captionof{table}{Flight conditions}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{\dimexpr0.5\textwidth-0.5\columnsep}
        \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lll}
            \hline
            \textbf{Symbol} & {\textbf{Value}} & \textbf{Notes}  \\
            \hline
            A               & \SI{18.22}{m^2}  & Wing area       \\
            b               & \SI{0.379}{m}    & Wing span       \\
            c               & \SI{2.91}{m}     & Wing mean chord \\
            AR              & 2.45             & Aspect ratio    \\
            e               & 0.92             & Oswald factor   \\
            \hline
        \end{tabular*}
        \captionof{table}{Geometric data}
    \end{minipage}

\end{strip} % added <<<<<<<<<<<<<<<<<<<<<<<<<

2.  \lipsum[1-3]
\end{document}

相关内容