1

I have made a table with the following structure

\begin{center}
\begin{tabular}{ ||c|c|c|| } 
 \hline
 \textbf{Embedding} & {BiLSTM+attn} & {BiLSTM+CNN+attn} \\
 \hline
 BERT & 89.9\% & 89.8\% \\
 \hline
 DistilBERT & 89.6\% & 90.8\%  \\ 
 \hline
 RoBERTa & \textbf{90.5}\% & \textbf{90.8\% } \\ 
 \hline
\end{tabular}
\end{center}

With the output as this

output

The problem is it is getting overlapped with the right side column of paper. I also used the \\ command for newline but it is giving a totally distorted table.

output 2

I want the +attn in both the columns to appear below BiLSTM and BiLSTM+CNN respectively. But I can't find a way. Please help.

2
  • 1
    Take a look at the makecell package.
    – leandriis
    Commented Oct 12, 2020 at 6:51
  • Thanks. It worked. Commented Oct 12, 2020 at 7:24

2 Answers 2

1

It’s easy peasy with tblr environment of tabularray package:

\documentclass{article}

\usepackage{tabularray}

\begin{document}

\begin{center}
\begin{tblr}{ ||c|c|c|| } 
 \hline
 \textbf{Embedding} & {BiLSTM\\+attn} & {BiLSTM+CNN\\+attn} \\
 \hline
 BERT & 89.9\% & 89.8\% \\
 \hline
 DistilBERT & 89.6\% & 90.8\%  \\ 
 \hline
 RoBERTa & \textbf{90.5}\% & \textbf{90.8\% } \\ 
 \hline
\end{tblr}
\end{center}

\end{document} 

enter image description here

1

You could just break the +attn into their own row.

\documentclass{article}

\begin{document}

\begin{center}
\begin{tabular}{ ||c|c|c|| } 
 \hline
 \textbf{Embedding} & {BiLSTM} & {BiLSTM+CNN} \\[-0.25ex]
                    &  +attn   &    +attn     \\
 \hline
 BERT & 89.9\% & 89.8\% \\
 \hline
 DistilBERT & 89.6\% & 90.8\%  \\ 
 \hline
 RoBERTa & \textbf{90.5}\% & \textbf{90.8\% } \\ 
 \hline
\end{tabular}
\end{center}

\end{document} 

Note that I added a small adjustment to pull the extra row up for better spacing.

enter image description here

You must log in to answer this question.

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