I want to refer to line numbers in code which I have in my appendix. Each piece of code is in its own section where line numbers begin from 1.
I want to be able to write something like;
"With reference to line
23 in code snippet
If I add or remove lines above the text being referenced or if I change the margins or font size such that wrapping causes lines to be created or destroyed, then I want the line number reference to update just like a numbered item reference would update if the chapter numbers change.
What I've tried so far:
- I checked in the cross-references section of Word 2013 but wasn't able to find a line number reference type. Can I create such a reference type?
- I tried simply selecting the entire code section and turning it into a numbered list, which I could then reference, but that bungles on line wrapping and indented code. Also it would be a bit of work setting up the styles and it would be much cleaner to use Word's built-in line numbering tool.