![当文档类别是两列时,如何创建单列格式的表格?](https://linux22.com/image/367534/%E5%BD%93%E6%96%87%E6%A1%A3%E7%B1%BB%E5%88%AB%E6%98%AF%E4%B8%A4%E5%88%97%E6%97%B6%EF%BC%8C%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E5%8D%95%E5%88%97%E6%A0%BC%E5%BC%8F%E7%9A%84%E8%A1%A8%E6%A0%BC%EF%BC%9F.png)
我正在写一篇双列格式的论文。在那篇论文中,我想插入一个单列格式的表格。如何在 LaTeX 中做到这一点?
我已尝试使用以下代码:
\documentclass[final,5p,twocolumn]{elsarticle}
\usepackage{graphics}
\graphicspath{{F:/Figures/}}
\begin{document}
\section{1}
\section{2}
\section{3}
**\onecolumn
\begin{table}[h]
\centering
\caption{Quality Metrics}
\label{my-label}
\begin{tabular}{cll} \hline
\end{tabular}
\end{table}
\twocolumn
\section{Conclusions}
\end{document}
答案1
希望您需要表格跨越两列,如果是,请参考以下 MWE:
\documentclass[final,5p,twocolumn]{elsarticle}
\usepackage{graphics}
\graphicspath{{F:/Figures/}}
\begin{document}
\section{1}
\section{2}
\section{3}
\begin{table*}
\centering \caption{Quality Metrics}
\label{my-label}
\begin{tabular}{cll}
\hline
\end{tabular}
\end{table*}
如果不符合您的要求,请明确您的要求...
答案2
我不知道包elsarticle
需要什么,但如果它使用multicol
调用列,你可能会有麻烦,参见评论这个答案。对于multicol
,浮点数存在问题:它们不允许出现在multicol
环境中。
那么你可以使用:
\documentclass{article}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
first first first ...
\begin{center}
\begin{tabular}{|p{0.1\textwidth}|p{0.1\textwidth}|p{0.1\textwidth}|}
\hline
& & \tabularnewline
\hline
\end{tabular}
\end{center}
second second second ...\columnbreak
third third third ...
\end{multicols}
\end{document}
根据评论进行编辑:您也可以选择不使用multicol
包并调用twocolumn
作为文档类选项。如果您只想要表格,上述方法仍然有效。