# How to produce structure as in attached image

I remember seeing similar question (image wise) here on this forum but did not bookmark it :(

If anyone knows and can point me to the example or give me some ideas to get started would be great help. I am working on reproducing an old book which has around 4000 linesas shown in the attached image.

Text on each line is called "Sutra". Number on the left is a unique serial number. Some sutras have a number on the right, which means part or whole text that sutra is to be added to the sutra number shown on the right.

The part which gets transferred to below sutra should be shown as bold or colored. Sometimes its part and sometimes its the whole sutra that gets transferred as can be see in "6"

I also would like to show the text thats getting transferred to the sutra below on across the left line in scriptsize text.

In the shown example the span is limited to 3 sutras however in the later part it can span across ~100 sutras - in such cases the left line should spread across pages. the flow of words is always downwards, there will not be any case where the text flows upwards.

PS: numbers in front of Sutra 11 - 12, 19, please do change the question title that make more sense than what I have given.

Perhpas the tkz-linknodes package can be useful for your purpose; here's a little schematic example:

\documentclass{article}
\usepackage{graphicx}

\tikzset{ArrowStyle/.style={text=black,shorten >= 15pt,shorten <= 15pt}}
\tikzset{LabelStyle/.style={pos=0.25,right,font=\scriptsize}}
\tikzset{NodeStyle/.style={inner sep=0pt}}

\begin{document}

\begin{enumerate}
\begin{NodesList}[margin=15cm]
\item Fourth item.
\item Fifth item.
\end{NodesList}
\end{enumerate}

\end{document}

\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{hyperref}
\usepackage{lipsum}

\titleformat{\section}
{}{}{1em}{}

\begin{document}

\tableofcontents

\section{Test Section One}
\lipsum[1-10]
\section{Test Section Two}
\lipsum[1-10]

\end{document}