# linegoal – A "dimen" that returns the space left on the line

The line­goal pack­age pro­vides a macro \line­goal to be used with \setlength:\setlength\line­goal will set to the hor­i­zon­tal length of the re­main­der of the line.
This is achieved us­ing the \pdf­save­pos prim­i­tive of pdf­tex, through the zref-save­pos pack­age.
Ex­am­ple: Some text: \be­gin{tab­u­larx}\line­goal{|l|X|} \hline one & two \\ three & four \\\hline \end{tabularx} will position the table after the initial text, and make the table fill the rest of the line.

CTAN path/macros/latex/contrib/linegoal