I'm trying to automate the command \linelabel in a way that it could create its own label name. Here is a MWE:
\documentclass{article}
\usepackage[modulo]{lineno}
\newcounter{countone}
\newcounter{counttwo}
\newcommand{\markline}{\stepcounter{countone}\linelabel{liner\thecountone}}
\newcommand{\refline}{\stepcounter{counttwo}\ref{liner\thecounttwo}}
\begin{document}
\begin{linenumbers}
``Hello, here is some\markline text without a meaning.\\
This text\markline should show, how a printed text will\\
look like at this place. If you read\markline this text, you will get\\
no information. Really\markline? Is there no information?\\
Is there a difference\markline between this text and some\\
nonsense like ``Huardest gefburn''? Kjift – Never mind\markline!''
\end{linenumbers}
Here, I have the marked lines: \refline, \refline, \refline, \refline and \refline.
\end{document}
In my thinking, those scattered \markline over the text would be \linelabel{liner1}, \linelabel{liner2}, \linelabel{liner3}, etc. And then, when I call \refline it would call the label accordingly. What am I doing wrong? Sometimes, depending on where I put the command \markline, it works.


