Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command completion in mathematica : suggest rules/options

In current version of Mathematica these keyboard shortcuts are quite handy

Ctrl+K completes current command

GraphPl -> press Ctrl+K  -> GraphPlot

Ctrl+Shift+K completes current command and adds argument placeholders which could be replaced with actual values with tab key

GraphPl -> press Ctrl+Shift+K  ->  GraphPlot[{vi1->vj1,vi2->vj2,...}]

However I couldn't find any keyboard option to show associated settings/options

For instance Say If I need to plot a graph with different layouts, I know I need to set Method with one of these Possible settings

  • "CircularEmbedding"
  • "RandomEmbedding"
  • "HighDimensionalEmbedding"
  • "RadialDrawing"
  • "SpringEmbedding"
  • "SpringElectricalEmbedding"

Two things

First How to autocomplete these options , is there any shortcut key ?

GraphPlot[sg, Method -> <what keyboard shortcut to display all possible options>]

Second how to generate following PopupMenu list programmatically

  list={
   "CircularEmbedding"
   , "RandomEmbedding"
   , "HighDimensionalEmbedding"
   , "RadialDrawing"
   , "SpringEmbedding"
   , "SpringElectricalEmbedding"
   }
Manipulate[GraphPlot[sg, Method -> m], {m, list}, ControlType -> PopupMenu]

Is there any way to introspect Mathematica functions and access method Metadata similar to the way it could be done in other programming languages, Like using reflection in Java ?

like image 897
Prashant Bhate Avatar asked Dec 24 '11 15:12

Prashant Bhate


1 Answers

I don't believe there is any included function to auto-complete a string. I also cannot recall a way to view all valid settings for a particular option, other than searching the help files.

You can expedite input with the Options Inspector settings InputAliases and InputAutoReplacements, allowing entry by EsctxtEsc or txtSpace.

like image 194
Mr.Wizard Avatar answered Nov 14 '22 23:11

Mr.Wizard