我在 Lyx 中有一个带表格的双列文档。我遇到的第一个障碍是表格遵循双列规则,因此它试图将其仅放在一列中,结果溢出了。我尝试使用推荐的“跨列”选项来解决这个问题,但这样做之后,表格就消失了。
最后我通过添加\usepackage{cuted}
序言并将表格放在\begin{strip} \end{strip}
命令中解决了这个问题。我现在的问题是表格标题仍然遵守两列规则,因此它在到达一列末尾后会换行。
当它到达表格末尾时,有什么方法可以强制它换行吗?
以下是 Lyx 生成的 MWE:
\documentclass[twocolumn,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{array}
\usepackage{float}
\usepackage[numbers]{natbib}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
{hyperref}
\makeatletter
\providecommand{\tabularnewline}{\\}
\@ifundefined{date}{}{\date{}}
\usepackage{cuted}
\usepackage{subfig}
\usepackage{caption}
\captionsetup{format=plain, font=small, labelfont=bf}
\makeatother
\begin{document}
\title{}
\author{}
\maketitle
\begin{abstract}
\end{abstract}
\section{Introduction}
\section{Related work}
\section{Research approach}
Sample text...
\begin{strip}
\begin{table}[H]
\centering{}%
\begin{tabular}{|l|>{\raggedright}p{7cm}|l|}
\hline
\textbf{Step \#} & \textbf{Process Activitiy} & \textbf{Output}\tabularnewline
\hline
\hline
1 & Define research question, identify relevant forums & Defined the scope of the study\tabularnewline
\hline
2 & Conduct search for primary studies in the topic & The paper pool of the study (all papers)\tabularnewline
\hline
3 & Screening and identifying primary papers & The pool of primary papers\tabularnewline
\hline
4 & Keywording using abstracts & Classification of the papers\tabularnewline
\hline
5 & Data extraction and mapping process & Systematic map, statistical data\tabularnewline
\hline
6 & Documentation of the systematic map, analysis of results & Systematic mapping study\tabularnewline
\hline
\end{tabular}\caption{Systematic mapping study steps, as defined by Petersen et al. \citep{petersen2008systematic}
taken from Savchenko et al. \citep{savchenko2019}}
\end{table}
\end{strip}
\section{Results and observations}
\section{Discussion and implications}
\section{Conclusions}
\bibliographystyle{unsrt}
\nocite{*}
\bibliography{\string"Sources\string"}
\end{document}
答案1
答案2
通常,该table*
环境用于将表格放在双列页面的顶部,表格和标题覆盖两列。不要将规范[H]
与此一起使用。这是您的 MWE 的修订版本(我懒得删除与您的问题无关的所有代码)。
% twocolprob2.tex SE 531311
\documentclass[twocolumn,english]{article}
\usepackage{lipsum} % PW added
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{array}
\usepackage{float}
\usepackage[numbers]{natbib}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
{hyperref}
\makeatletter
\providecommand{\tabularnewline}{\\}
\@ifundefined{date}{}{\date{}}
\usepackage{cuted}
\usepackage{subfig}
\usepackage{caption}
\captionsetup{format=plain, font=small, labelfont=bf}
\makeatother
\begin{document}
\title{}
\author{}
\maketitle
\begin{abstract}
\end{abstract}
\section{Introduction}
\section{Related work}
\section{Research approach}
Sample text...
% \begin{strip} PW change
%\begin{table}[H] % PW changed
\begin{table*}[H] % PW added
\centering{}%
\begin{tabular}{|l|>{\raggedright}p{7cm}|l|}
\hline
\textbf{Step \#} & \textbf{Process Activitiy} & \textbf{Output}\tabularnewline
\hline
\hline
1 & Define research question, identify relevant forums & Defined the scope of the study\tabularnewline
\hline
2 & Conduct search for primary studies in the topic & The paper pool of the study (all papers)\tabularnewline
\hline
3 & Screening and identifying primary papers & The pool of primary papers\tabularnewline
\hline
4 & Keywording using abstracts & Classification of the papers\tabularnewline
\hline
5 & Data extraction and mapping process & Systematic map, statistical data\tabularnewline
\hline
6 & Documentation of the systematic map, analysis of results & Systematic mapping study\tabularnewline
\hline
\end{tabular}\caption{Systematic mapping study steps, as defined by Petersen et al. \citep{petersen2008systematic}
taken from Savchenko et al. \citep{savchenko2019}}
% \end{table} % PW changed
\end{table*} % PW added
% \end{strip} % PW change
\lipsum
\section{Results and observations}
\section{Discussion and implications}
\section{Conclusions}
\bibliographystyle{unsrt}
\nocite{*}
\bibliography{\string"Sources\string"}
\end{document}