1

Problem:

I wish to break my one-column table, written in tabularx, over two pages in a two-column environment. I have seen examples where this could be done using supertabular, longtable and xtab but it does not seem to work in my example.

Minimal Working Example (MWE):

\documentclass[twocolumn]{article}
\usepackage[OT6,T1]{fontenc}                                                      
\usepackage{booktabs}
\usepackage{tabularx}

\begin{document}

\begin{table*}[t]

\caption{Caption here}

\begin{tabularx}{\textwidth}{Xcc}
\toprule
\textbf{Question} & \textbf{Responses} & \textbf{Frequency} \\
\midrule
\textbf{1. I prefer the following greeting by a chatbot:} & & \\
    \hspace{2.5mm} By saying hello. & 11 & 14.7\% \\
    \hspace{2.5mm} By saying hello, followed by my name. & 7 & 9.3\% \\
    \hspace{2.5mm} By saying hello, followed by my name and asking me what I want help with. & 27 & 36\% \\
    \hspace{2.5mm} It should be my initiative to start a conversation. & 30 & 40\% \\
\textbf{2. I prefer the following response when a chatbot does not understand me:} & & \\
    \hspace{2.5mm} \textquotedbl I am sorry, I do not understand.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am sorry, I do not understand. Maybe you can help me by asking your question in a different way?  & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am sorry, I do not understand. Do you want to talk with a human instead?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I do not know what you mean, try again!\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I have searched the internet for \textquotedbl[your previous question/statement]\textquotedbl. & 11 & 14.7\% \\
\textbf{3. You have asked a chatbot to help you look for destinations for your next business trip.} & & \\
    \hspace{2.5mm} \textbf{Which update message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Back soon.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Searching for destinations...\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Going through all the exciting options.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I don't want an update, only the result when the chatbot has finished the search.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Oh, a trip! *clapping hands* Can I come with? Think about it while I look up the
best options for your & 11 & 14.7\% \\
    \hspace{2.5mm} destination.\textquotedbl & & \\
    \hspace{2.5mm} \textquotedbl Drifting away, dreaming about the perfect destination, back soon...\textquotedbl & 11 & 14.7\% \\
\textbf{4. You ask a chatbot when the next bus to a train station leaves. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl 12:15\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Bus 11 towards *destination* leaves at 12:15.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Bus 11 leaves at 12:15, Bus 24 leaves at 12:18 and Bus 11 leaves at 12:25.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl There are five different buses leaving to the train station from your bus stop,
number 11, number 24, & 11 & 14.7\% \\
    \hspace{2.5mm} number 4, number 13 and number 121. Bus 11 leaves at 12:15, bus 24 leaves at 12:18, bus 4 leaves at 12:26, & & \\
    \hspace{2.5mm} bus 13 leaves at 12:30 and bus 121 leaves at 12:31.\textquotedbl & & \\
\textbf{5. You have asked a chatbot for the weather tomorrow. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl In what city?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl 15 degrees celsius.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl 15 degrees celsius and sunny with some clouds.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl In Gothenburg it will be 15 degrees celsius and sunny with some clouds
tomorrow.\textquotedbl & 11 & 14.7\% \\
\textbf{6. You are interacting with a chatbot that is connected to your bank.} & & \\
    \hspace{2.5mm} \textbf{Which opening message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Yo, where's the money?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hello, how can I help you today?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hi! Are you looking to save or spend today?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Good morning. I am your banking assistant bot. How can I be of service today?\textquotedbl & 11 & 14.7\% \\
\textbf{7. You are interacting with a bot that helps you play music. Which opening message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Please state genre, artist or song title in order to receive appropriate choices.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Tell me what you want to listen to, and I can help you find it!\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hi! Good to see you again, which genre do you feel like listening to today?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Groovy, you're back! I have some sweet tunes for you, you ready to get down?\textquotedbl & 11 & 14.7\% \\
\textbf{8. You are interacting for the first time with a chatbot at work to book a meeting.} & & \\
    \hspace{2.5mm} \textbf{Which opening message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Hi, I am your meeting buddy! What is on your mind? :)\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hello! Nice to see you here, let me know how I can help you.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Do you want to book a room or manage your calendar?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Welcome, would you like to see available times in your calendar?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Welcome, I am a bot that can help you to manage your calendar and book a
meeting room. Do you want & 11 & 14.7\% \\
    \hspace{2.5mm} me to suggest appropriate times for a meeting?\textquotedbl & & \\
\textbf{9. You have booked a trip with a chatbot. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Trip booked leaving tomorrow 09:05 arriving 12:08 in Stockholm.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Your trip is booked. Leaving tomorrow at 09:05 and arriving 12:08 in
Stockholm.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Your trip is booked. Your train departs from the station tomorrow at 09:05 and
will be arriving at 12:08 & 11 & 14.7\% \\
    \hspace{2.5mm} in Stockholm.\textquotedbl & & \\
\textbf{10. You are frustrated that a chatbot can not understand what you want and have expressed the} & & \\
    \hspace{2.5mm} \textbf{frustration to the chatbot. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl I don't understand. Please try again.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am sorry, it seems I am not following, could you please rephrase and try again?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am so sorry, I really want to help you but I just can not understand. Please
rephrase or try simple keywords instead.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am terribly sorry, this is not how I wanted it to end up either..! I am doing my best to help you, please bare with me, I will do everything in my power to make it up to you.\textquotedbl & 11 & 14.7\% \\
\bottomrule
\end{tabularx}

\end{table*}

\end{document}

Output:

enter image description here

Desired output:

To make tabularx (or any other table solution) continue over two pages with a footnote saying "continued from previous page".

  • 1
    You could use the xltabular package. Remove the table* environment and use \onecolunn before and \twocolumn after the xltabular. This will lead to a pagebreak between the tabular and the following twocolumn text. – leandriis Aug 26 at 14:16
  • Worked like a charm! – kexxcream Aug 26 at 14:26
  • Unrelated to the actual question: Do you only want to indent the first line of every answer or do you want to indent the whole answer block? (See for example question 1, response 3) – leandriis Aug 26 at 18:34
  • @leandriis The whole answer block, any suggestions? – kexxcream Aug 26 at 18:47
  • That's what I already guessed. I have something in mind to automate this. As soon as I have finished, I will post an answer to also include that. – leandriis Aug 26 at 18:56
2

In order to get a multi page table with X type columns that spans both columns of a twocolumn article, you can use xltabular and use \onecolumn before and \twocolumn after the xltabular. Please keep in mind that ther will be a pagebreak whenever \onecolumn or \twocolumn is used.

Here is a complete MWE:

\documentclass[twocolumn]{article}
\usepackage[OT6,T1]{fontenc}                                                      
\usepackage{booktabs}
\usepackage{xltabular}

\begin{document}

\onecolumn
\begin{xltabular}{\textwidth}{Xcc}
\caption{Caption here}\\
\toprule
\textbf{Question} & \textbf{Responses} & \textbf{Frequency} \\
\midrule
\endfirsthead
\caption{Caption here - continued from previous page}\\
\toprule
\textbf{Question} & \textbf{Responses} & \textbf{Frequency} \\
\midrule
\endhead
\textbf{1. I prefer the following greeting by a chatbot:} & & \\
    \hspace{2.5mm} By saying hello. & 11 & 14.7\% \\
    \hspace{2.5mm} By saying hello, followed by my name. & 7 & 9.3\% \\
    \hspace{2.5mm} By saying hello, followed by my name and asking me what I want help with. & 27 & 36\% \\
    \hspace{2.5mm} It should be my initiative to start a conversation. & 30 & 40\% \\
\textbf{2. I prefer the following response when a chatbot does not understand me:} & & \\
    \hspace{2.5mm} \textquotedbl I am sorry, I do not understand.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am sorry, I do not understand. Maybe you can help me by asking your question in a different way?  & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am sorry, I do not understand. Do you want to talk with a human instead?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I do not know what you mean, try again!\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I have searched the internet for \textquotedbl[your previous question/statement]\textquotedbl. & 11 & 14.7\% \\
\textbf{3. You have asked a chatbot to help you look for destinations for your next business trip.} & & \\
    \hspace{2.5mm} \textbf{Which update message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Back soon.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Searching for destinations...\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Going through all the exciting options.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I don't want an update, only the result when the chatbot has finished the search.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Oh, a trip! *clapping hands* Can I come with? Think about it while I look up the
best options for your & 11 & 14.7\% \\
    \hspace{2.5mm} destination.\textquotedbl & & \\
    \hspace{2.5mm} \textquotedbl Drifting away, dreaming about the perfect destination, back soon...\textquotedbl & 11 & 14.7\% \\
\textbf{4. You ask a chatbot when the next bus to a train station leaves. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl 12:15\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Bus 11 towards *destination* leaves at 12:15.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Bus 11 leaves at 12:15, Bus 24 leaves at 12:18 and Bus 11 leaves at 12:25.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl There are five different buses leaving to the train station from your bus stop,
number 11, number 24, & 11 & 14.7\% \\
    \hspace{2.5mm} number 4, number 13 and number 121. Bus 11 leaves at 12:15, bus 24 leaves at 12:18, bus 4 leaves at 12:26, & & \\
    \hspace{2.5mm} bus 13 leaves at 12:30 and bus 121 leaves at 12:31.\textquotedbl & & \\
\textbf{5. You have asked a chatbot for the weather tomorrow. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl In what city?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl 15 degrees celsius.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl 15 degrees celsius and sunny with some clouds.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl In Gothenburg it will be 15 degrees celsius and sunny with some clouds
tomorrow.\textquotedbl & 11 & 14.7\% \\
\textbf{6. You are interacting with a chatbot that is connected to your bank.} & & \\
    \hspace{2.5mm} \textbf{Which opening message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Yo, where's the money?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hello, how can I help you today?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hi! Are you looking to save or spend today?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Good morning. I am your banking assistant bot. How can I be of service today?\textquotedbl & 11 & 14.7\% \\
\textbf{7. You are interacting with a bot that helps you play music. Which opening message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Please state genre, artist or song title in order to receive appropriate choices.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Tell me what you want to listen to, and I can help you find it!\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hi! Good to see you again, which genre do you feel like listening to today?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Groovy, you're back! I have some sweet tunes for you, you ready to get down?\textquotedbl & 11 & 14.7\% \\
\textbf{8. You are interacting for the first time with a chatbot at work to book a meeting.} & & \\
    \hspace{2.5mm} \textbf{Which opening message do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Hi, I am your meeting buddy! What is on your mind? :)\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Hello! Nice to see you here, let me know how I can help you.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Do you want to book a room or manage your calendar?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Welcome, would you like to see available times in your calendar?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Welcome, I am a bot that can help you to manage your calendar and book a
meeting room. Do you want & 11 & 14.7\% \\
    \hspace{2.5mm} me to suggest appropriate times for a meeting?\textquotedbl & & \\
\textbf{9. You have booked a trip with a chatbot. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl Trip booked leaving tomorrow 09:05 arriving 12:08 in Stockholm.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Your trip is booked. Leaving tomorrow at 09:05 and arriving 12:08 in
Stockholm.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl Your trip is booked. Your train departs from the station tomorrow at 09:05 and
will be arriving at 12:08 & 11 & 14.7\% \\
    \hspace{2.5mm} in Stockholm.\textquotedbl & & \\
\textbf{10. You are frustrated that a chatbot can not understand what you want and have expressed the} & & \\
    \hspace{2.5mm} \textbf{frustration to the chatbot. Which response do you prefer?} & & \\
    \hspace{2.5mm} \textquotedbl I don't understand. Please try again.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am sorry, it seems I am not following, could you please rephrase and try again?\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am so sorry, I really want to help you but I just can not understand. Please
rephrase or try simple keywords instead.\textquotedbl & 11 & 14.7\% \\
    \hspace{2.5mm} \textquotedbl I am terribly sorry, this is not how I wanted it to end up either..! I am doing my best to help you, please bare with me, I will do everything in my power to make it up to you.\textquotedbl & 11 & 14.7\% \\
\bottomrule
\end{xltabular}
\twocolumn


\end{document}

Since I correctly assumed that you wanted to horizontally indent the whole answer block with respect to each question, I came up with the following MWE. Here, I have @{\quad\quad} to indent all contents of the first column by the width of \quad\quad To verwrite this indentation for the questions, I have used \multicolumn{1}{@{\hspace{6pt}}X}{...}. As this is quite lengthy and in order to not having to manually number the question, I have introduced a new counter and the custom command \myquestion that takes care of the fomratting and numbering of teh questions. I have also used the siunitx package for an improved alignment of the numbers in the second and third column and removed the repeated \%. Lastly, I have also added \addlinespace to add a little bit of vertical white spacing before every new question.

enter image description here

\documentclass[twocolumn]{article}
\usepackage[OT6,T1]{fontenc}                                                      
\usepackage{booktabs}
\usepackage{xltabular}

\usepackage{siunitx}

\newcounter{myquestionnumber}
\setcounter{myquestionnumber}{1}

\newcommand{\myquestion}[1]{\multicolumn{1}{@{\hspace{6pt}}X}{\textbf{\themyquestionnumber.~#1}}\stepcounter{myquestionnumber}}

\begin{document}

\onecolumn
\begin{xltabular}{\textwidth}{@{\quad\quad}>{\raggedright\arraybackslash}XS[table-format=2]S[table-format=2.1]}
\caption{Caption here}\\
\toprule
\multicolumn{1}{@{\hspace{6pt}}X}{\textbf{Question}} & \textbf{Responses} & \textbf{Frequency in \%} \\
\midrule
\endfirsthead
\caption{Caption here - continued from previous page}\\
\toprule
\multicolumn{1}{@{\hspace{6pt}}X}{\textbf{Question}} & \textbf{Responses} & \textbf{Frequency in \%} \\
\midrule
\endhead
\myquestion{I prefer the following greeting by a chatbot:} & & \\
     By saying hello. & 11 & 14.7   \\
     By saying hello, followed by my name. & 7 & 9.3 \\
     By saying hello, followed by my name and asking me what I want help with. & 27 & 36 \\
     It should be my initiative to start a conversation. & 30 & 40 \\
     \addlinespace
\myquestion{I prefer the following response when a chatbot does not understand me:} & & \\
     \textquotedbl I am sorry, I do not understand.\textquotedbl & 11 & 14.7 \\
     \textquotedbl I am sorry, I do not understand. Maybe you can help me by asking your question in a different way?  & 11 & 14.7 \\
     \textquotedbl I am sorry, I do not understand. Do you want to talk with a human instead?\textquotedbl & 11 & 14.7 \\
    \ \textquotedbl I do not know what you mean, try again!\textquotedbl & 11 & 14.7 \\
     \textquotedbl I have searched the internet for \textquotedbl[your previous question/statement]\textquotedbl. & 11 & 14.7 \\
     \addlinespace
\myquestion{You have asked a chatbot to help you look for destinations for your next business trip. Which update message do you prefer?} & & \\
      \textquotedbl Back soon.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Searching for destinations...\textquotedbl & 11 & 14.7 \\
      \textquotedbl Going through all the exciting options.\textquotedbl & 11 & 14.7 \\
      \textquotedbl I don't want an update, only the result when the chatbot has finished the search.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Oh, a trip! *clapping hands* Can I come with? Think about it while I look up the
best options for your  destination.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Drifting away, dreaming about the perfect destination, back soon...\textquotedbl & 11 & 14.7 \\
      \addlinespace
\myquestion{You ask a chatbot when the next bus to a train station leaves. Which response do you prefer?} & & \\
      \textquotedbl 12:15\textquotedbl & 11 & 14.7 \\
      \textquotedbl Bus 11 towards *destination* leaves at 12:15.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Bus 11 leaves at 12:15, Bus 24 leaves at 12:18 and Bus 11 leaves at 12:25.\textquotedbl & 11 & 14.7 \\
      \textquotedbl There are five different buses leaving to the train station from your bus stop,
number 11, number 24, number 4, number 13 and number 121. Bus 11 leaves at 12:15, bus 24 leaves at 12:18, bus 4 leaves at 12:26, bus 13 leaves at 12:30 and bus 121 leaves at 12:31.\textquotedbl & 11 & 14.7 \\
\addlinespace
\myquestion{You have asked a chatbot for the weather tomorrow. Which response do you prefer?} & & \\
      \textquotedbl In what city?\textquotedbl & 11 & 14.7   \\
      \textquotedbl 15 degrees celsius.\textquotedbl & 11 & 14.7   \\
      \textquotedbl 15 degrees celsius and sunny with some clouds.\textquotedbl & 11 & 14.7 \\
      \textquotedbl In Gothenburg it will be 15 degrees celsius and sunny with some clouds
tomorrow.\textquotedbl & 11 & 14.7 \\
\addlinespace
\myquestion{You are interacting with a chatbot that is connected to your bank. Which opening message do you prefer?} & & \\
      \textquotedbl Yo, where's the money?\textquotedbl & 11 & 14.7 \\
      \textquotedbl Hello, how can I help you today?\textquotedbl & 11 & 14.7 \\
      \textquotedbl Hi! Are you looking to save or spend today?\textquotedbl & 11 & 14.7 \\
      \textquotedbl Good morning. I am your banking assistant bot. How can I be of service today?\textquotedbl & 11 & 14.7 \\
      \addlinespace
\myquestion{You are interacting with a bot that helps you play music. Which opening message do you prefer?} & & \\
      \textquotedbl Please state genre, artist or song title in order to receive appropriate choices.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Tell me what you want to listen to, and I can help you find it!\textquotedbl & 11 & 14.7 \\
      \textquotedbl Hi! Good to see you again, which genre do you feel like listening to today?\textquotedbl & 11 & 14.7 \\
      \textquotedbl Groovy, you're back! I have some sweet tunes for you, you ready to get down?\textquotedbl & 11 & 14.7 \\
      \addlinespace
\myquestion{You are interacting for the first time with a chatbot at work to book a meeting. Which opening message do you prefer?} & & \\
      \textquotedbl Hi, I am your meeting buddy! What is on your mind? :)\textquotedbl & 11 & 14.7   \\
      \textquotedbl Hello! Nice to see you here, let me know how I can help you.\textquotedbl & 11 & 14.7   \\
      \textquotedbl Do you want to book a room or manage your calendar?\textquotedbl & 11 & 14.7   \\
      \textquotedbl Welcome, would you like to see available times in your calendar?\textquotedbl & 11 & 14.7   \\
      \textquotedbl Welcome, I am a bot that can help you to manage your calendar and book a
meeting room. Do you want me to suggest appropriate times for a meeting?\textquotedbl & 11 & 14.7   \\
\addlinespace
\myquestion{You have booked a trip with a chatbot. Which response do you prefer?} & & \\
      \textquotedbl Trip booked leaving tomorrow 09:05 arriving 12:08 in Stockholm.\textquotedbl & 11 & 14.7   \\
      \textquotedbl Your trip is booked. Leaving tomorrow at 09:05 and arriving 12:08 in
Stockholm.\textquotedbl & 11 & 14.7   \\
\addlinespace
      \textquotedbl Your trip is booked. Your train departs from the station tomorrow at 09:05 and
will be arriving at 12:08 in Stockholm.\textquotedbl & 11 & 14.7   \\
\myquestion{You are frustrated that a chatbot can not understand what you want and have expressed the} & & \\
      \textbf{frustration to the chatbot. Which response do you prefer?} & & \\
      \textquotedbl I don't understand. Please try again.\textquotedbl & 11 & 14.7   \\
      \textquotedbl I am sorry, it seems I am not following, could you please rephrase and try again?\textquotedbl & 11 & 14.7   \\
      \textquotedbl I am so sorry, I really want to help you but I just can not understand. Please
rephrase or try simple keywords instead.\textquotedbl & 11 & 14.7   \\
      \textquotedbl I am terribly sorry, this is not how I wanted it to end up either..! I am doing my best to help you, please bare with me, I will do everything in my power to make it up to you.\textquotedbl & 11 & 14.7   \\
\bottomrule
\end{xltabular}
\twocolumn


\end{document}
  • Everything seems to look good except that the continued table gets a number higher than the first table number (Table 1 and 2). – kexxcream Aug 26 at 19:36
  • Also, there seems to be a }missing for \begin{xltabular}? – kexxcream Aug 26 at 19:40
  • @kexxcream: Thanks for pointing out the problem with the different table numbers on different pages. To me this somehow looks like a bug as the exact same use of a caption before \endfirsthead and another caption command before \endhead works just as expected with the longtable package. However, you can use \caption{Caption here}\addtocounter{table}{-1} as a quick fix for this. Regarding your second comment: I can't seem to find the missing }. Do you refer to the first or the second MWE in my answer? – leandriis Aug 26 at 19:58
  • To the second MWE, I am getting 450 errors. I am guessing this has to do with adding an extra column, what needs to be changed if you have a 4th column? – kexxcream Aug 26 at 20:02
  • 1
    To include a fourth column (in this case a c type column) right of the already existing ones, you can use \begin{xltabular}{\textwidth}{@{\quad\quad}>{\raggedright\arraybackslash}XS[table-format=2]S[table-format=2.1]c} – leandriis Aug 26 at 20:09
2

I have just copied some of @leandriis' table above, and used multicol instead of twocolumn. It is important to read the documentation, because you will for sure like to tweak the column balancing after you have finalise you document. The manual describes different strategies and has tips for improving page breaks and columns balancing. In particular, if you have several short multicol environments (a paragraph or two) interrupted by tables and pictures, you may need some tweaking.

Be aware that you cannot have floats (pictures, tables) inside columns.

enter image description hereenter image description here

\documentclass{article}
\usepackage{multicol, lipsum}
\usepackage[OT6,T1]{fontenc}                                                      
\usepackage{booktabs}
\usepackage{xltabular}

\usepackage{siunitx}

\newcounter{myquestionnumber}
\setcounter{myquestionnumber}{1}

\newcommand{\myquestion}[1]{\multicolumn{1}{@{\hspace{6pt}}X}{\textbf{\themyquestionnumber.~#1}}\stepcounter{myquestionnumber}}


\begin{document}

\begin{multicols}{2}[\section{We start with a section}]
\lipsum[1-2] 
\end{multicols}
\begin{xltabular}{\textwidth}{@{\quad\quad}>{\raggedright\arraybackslash}XS[table-format=2]S[table-format=2.1]}
\caption{Caption here}\\
\toprule
\multicolumn{1}{@{\hspace{6pt}}X}{\textbf{Question}} & \textbf{Responses} & \textbf{Frequency in \%} \\
\midrule
\endfirsthead
\caption{Caption here - continued from previous page}\\
\toprule
\multicolumn{1}{@{\hspace{6pt}}X}{\textbf{Question}} & \textbf{Responses} & \textbf{Frequency in \%} \\
\midrule
\endhead
\myquestion{I prefer the following greeting by a chatbot:} & & \\
     By saying hello. & 11 & 14.7   \\
     By saying hello, followed by my name. & 7 & 9.3 \\
     By saying hello, followed by my name and asking me what I want help with. & 27 & 36 \\
     It should be my initiative to start a conversation. & 30 & 40 \\
     \addlinespace
\myquestion{I prefer the following response when a chatbot does not understand me:} & & \\
     \textquotedbl I am sorry, I do not understand.\textquotedbl & 11 & 14.7 \\
     \textquotedbl I am sorry, I do not understand. Maybe you can help me by asking your question in a different way?  & 11 & 14.7 \\
     \textquotedbl I am sorry, I do not understand. Do you want to talk with a human instead?\textquotedbl & 11 & 14.7 \\
    \ \textquotedbl I do not know what you mean, try again!\textquotedbl & 11 & 14.7 \\
     \textquotedbl I have searched the internet for \textquotedbl[your previous question/statement]\textquotedbl. & 11 & 14.7 \\
     \addlinespace
\myquestion{You have asked a chatbot to help you look for destinations for your next business trip. Which update message do you prefer?} & & \\
      \textquotedbl Back soon.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Searching for destinations...\textquotedbl & 11 & 14.7 \\
      \textquotedbl Going through all the exciting options.\textquotedbl & 11 & 14.7 \\
      \textquotedbl I don't want an update, only the result when the chatbot has finished the search.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Oh, a trip! *clapping hands* Can I come with? Think about it while I look up the
best options for your  destination.\textquotedbl & 11 & 14.7 \\
      \textquotedbl Drifting away, dreaming about the perfect destination, back soon...\textquotedbl & 11 & 14.7 \\
      \addlinespace

\bottomrule
\end{xltabular}
\begin{multicols}{2}[\section{We continue with a section}]
\lipsum[1-3]\par
But we need more text to balance the columns, even more, ups to three lines more. Compilation is slow. 
\end{multicols}

\end{document}
  • @leandriis I borrowed some code from you answer. – Sveinung Aug 27 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.