In the following MWE, I use the siunitx package to align numerical entries in a table. How can I place a \sim symbol before the "6" without upsetting the alignment? Table A will compile; Table B will not.
\documentclass[oneside,11pt]{book}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[
expansion = false ,
tracking = smallcaps ,
letterspace = 40 ,
final
]{microtype}
\usepackage[font={sf,small},labelsep=quad,labelfont=sc]{caption}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
% A
\begin{table}[!h]
\centering
\begin{tabular}{
l
S[table-format=1.1,table-number-alignment=left,table-align-text-post=false]
}
\toprule
& {X}\
\midrule
A & 6\
B & 0.1\
\bottomrule
\end{tabular}
\caption{A}
\end{table}
% B
\begin{table}[!h]
\centering
\begin{tabular}{
l
S[table-format=1.1,table-number-alignment=left,table-align-text-post=false]
}
\toprule
& {X}\
\midrule
A & \sim 6\
B & 0.1\
\bottomrule
\end{tabular}
\caption{B}
\end{table}
\end{document}




