Skip to main content
23 votes
Accepted

Shell Emulation inside Mathematica

First of all, I agree, as OP mentioned in his comment, ANTLR is one of the proper ways to go. Now for this specific task, it might be easier to just compose a parser in the "dirty" way, except we don'...
Silvia's user avatar
  • 27.6k
22 votes

What are "\<" and "\>" delimiters in box expressions?

This syntax was deprecated in the version 6.0 era. According to the legacy documentation, For example, in version 5.2, the following strings are interpreted differently ...
ilian's user avatar
  • 25.5k
21 votes
Accepted

How do I get the timing of an evaluation after it has already finished?

The case when the evaluation is finished Some of my calculations take hours or even days, so I don't want to restart the entire evaluation just to add Timing[] to ...
Alexey Popkov's user avatar
17 votes
Accepted

How can I clean up a notebook?

Update I have incorporated Kuba's improvement into the code. Here is how I would do it. In a working notebook (not the target notebook) put the following code. ...
m_goldberg's user avatar
  • 108k
17 votes
Accepted

ShowGroupOpener's behavior change in 11.3

TL;DR; To set ShowGroupOpener on a global level, previously done by CurrentValue[$FrontEnd, ShowGroupOpener] = True, now use: <...
Kuba's user avatar
  • 137k
15 votes

How do I get the timing of an evaluation after it has already finished?

Evaluate SetOptions[$FrontEnd, EvaluationCompletionAction -> "ShowTiming"] and then the evaluation time for the last evaluation will be shown in the ...
Jason B.'s user avatar
  • 68.4k
13 votes

How to decorate cells with widgets like jupyter and collab?

Here's a first attempt: ...
Lukas Lang's user avatar
12 votes

How can I clean up a notebook?

Another possibility is to modify the notebooks style sheet by defining a new "Screen Environment" that hides cell brackets and closes input cells: ...
Carl Woll's user avatar
  • 131k
12 votes
Accepted

Delete all output in notebooks

Print and Message and so on are generated cells, like the output from evaluating input. This, from the docs for ...
Mike Honeychurch's user avatar
12 votes
Accepted

How to open a Python interpreter input cell?

Type > at the start of a cell (or when between cells). This is documented in an example on ref/ExternalEvaluate (last Basic Example). I'm a bit suprised it's not in the details section. It probably ...
Itai Seggev's user avatar
  • 14.1k
11 votes
Accepted

Run several input cells in parallel

You don't have to write all your code within ParallelSubmit. You can wrap your code in Module or ...
MarcoB's user avatar
  • 67.3k
11 votes

Select Only Printed Out Cells

Here is a quick way of doing it: NotebookFind[nb = EvaluationNotebook[], "Print", All, CellStyle]; CreateDocument[NotebookRead[nb]]
Mike Honeychurch's user avatar
11 votes
Accepted

Is there a way to obtain the time when an input was executed in a notebook?

Update It turns out that there is a much simpler method than my previous answer. If you need the actual cell label value, than I think messing around with the ...
Carl Woll's user avatar
  • 131k
11 votes
Accepted

New input cell style with a custom evaluator

You can use StyleKeyMapping to easily switch back and forth from "Input" cells to your "CustomInput" cell. For example: ...
Carl Woll's user avatar
  • 131k
11 votes
Accepted

A way to contract input in Mathematica

From comments, these are the two options Use cell/open/close Use Iconize, as suggested by Carl Lange, which I think is a better option, since you still see the LHS of the assignment and so know what ...
11 votes
Accepted

Stretching a mesh

...
kglr's user avatar
  • 396k
10 votes

What are "\<" and "\>" delimiters in box expressions?

Summary of the all available information In the hoarier days space-like characters (spaces, newlines, tabs) inside strings were interpreted on input in an odd way: for example single newlines ...
Alexey Popkov's user avatar
10 votes
Accepted

Increasing notebook magnification pushes output onto a new line

You can increase the CellMargins for the styles "Input" and "Output" in your style sheet to accommodate the increased size of the cell labels. For example, the ...
Carl Woll's user avatar
  • 131k
10 votes
Accepted

How insert into Text cell chevron symbols used for Inline GroupOpener icons?

Those symbols are in fact special characters: Row@{"\:f442", "\:f443"}
Lukas Lang's user avatar
10 votes
Accepted

Validate `Box` grammar, is it possible?

You may try using MathLink`CallFrontEnd[FrontEnd`ReparseBoxStructurePacket[...]]. ...
Domen's user avatar
  • 25.3k
9 votes

Any way to make my equations look better, more Latex like?

You can use MaTeX to get $\LaTeX$ formatting directly: MaTeX["\\frac{1}{N}{\\sum _{i=1}^N \\frac{\\tilde{x}_j^i(k|k)}{\\sqrt{P_{\\text{jj}} (k|k)}}}"] ...
Szabolcs's user avatar
  • 235k
9 votes

Cell sizing and labeling for $\textit{MaTeX}$ equations

this is (now a very long) comment not an answer. The objective is to write a book using Mathematica. Within the book equations are generated from LaTex rather than typeset directly using Mathematica. ...
Mike Honeychurch's user avatar
9 votes

Shell Emulation inside Mathematica

I extended the original question to support piping like the following. wget -qO- "http://google.com" // cat and it outputs the following. ...
William's user avatar
  • 7,605
9 votes
Accepted

How to generate an input cell?

CellPrint plus ExpressionCell are tools for generating cells. They do not hold their arguments, so some control of evaluation ...
Michael E2's user avatar
  • 236k
9 votes
Accepted

Given a cell in a Voronoi diagram, which point did it come from?

You can use Region`Mesh`MeshNearestCellIndex to construct Associations mapping faces to points and points to faces ...
kglr's user avatar
  • 396k
9 votes
Accepted

Notebook with version-dependent cells

You can use the approach from this question to get front-end-only version dependent styling of cells and combine it with this question to get invisible cells: ...
Lukas Lang's user avatar
9 votes
Accepted

How to condition all cells of a notebook to a specific SeedRandom?

SetOptions[EvaluationNotebook[], CellProlog :> (SeedRandom[45])] Then before evaluating any cell SeedRandom[45] is evaluated....
azerbajdzan's user avatar
  • 17.5k
8 votes

Cell evaluation and parallel kernels

Basic approach At first we configure parallel kernels either via the Evaluation ► Kernel Configuration Options menu item or programmatically via the ...
Alexey Popkov's user avatar
8 votes
Accepted

How to convert arbitrary raw boxes directly into String?

As Kuba notices in the comment, undocumented FrontEnd`ExportPacket allows conversion of a whole Notebook into plain text: ...
Alexey Popkov's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible