Is there such a thing in Mathematica; something like line numbers in Notepad++?

Thanks.

  • 7
    " Okey, Now please answer my question!" sounds like an extremely rude way to address someone who is welcoming you – Dr. belisarius Jan 30 '15 at 18:41
  • 1
    I'm sorry. I didn't mean to offend anybody, I'm here just to get an answer and maybe solve the same question of future visitors. – Qaher Jan 30 '15 at 18:49
  • 2
    there is no line numbers in the notebook, but you can get lines numbers in workbench., screen shot: !Mathematica graphics and also you can get lines numbers if you use the IntelliJIDEA Plugin for Mathematica editor by Halirutan. see open-source-intellijidea-plugin-to-support-mathematica-development for links and where to download – Nasser Jan 30 '15 at 19:24
  • 2
    For packages, where potential error messages include line numbers, you can open the files in any text editor because they are plain text files. I know, it's just a workaround, but it helped me finding the typo in my script. – Felix Dec 1 '16 at 15:52

In .nb (notebook) files there is no such thing as a line number, at least not in the standard Mathematica FrontEnd. However, there really should be. Why? Because it would be so much easier for us poor programmers who unfortunately cannot program all relevant lengthy code in normal .m packages (because a customer sometimes actually does want to use the FrontEnd, for understandable reasons like documentability), and with line numbers it would be easier to document code, since with the standard (* *) type comments one cannot do it problem-free.

Go to Preferences->Evaluation and click the line that says: Show In/Out Names. It's not exactly the same as line numbers -- rather, it's cell numbering but can serve some of the same functions.

  • Thanks, but I knew that, what I'm looking for is something like C-source codes line numbering in editors. Is there a way add it manually? – Qaher Jan 30 '15 at 19:01

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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