I am really happy with the new wls (Wolfram Language Script) files. I somewhat abuse the file format, I use them instead of the regular Notebook files. The advantage is that they do not store the output. Therefore they are quick to save (you can even enable auto-save) and using git started to make sense. But then... I started to add some text-cells, which is fine for non-formatted text, but when using more advanced formatting (like Subscript) it goes wrong.

So to summarize my issue (also see image 1 and 2):

  1. Create .wls file
  2. Add some formatted text in a text-cell $s_{sub}$ (the same also occurs in a code-cell)
  3. Close and Re-open file and notice that you now see the non-formatted form Subscript[s, sub]

creating a new wls file After re-opening the formatting is gone

I don't think there is a neat solution for this, as this might be expected behavior. However I found it frustrating that I can create a new .wls file containing nice formatting, but once I close and re-open it the formatting is gone.

  • 2
    $\begingroup$ Open file -> Ctrl+A -> Ctrl+Shift+N $\endgroup$
    – Kuba
    Commented Nov 16, 2017 at 14:22
  • $\begingroup$ That works great! Would it also be possible to set this in the options of the file? So you do not have to do this each time? $\endgroup$ Commented Nov 16, 2017 at 14:25
  • $\begingroup$ As .wls file do not save options, that's not a good idea. But would it be possible to edit the default settings for wls files? $\endgroup$ Commented Nov 16, 2017 at 14:31
  • $\begingroup$ Don't have time for a proper answer but you can set CurrentValue[EvaluationNotebook[],"DefaultScriptStyleDefinitions"] to a custom file which will inherit from "Script.nb" and with custom NotebookDynamicExpression which deletes itself after doing this change. $\endgroup$
    – Kuba
    Commented Nov 16, 2017 at 14:31
  • $\begingroup$ Also the Ctrl+A->Ctrl+Shift+N method does not work for text cells $\endgroup$ Commented Nov 16, 2017 at 15:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.