3

MWE:

\documentclass[12pt]{book}
\usepackage{lineno}
\begin{document}

\chapter{Hidden Line Number}\label{cha:hln}
\linenumbers
%\begin{nolinenumbers}
One

Two\linelabel{two}\label{two}

Three

The sentence about \textbf{two}, page-\pageref{two}, chapter-\ref{cha:hln}, line number-\lineref{two}

%\end{nolinenumbers}
\end{document}

That I want what to do, hide linenumbers. If it possible?

enter image description here

5
  • \nolinenumbers at the right place switches them off , \linenumbers will reenable them
    – user31729
    Mar 1 '15 at 11:52
  • Add to \nolinenumbers -- Package lineno Error: \linelabel without \linenumbers
    – Özgür
    Mar 1 '15 at 11:58
  • Of course, you can't use a \linelabel when there is no linenumber ;-)
    – user31729
    Mar 1 '15 at 11:59
  • Never end a paragraph with \\ all the \\ in your document are incorrect (and LaTeX gets very unhappy: Underfull \hbox (badness 10000) in paragraph at lines 8--9 badness 10000 is as bad as it gets Mar 1 '15 at 12:08
  • @DavidCarlisle, Ok.
    – Özgür
    Mar 1 '15 at 12:18
5

enter image description here

\documentclass[12pt]{book}
\usepackage{lineno}
\begin{document}

\chapter{Hidden Line Number}\label{cha:hln}
\linenumbers
%\begin{nolinenumbers}
\let\makeLineNumber\relax
One

Two\linelabel{twol}\label{two}

Three

The sentence about \textbf{two}, page-\pageref{two}, chapter-\ref{cha:hln}, line number-\lineref{twol}

%\end{nolinenumbers}
\end{document}
3
  • Is the viewer of this document expected to count the line number himself then? ;-) (Ok, it's only in line number 2, so this should be possible ;-))
    – user31729
    Mar 1 '15 at 12:16
  • +1, but it's probably safer to save the meaning of \makeLineNumber for later use. Mar 1 '15 at 12:19
  • @karlkoeller I assume the real example it's inside a group:-) Mar 1 '15 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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