Adding line number with no period (e.g. 1, 2, 3 instead of 1., 2., 3., )

I want to add a line number to the corresponding line of texts (programming code) in Apple Pages. See attached image for the result I want. The number format, however, would have a period at the end of each number. Is it possible to remove this period? Appreciate the help. Thanks

MacBook Pro 13″, macOS 10.15

Posted on Mar 29, 2023 05:51 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 29, 2023 07:19 AM

Pages was never designed to be a code editor with builtin line numbering, or syntax identification.


Pages, unlike MS Word, or LibreOffice Writer, does not offer a line numbering feature for body text. Although you can tell Pages to automatically identify a list entry (e.g. 1, 2,) you must enter each list line manually.


You can use the Terminal UNIX command nl to place line numbers on a clipboard instance of your Swift code which you can paste into Pages, though it will be monochrome:


man nl
nl -ba foo.swift | pbcopy


Unless you use really small font size, the line wrapping in Pages will disrupt the line numbering appearance:








6 replies
Question marked as Top-ranking reply

Mar 29, 2023 07:19 AM in response to newt_py

Pages was never designed to be a code editor with builtin line numbering, or syntax identification.


Pages, unlike MS Word, or LibreOffice Writer, does not offer a line numbering feature for body text. Although you can tell Pages to automatically identify a list entry (e.g. 1, 2,) you must enter each list line manually.


You can use the Terminal UNIX command nl to place line numbers on a clipboard instance of your Swift code which you can paste into Pages, though it will be monochrome:


man nl
nl -ba foo.swift | pbcopy


Unless you use really small font size, the line wrapping in Pages will disrupt the line numbering appearance:








This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Adding line number with no period (e.g. 1, 2, 3 instead of 1., 2., 3., )

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.