mathematica-frontend

Context unique to each group at a specified level

戏子无情 提交于 2019-11-30 14:33:00
Recent versions of Mathematica provide the option of having a unique $Context for each cell group, via: Evaluation > Notebook's Default Context > Unique to Each Cell Group This is an appealing concept, but I find it unusable, as my code spans multiple cell groups. I would like a way to specify a unique context for cell groups of a certain level such as every Section , but not a separate context for every Subsection or Subsubsection . A solution will need to affect new cell groups as they are created. You should be able to do this by modifying your notebook's stylesheet. You can use the option

mathematica start front end and eval notebook from command line

╄→尐↘猪︶ㄣ 提交于 2019-11-30 12:38:18
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m'' for example) Thanks. The first answer looks promising, however I get FrontEndObject::notavail A front end is not available (per docs it is "UseFrontEnd" by the way.) Perhaps a path issue, however even after setting $FrontEndLaunchCommand no joy.. Re: Initialization Cell -- that

Keyboard shortcut to Un/Comment out code in Mathematica 7?

雨燕双飞 提交于 2019-11-30 12:13:03
问题 A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE's for languages like Java, .Net. I find it a very useful technique when experimenting through trial and error to temporarily comment out and uncomment lines, words and parts of the code to find out what is and isn't working. I cannot find any such keyboard shortcut on the Mathematica front end in version 7. I know that it is possible to comment out code by selecting the code, right mouse click and

Known issues with copying code from Mathematica to other platforms?

假装没事ソ 提交于 2019-11-30 09:00:20
I just noticed that if you have this in MMA (8.0.1 / win7-64): and you copy it to SO (just ctrl-c ctrl-v), you get this: (maxY - minY)/stepy/(maxX - minX)/stepx which is not mathematically equivalent . It should be this: ((maxY - minY)/stepy)/((maxX - minX)/stepx) or this (the InputForm of the above): ((maxY - minY)*stepx)/((maxX - minX)*stepy) It's not caused by StackOverflow's internals as the same happens with a copy to NotePad. Are there more issues like this (especially when working with SO, but also in general) that we should be aware of? What causes this, can it be fixed on our side,

Convenient way to add inline formatting to usage Messages

随声附和 提交于 2019-11-30 04:48:29
问题 Usage Messages of built-in functions have embedded in-line formatting. For example: In[1]:= ActionMenu::usage // FullForm Out[1]//FullForm= "\!\(\*RowBox[{\"ActionMenu\", \"[\", RowBox[{StyleBox[\"name\", \"TI\ \"], \",\", RowBox[{\"{\", \ RowBox[{RowBox[{SubscriptBox[StyleBox[\"lbl\", \"TI\"], \ StyleBox[\"1\", \"TR\"]], \":>\", SubscriptBox[StyleBox[\"act\", \"TI\ \"], StyleBox[\"1\", \"TR\"]]}], \",\", \ RowBox[{SubscriptBox[StyleBox[\"lbl\", \"TI\"], StyleBox[\"2\", \ \"TR\"]], \":>\",

Keyboard shortcut to Un/Comment out code in Mathematica 7?

走远了吗. 提交于 2019-11-30 02:11:28
A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE's for languages like Java, .Net. I find it a very useful technique when experimenting through trial and error to temporarily comment out and uncomment lines, words and parts of the code to find out what is and isn't working. I cannot find any such keyboard shortcut on the Mathematica front end in version 7. I know that it is possible to comment out code by selecting the code, right mouse click and select Un/Comment from the menu that appears but this is too slow while coding. I tried to access this

Known issues with copying code from Mathematica to other platforms?

可紊 提交于 2019-11-29 12:57:34
问题 I just noticed that if you have this in MMA (8.0.1 / win7-64): and you copy it to SO (just ctrl-c ctrl-v), you get this: (maxY - minY)/stepy/(maxX - minX)/stepx which is not mathematically equivalent . It should be this: ((maxY - minY)/stepy)/((maxX - minX)/stepx) or this (the InputForm of the above): ((maxY - minY)*stepx)/((maxX - minX)*stepy) It's not caused by StackOverflow's internals as the same happens with a copy to NotePad. Are there more issues like this (especially when working with

Uncaught Throw generated by JLink or UseFrontEnd

*爱你&永不变心* 提交于 2019-11-29 07:33:58
This example routine generates two Throw::nocatch warning messages in the kernel window. Can they be handled somehow? The example consists of this code in a file "test.m" created in C:\Temp: Needs["JLink`"]; $FrontEndLaunchCommand = "Mathematica.exe"; UseFrontEnd[NotebookWrite[CreateDocument[], "Testing"]]; Then these commands pasted and run at the Windows Command Prompt: PATH = C:\Program Files\Wolfram Research\Mathematica\8.0\;%PATH% start MathKernel -noprompt -initfile "C:\Temp\test.m" Addendum The reason for using UseFrontEnd as opposed to UsingFrontEnd is that an interactive front end may

Uncaught Throw generated by JLink or UseFrontEnd

假装没事ソ 提交于 2019-11-28 01:13:05
问题 This example routine generates two Throw::nocatch warning messages in the kernel window. Can they be handled somehow? The example consists of this code in a file "test.m" created in C:\Temp: Needs["JLink`"]; $FrontEndLaunchCommand = "Mathematica.exe"; UseFrontEnd[NotebookWrite[CreateDocument[], "Testing"]]; Then these commands pasted and run at the Windows Command Prompt: PATH = C:\Program Files\Wolfram Research\Mathematica\8.0\;%PATH% start MathKernel -noprompt -initfile "C:\Temp\test.m"

SaveDefinitions considered dangerous

懵懂的女人 提交于 2019-11-27 18:24:13
SaveDefinitions is a nice option of Manipulate . It causes Manipulate to store any definitions used for its creation inside the Manipulate panel. A Manipulate made this way can be copied to an empty notebook and will still work on its own. Additionally, your working notebook containing many such Manipulates also doesn't turn into a flurry of pink boxes with printed error messages below it upon opening. Great! However, all this goodness has its dark side which can bite you real hard if you are not aware of it. I've had this in a notebook I had been working on for a few days, but I present you