Naming conventions for mathematica notebooks. Are any characters forbidden (e.g. !@#$%^&*()-+)? Can they begin with numbers ?

  • 2
    $\begingroup$ Are any characters forbidden This is a property of the operating system itself and not Mathematica. If the OS does not allow you to name a file with some characters, then you will not be able to name the notebook that way. Check your OS requirements for file names. $\endgroup$
    – Nasser
    Dec 16, 2022 at 20:15
  • $\begingroup$ As far as I know, the possible names are only limited by your operating system/file system, Mathematica doesn't impose any additional restrictions $\endgroup$
    – Lukas Lang
    Dec 16, 2022 at 20:15
  • $\begingroup$ Nasser, Lukas Lang -- thanks. I spent a lot of time trying to find this information in Mathematica itself. I know that mathematica functions begin with capital letters and that to avoid trouble make your variables begin lower case. Are there characters to avoid in variable names? $\endgroup$ Dec 16, 2022 at 20:38
  • $\begingroup$ You get a syntax error if you try to use a non valid name so I do not see anything to avoid that would not lead to an error directly upon evaluation. Note that unicode characters such as greek letters and so on do not show as nice symbols outside of the Mathematica notebook but as symbols like \[Delta]. Typically you would not write code outside of Mathematica unless you prefer to use an IDE for package development so that might not be much of a concern. $\endgroup$ Dec 17, 2022 at 0:11
  • $\begingroup$ In any case having symbols like \[Delta] in the code outside of Mathematica is a matter of esthetics rather than functionality at least in my experience $\endgroup$ Dec 17, 2022 at 0:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.