0

How to delete the horizontal space between the text and a line to write text on?

To clarify I'm referring to the space that comes after the ":" and that is before the line.

enter image description here

\documentclass{article}
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\noindent
\begin{center}
\begin{tabularx}{1\textwidth}{Yp{-20cm}Y}
name:&& name\\[-2ex]
&& \hrulefill \\[1ex]
 &&  \\[1ex]
 && 
\end{tabularx}
\end{center}

\end{document}

The above comes from adapting the last code from this answer https://tex.stackexchange.com/a/591858/

Thank you in advance.

1 Answers1

1

If I understand correctly, you are looking for something more like

enter image description here

\documentclass{article}
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{center}
\begin{tabularx}{\textwidth}{lY}
name:& name\\[-2ex]
& \hrulefill \\[1ex]
\end{tabularx}
\end{center}

\end{document}

David Carlisle
  • 757,742