2

How do I set the two columns in this table to have a fixed width? I wanted a line break in between the words "Biosynthesis using Ralstonia eutropha" but using \newline doesn't achieve it. The text within the table also has a smaller font compared to the rest of my document but I want the table to be longer and if necessary crossover two pages.

\documentclass[11pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath, amsfonts, amssymb}
\begin{document}
\begin{table}[H]
\centering
\hrule
\vspace{1mm}
\caption{Summary of the advantages and disadvantages of each method of ethanol production}
\vspace{1mm}
\hrule
\vspace{2mm}
\begin{adjustbox}{max width=\textwidth,center}
\begin{tabular}[t]{l*{1}{>{\raggedright\arraybackslash}p{\linewidth}}}
Ethene Hydration&
\textbf{Advantages:}
\vspace{2mm}
\newline
1) Cost effective as ethene is a product of the petroleum industry so can be produced cheaply
\vspace{2mm}
\newline
2) Ethanol produced as a continuous process unlike fermentation which occurs under batch conditions
\vspace{2mm}
\newline
\textbf{Disadvantages:}
\vspace{2mm}
\newline
1) Optimal operating conditions require high temperatures and pressures to be maintained
\vspace{2mm}
\newline
2) Ethene is derived from crude oil which is a non-renewable resource meaning ethanol produced by this method has a high carbon footprint
\vspace{2mm}
\\
Fermentation&
\textbf{Advantages:}
\vspace{2mm}
\newline
1) Ethanol produced by this method is relatively cheap as energy requirements and cost of raw materials is low
\vspace{2mm}
\newline
2) Ethanol has a low carbon footprint due to renewable source of raw materials
\vspace{2mm}
\newline
\textbf{Disadvantages:}
\vspace{2mm}
\newline
1) Reaction is relatively slow since ethanol is toxic to yeast in high concentrations
\vspace{2mm}
\newline
2) Production takes place under batch conditions further making production by fermentation slow
\vspace{2mm}
\newline
3) Biomass growth for Ethanol production uses land which would otherwise be used for food generation
\vspace{2mm}
\\
Biosynthesis using Ralstonia eutropha&
\textbf{Advantages:}
\vspace{2mm}
\newline
1) Low to negative carbon footprint
\vspace{2mm}
\newline
2) Vaporization off waste streams providing economic incentive to carbon capture
\vspace{2mm}
\newline
3) Ability to implement continuous production process
\vspace{2mm}
\newline
4) Compatibility with renewable energy sources
\vspace{2mm}
\newline
\textbf{Disadvantages:}
\vspace{2mm}
\newline
1) Currently very low ethanol yields
\vspace{2mm}
\newline
2) Expensive due to the low efficiencies of MES leading to high costs of acetate production. \cite{choi_factors_1999} indicate the substrate cost can be up to 38\% of the operating cost
\vspace{2mm}
\\
\bottomrule
\end{tabular}
\end{adjustbox}
\label{tab:ethanol_production}
\end{table}
\end{document}

enter image description here

The image below shows how I would like to have the table look (done in Microsoft Word).

enter image description here

2
  • Welcome to TeX.SX! Is a table really the best way to display that kind of information? Probably a nested description/enumerate-like list would be better?
    – leandriis
    Apr 25 at 19:15
  • maybe not for this case, but I have a few tables with the same structure which can only be displayed as a table.
    – Luke
    Apr 25 at 19:27
2

Let's go through the issues one at a time:

  • To get a linebreak inside of the lengthier text in the first column, you can use a p type column, just as the one you used for your second column. Chose an appropriate width and you don't have to worry about manual line breaks.

  • The font size in your table is smaller than the font size in th erest of your document since you used adjustbox to squeeze and ovverly wide table into the textwidth. Remove the adjustox and either select a suitable column width yourself or let an appropriate package do the computation for you (tabularx for single page tables, xltabular for multi page tables).

  • To get the table to span multiple pages, remove the table environment, replace tabular with longtable or xltabular (load the corresponding package in the preamble) and move \caption and \label inside of longtable/xltabular. For this particular table, I chose xltabular because I didn't want to worry about calculating the required width of the second column while at the same time making sure, the table does not exceed the available text width.

Some further issues I tried to address in my example:

  • I used a customized enumerate-like list (done with the help of the enumitempackage) in order to overcome the need for manually numebred items.
  • I removed all manual \vspace commands. If you prefer more space between the individual lines of the table, you can adjust the settings of the tabenum environment accordingly.

Thie leads to the following MWE, in which I also added an alternative enumerate/itemize-based approach:

\documentclass[11pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{xltabular,booktabs}
\setlength{\LTcapwidth}{\textwidth}
\usepackage{enumitem}
\newlist{tabenum}{enumerate}{1}
\setlist[tabenum]{label*=\arabic*),
                  leftmargin=*,
                  nosep}



%%%%% only used in the second example %%%%%
\usepackage{pifont}
\newlist{pros}{itemize}{1}
\setlist[pros]{label*=\ding{52},
                  leftmargin=*,
                  nosep}
                  
\newlist{cons}{itemize}{1}
\setlist[cons]{label*=\ding{56},
                  leftmargin=*,
                  nosep}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      

\begin{document}
\begin{xltabular}{\linewidth}{@{}>{\raggedright\arraybackslash}p{2.75cm}X@{}}
\caption{Summary of the advantages and disadvantages of each method of ethanol production}
\label{tab:ethanol_production}\\
\toprule
Ethene Hydration&
\textbf{Advantages:}
\begin{tabenum}
  \item Cost effective as ethene is a product of the petroleum industry so can be produced cheaply
  \item Ethanol produced as a continuous process unlike fermentation which occurs under batch conditions
\end{tabenum}

\textbf{Disadvantages:}
\begin{tabenum}
  \item Optimal operating conditions require high temperatures and pressures to be maintained
  \item Ethene is derived from crude oil which is a non-renewable resource meaning ethanol produced by this method has a high carbon footprint
\end{tabenum}
\\
Fermentation&
\textbf{Advantages:}
\begin{tabenum}
  \item Ethanol produced by this method is relatively cheap as energy requirements and cost of raw materials is low
  \item Ethanol has a low carbon footprint due to renewable source of raw materials
\end{tabenum}

\textbf{Disadvantages:}
\begin{tabenum}
  \item Reaction is relatively slow since ethanol is toxic to yeast in high concentrations
  \item Production takes place under batch conditions further making production by fermentation slow
  \item Biomass growth for Ethanol production uses land which would otherwise be used for food generation
\end{tabenum}
\\
Biosynthesis using Ralstonia eutropha&
\textbf{Advantages:}
\begin{tabenum}
  \item Low to negative carbon footprint
  \item Vaporization off waste streams providing economic incentive to carbon capture
  \item Ability to implement continuous production process
  \item Compatibility with renewable energy sources
\end{tabenum}

\textbf{Disadvantages:}
\begin{tabenum}
  \item Currently very low ethanol yields
  \item Expensive due to the low efficiencies of MES leading to high costs of acetate production. \cite{choi_factors_1999} indicate the substrate cost can be up to 38\% of the operating cost
\end{tabenum}
\\
\bottomrule
\end{xltabular}

\newpage

\begin{enumerate}
\item Ethene Hydration
  \begin{pros}
  \item Cost effective as ethene is a product of the petroleum industry so can be produced cheaply
  \item Ethanol produced as a continuous process unlike fermentation which occurs under batch conditions
  \end{pros}
  \begin{cons}
  \item Optimal operating conditions require high temperatures and pressures to be maintained
  \item Ethene is derived from crude oil which is a non-renewable resource meaning ethanol produced by this method has a high carbon footprint
  \end{cons}
\item Fermentation
  \begin{pros}
  \item Ethanol produced by this method is relatively cheap as energy requirements and cost of raw materials is low
  \item Ethanol has a low carbon footprint due to renewable source of raw materials
  \end{pros}
  \begin{cons}
  \item Reaction is relatively slow since ethanol is toxic to yeast in high concentrations
  \item Production takes place under batch conditions further making production by fermentation slow
  \item Biomass growth for Ethanol production uses land which would otherwise be used for food generation
  \end{cons}
\item Biosynthesis using Ralstonia eutropha
  \begin{pros}
  \item Low to negative carbon footprint
  \item Vaporization off waste streams providing economic incentive to carbon capture
  \item Ability to implement continuous production process
  \item Compatibility with renewable energy sources
  \end{pros}
  \begin{cons}
  \item Currently very low ethanol yields
  \item Expensive due to the low efficiencies of MES leading to high costs of acetate production. \cite{choi_factors_1999} indicate the substrate cost can be up to 38\% of the operating cost
  \end{cons}
\end{enumerate}


\end{document}

Output of the xltabular-based approach:

enter image description here

Output of the alternative approach:

enter image description here

1
  • Thank you very much! Like the alternative too.
    – Luke
    Apr 25 at 19:41

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.