答案1
\documentclass[12pt, a4paper]{article}
\begin{document}
I want them on the same row, side by side.
\vspace{0.5cm}
\begin{minipage}[t]{0.05\textwidth}
\line(1,0){50}\\
\end{minipage}
\hfill
\begin{minipage}[t]{0.55\textwidth}
\line(1,0){250}\\
\end{minipage}
\end{document}
编辑--粗体行
\documentclass[12pt, a4paper]{article}
\begin{document}
I want them on the same row, side by side.
\vspace{0.5cm}
\begin{minipage}[t]{0.05\textwidth}
\linethickness{2pt}\line(1,0){40}\\
\end{minipage}
\hfill
\begin{minipage}[t]{0.55\textwidth}
\linethickness{2pt}\line(1,0){250}\\
\end{minipage}
\end{document}
第二种方法
\documentclass[12pt, a4paper]{article}
\begin{document}
\setlength{\unitlength}{.4in}
\begin{picture}(7,5)(0,0)
\linethickness{2pt}
\put(0,0){\line(1,0){1}}
\put(5,0){\line(1,0){10}}
\end{picture}
\end{document}
答案2
无可否认,这比 LaTeX 更像 TeX,但是:
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\vrule width 1cm height 4pt depth -1pt\hspace*{4cm}\vrule width 6cm height 4pt depth -1pt\relax
% you can play with height and depth for the position with respect
% to the baseline and the thickness
See the baseline: \vrule width 1cm height 4pt depth -1pt\hspace*{2cm}p\vrule width 5cm height 4pt depth -1pt\relax
See the baseline: \vrule width 1cm height 1pt depth 1pt\hspace*{2cm}p\vrule width 5cm height 1pt depth 1pt\relax
\end{document}