0

I have a two-column document in Lyx with a table. First obstacle I had is that table respected the two-column rule, so it tried to fit it in one column only and ended up overflowing. I tried to fix this by using "span columns" option which was recommended, but after doing so, the table just disappeared.

In the end I solved this by adding \usepackage{cuted} to the preamble and placing the table inside \begin{strip} \end{strip} commands. My problem now is that table caption still respects two-column rule, so it wraps after it reaches end of one column.

Is there any way I can force it to wrap after it reaches end of the table?

Here is a MWE generated by Lyx:

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

Table caption is wrapped

2
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Mar 5, 2020 at 16:29
  • I added MWE generated by Lyx, hope it helps.
    – Pavel Pek
    Mar 5, 2020 at 16:41

2 Answers 2

2

(Some unnecessary text to allow me to save the answer.)

mwe

mwe

0

In general the table* environment is used to put a table at the top of a two-column page, with the table and caption covering both columns. Do not use the [H] specification with this. Here is a revised version of your MWE (I couldn't be bothered to eliminate all the code that had nothing to do with your problem).

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .