
答案1
你當然不需要任何 tikz 魔法。這在純 TeX 是可能的
Some text\leaders\hrule height 3.4pt depth -3pt\hskip 2cm some other text
也可以看看垂直居中的水平線填滿一行的其餘部分?
您可以定義自己的命令,例如如下
\def\centerrule{%
\dimen0=-.4ex
\advance\dimen0 by 0.4pt
\leaders\hrule height.4ex depth\dimen0\hskip
}
然後你可以寫
Some text\centerrule 2cm some other text %the line is 2cm long
Some text\centerrule 0cm plus 1fill some other text %the line stretches to
%fill the whole line