TeX/inputlineno

From Wikibooks, open books for an open world
< TeX
Jump to: navigation, search

Synopsis[edit]

\inputlineno

Description[edit]

\inputlineno is an integer parameter that TeX sets to the current line number of the input file.

Examples[edit]

Recall that the command \number will typeset the decimal representation of whatever follows it, and so if the source file begins with

\number\inputlineno

on the first line, then TeX will typeset 1 at the beginning of the page.

If

\message{\number\inputlineno}

occurs on line n of the source file, then TeX will output 'n' to the screen as a message.