I want to use some appropriate parameter inside a multicolumn command in order to draw a horizontal rule of the width of the column.
I tried \linewidthwithout success
In the example below, my objective is to draw a line between points A and D (ideally) or between B and C.
The column separator vertical bars are here only for showing column limits.
Thanks for yor help
Henri
\documentclass[a4paper]{book}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{15.5cm}{|X|c|X|c|X|c|X|c|X|}
\multicolumn{9}{c}{ {\bf Aaaaa}}
\
\multicolumn{9}{c}{ &{} {\bf Bbbbb}}
\
\multicolumn{9}{c}{\rule{0.5pt}{0.5cm}}
\
\multicolumn{1}{c}{A}&
\multicolumn{1}{l}{B}&
\multicolumn{5}{c}{}&
\multicolumn{1}{r}{C}&
\multicolumn{1}{c}{D}
\
\multicolumn{1}{r}{\rule{0.60cm}{0.5pt}}&
\multicolumn{7}{c}{\rule{8cm}{0.5pt}}& % this should be \linewidth
\multicolumn{1}{l}{\rule{0.60cm}{0.5pt}}
\
\multicolumn{1}{c}{\rule{0.5pt}{0.5cm}}&&
\multicolumn{1}{c}{\rule{0.5pt}{0.5cm}}&&
\multicolumn{1}{c}{\rule{0.5pt}{0.5cm}}&&
\multicolumn{1}{c}{\rule{0.5pt}{0.5cm}}&&
\multicolumn{1}{c}{\rule{0.5pt}{0.5cm}}
\
\begin{center}{\bf Ccccc xx}\end{center} & &
\begin{center}{\bf Ddddd}\end{center} & &
\begin{center}{\bf Eeeee\wider text ideally without hyphenation}\end{center} & &
\begin{center}{\bf Fffff xx}\end{center} & &
\begin{center}{\bf Ggggg}\end{center}
\
\end{tabularx}
\end{document}
\bfhas not been defined by default in latex for 30 years. You can fill a multicolumn c column using using\hrulefill– David Carlisle Jan 19 '24 at 13:53\bfany longer. And maybe you should use\centeringinstead of\begin{center}…\end{center}(and replace\\by\tabularnewlinewhere needed) or even add>{\centering}or>{\Centering}(last needs packageragged2e) before theX. – cabohah Jan 19 '24 at 13:54