I am looking for a way to draw a line between points (labels) in a text, like this: enter image description here

\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}

Is this possible at all? Can this maybe done with tikz?

I fully agree with Sergei Golovan that tikzmark is the easiest way to go. However, I would like to argue that \tikzmarknode, which is in the latest version(s) of this nice library, makes things even more straightforward.

\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}

enter image description here

You can use tikz and its tikzmark library to do that. The code below requires two LaTeX passes.

\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}

The result:

enter image description here

  • Drawing the line work's perfectly! Is there a way to start at the top of the line? – ingoboerner Nov 9 at 12:03
  • Just put the tikzmark into a raised box: \raisebox{1ex}{\tikzmark{start}}. – Sergei Golovan Nov 9 at 12:19

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.