I am the author of the question: Problem with a table with special header: bolded numbers are badly aligned with the rest of the numbers
Following Zarko's advise, I have revised my code according to his suggestion to get my bolded number aligned in the right way. However, a new problem is popping up. I am making another post because I can't share the updated version of my code in my previous post.
I am trying to make a table with special header.
I tried the following code:
\documentclass[11pt,a4paper]{article}
\usepackage[hyperref]{NAACL2019}
\usepackage[skip=1ex,font=small]{caption}
\usepackage{times}
\usepackage{url}
\usepackage{latexsym}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{sectsty}
\usepackage{amssymb}
\usepackage{makecell}
\usepackage{multirow}
\usepackage{amsmath,epsfig,times}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{etoolbox}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{siunitx} % <---
\usepackage{etoolbox} % <---
\newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}\bfseries} % <===
\usepackage{hyperref} % load this package last
\begin{table}[ht]
\sisetup{detect-weight, mode=text, table-format=1.4}
\centering
\begin{tabular}{l SS
S[table-format=-1.2]
S[table-format=1.2] }
\toprule
& \multicolumn{2}{c}{M1}
& \multicolumn{2}{c}{M2} \
\cmidrule(lr){2-3} \cmidrule(l){4-5}
& {1-2} & {7-8} & {1-2} & {7-8} \
\midrule
A & \B{0.0021} & \B{0.0033} & -2.37 & 0.00 \
B & \B{0.0052} & \B{0.0042} & -1.23 & 0.67 \
C & 0.0960 & \B{0.0054} & -0.62 & 1.10 \
D & \B{0.0082} & \B{0.0057} & -0.21 & 1.08 \
E & 0.0107 & 0.0097 & 0.74 & 1.41 \
F & \B{0.0080} & 0.0088 & 5.05 & 5.05 \
G & 0.0140 & 0.0148 & -2.37 & 0.00 \
H & 0.0128 & 0.0176 & -1.23 & 0.67 \
I & 0.0157 & 0.0164 & -0.62 & 1.10 \
J & 0.0145 & 0.0155 & -0.21 & 1.08 \
K & 0.0205 & 0.0209 & 0.74 & 1.41 \
L & 0.0236 & 0.0225 & 5.05 & 5.05 \
\bottomrule
\end{tabular}%}
\smallskip
\caption{My Caption}
\label{tab:table1}
\end{table}
But it gives the following result:
The problem here is that there is [rm]bfb right before each bolded number, which I want to remove.
How can I resolve this issue?
PS: For my LaTeX document, I am using this specific template for a particular academic conference: https://www.overleaf.com/latex/templates/instructions-for-naacl-hlt-2019-proceedings/xyyfwfkswhth
This conference template is 2-columned, that is, the texts are displayed on each page in 2 columns.
Thank you,


hyperrefis the last package in your preamble (There are only a few exceptions, that should be loaded after it.) – leandriis Oct 24 '20 at 13:21&throughout the whole table. To fix this, replace all occurences of two subsequent&by a single&. – leandriis Oct 24 '20 at 13:25&in the table, because I am using\multicolumn. The extra&are meant to be there. – chico0913 Oct 24 '20 at 13:30\begin{tabular}{l SS S[table-format=-1.2]S[table-format=1.2]}you declare a total of 5 columns, while a line such asG & 0.0140 & 0.0148 & & -2.37 & 0.00 \\uses a total of 6 column. Thus replace& &with a single&. – leandriis Oct 24 '20 at 13:32hyperrefon the end of preamble) and remove curly braces around numeral marked by\B(this was not done in my answer https://tex.stackexchange.com/questions/568080/problem-with-a-table-with-special-header-bolded-numbers-are-badly-aligned-with/568085#568085 !) I'm not able to reproduce your problem. You should be careful using my solution/suggestion ... – Zarko Oct 24 '20 at 14:19