# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Explore the low-level structure of Wolfram Language expressions with an easy-to-read concise representation

Contributed by:
Alexey Popkov

ResourceFunction["ShortInputForm"][ produces terse version of |

ResourceFunction["ShortInputForm"] is intended for use within the Notebook interface.

ResourceFunction["ShortInputForm"][*expr*] produces a two-dimensional representation of *expr*, which may be immediately used as input.

Compound-type atomic objects like Image, Graph or NumericArray are kept untouched when they are present as a part of the supplied expression. Such objects can be converted into the corresponding input expressions by applying ResourceFunction["ShortInputForm"] to them directly.

ResourceFunction["ShortInputForm"][*expr*, Unevaluated] converts most compound-type atomic objects in *expr* into shortened input expressions. Compact low-level data representations like NumericArray and ByteArray are still kept untouched. They can also be converted by applying ResourceFunction["ShortInputForm"] to them directly.

For Graphics and Graphics3D objects, ResourceFunction["ShortInputForm"] removes duplicate options and sorts the options list.

Display the structure of a Graph expression's input form:

In[1]:= |

Out[1]= |

Explore the low-level structure of a graphics object produced by Plot. Try selecting subexpressions with the mouse, navigating with keyboard shortcuts, copying and editing code:

In[2]:= |

Out[2]= |

Copy a subexpression from above and use it in Graphics:

In[3]:= |

Out[3]= |

Compare the internal structure of similar objects generated in different ways:

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

Check the result of applying Normal to a graphics object:

In[6]:= |

Out[8]= |

In[9]:= |

Out[9]= |

InputForm always produces a one-dimensional representation of the expression in the form of pure text, suitable to be typed as Wolfram Language input via text-based interface. Within the notebook interface, semantic selection and code highlighting aren't available with InputForm expressions:

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

ShortInputForm produces shortened two-dimensional output, suitable to be used as input within the notebook interface. Semantic selection and code highlighting are turned on by default:

In[12]:= |

Out[12]= |

Special forms like NumericArray by default are kept untouched for readability, but can also be converted by applying ShortInputForm to them separately:

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |

Such forms usually can be converted to normal expressions by applying Normal:

In[15]:= |

Out[15]= |

By default ShortInputForm[*expr*] keeps untouched compound-type atomic objects when they are part of the supplied expression:

In[16]:= |

Out[17]= |

In[18]:= |

Out[18]= |

Use ShortInputForm[*expr*, Unevaluated] to convert most of them into actual input expressions revealing their low-level structure:

In[19]:= |

Out[19]= |

Alternatively, apply ShortInputForm to the atomic objects directly:

In[20]:= |

Out[20]= |

Explore box structures generated by ToBoxes taking advantage of the easy-to-read representation generated by ShortInputForm:

In[21]:= |

Out[21]= |

Create an auxiliary function that exports a supplied expression to "PDF" and then immediately imports the results as vector graphics:

In[22]:= |

Out[22]= |

Inspect the internal contents of returned graphics with ShortInputForm:

In[23]:= |

Out[24]= |

In[25]:= |

Out[25]= |

- Where can I get detailed information on how the Plot command works? – Mathematica StackExchange
- How to extract parts from atomic expressions like DelaunayMesh and Graph? – Mathematica StackExchange
- How to simplify list of Graphics options? – Mathematica StackExchange
- What is the purpose of StrokeForm? – Mathematica StackExchange

This work is licensed under a Creative Commons Attribution 4.0 International License