在两个标签之间画一条线

在两个标签之间画一条线

我正在寻找一种方法在文本中的点(标签)之间画一条线,如下所示: 在此处输入图片描述

\documentclass{article}
\begin{document}

Cordially convinced did incommode existence put \label{start}out suffering certainly. Besides another and saw ferrars limited ten say unknown. On at tolerably depending do perceived. Luckily eat joy see own shyness minuter. So before remark at depart. Did son unreserved themselves indulgence its. Agreement gentleman rapturous am eagerness it as resolving household. Direct wicket little of talked lasted formed or it. Sweetness consulted may prevailed for bed out sincerity. 

Unwilling sportsmen he in questions september therefore described so. Attacks may set few believe moments was. Reasonably how possession shy way introduced age inquietude. Missed he engage no exeter of. Still tried means we aware\label{end} order among on. Eldest father can design tastes did joy settle. Roused future he ye an marked. Arose mr rapid in so vexed words. Gay welcome led add lasting chiefly say looking. 

\end{document}

这有可能吗?可以用 tikz 完成吗?

答案1

我完全同意 Sergei Golovan 的观点,这tikzmark是最简单的方法。不过,我想说的是\tikzmarknode,这个不错的库的最新版本中的 让事情变得更加简单。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}

Cordially convinced did incommode existence \tikzmarknode{put}{put} out
suffering certainly. Besides another and saw ferrars limited ten say
unknown. On at tolerably depending do perceived. Luckily eat joy see own
shyness minuter. So before remark at depart. Did son unreserved themselves
indulgence its. Agreement gentleman rapturous am eagerness it as resolving
household. Direct wicket little of talked lasted formed or it. Sweetness
consulted may prevailed for bed out sincerity. 

Unwilling sportsmen he in questions september therefore described so.
Attacks may set few believe moments was. Reasonably how possession shy way
introduced age inquietude. Missed he engage no exeter of. Still tried means
we aware \tikzmarknode{order}{order} among on. Eldest father can design tastes did
joy settle. Roused future he ye an marked. Arose mr rapid in so vexed
words. Gay welcome led add lasting chiefly say looking. 

\begin{tikzpicture}[remember picture]
  \draw[overlay,red,very thick] (put.east) -- (order.south west);
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

您可以使用tikz及其tikzmark库来实现这一点。以下代码需要两次 LaTeX 传递。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}

Cordially convinced did incommode existence put\tikzmark{start} out
suffering certainly. Besides another and saw ferrars limited ten say
unknown. On at tolerably depending do perceived. Luckily eat joy see own
shyness minuter. So before remark at depart. Did son unreserved themselves
indulgence its. Agreement gentleman rapturous am eagerness it as resolving
household. Direct wicket little of talked lasted formed or it. Sweetness
consulted may prevailed for bed out sincerity. 

Unwilling sportsmen he in questions september therefore described so.
Attacks may set few believe moments was. Reasonably how possession shy way
introduced age inquietude. Missed he engage no exeter of. Still tried means
we aware \tikzmark{end}order among on. Eldest father can design tastes did
joy settle. Roused future he ye an marked. Arose mr rapid in so vexed
words. Gay welcome led add lasting chiefly say looking. 

\begin{tikzpicture}[remember picture]
  \draw[overlay,red,very thick] (pic cs:start) -- (pic cs:end);
\end{tikzpicture}

\end{document}

结果:

在此处输入图片描述

相关内容