Boxes are the underlying representation of two-dimensional forms in notebooks.

learn more… | top users | synonyms

18
votes
3answers
582 views

How can I get the unchanged Box form of an arbitrary expression?

One may observe that MakeBoxes does not give the actual Box form of various expressions: MakeBoxes[{1*^4, 000123, a*b c}] <...
25
votes
2answers
1k views

How do I extract the contents of a selected cell as plain text?

My aim is to extract the contents of an Input cells as plain text. Ideally I would like to be able to select one or more Input cells and press a button which would then extract the text from these ...
14
votes
2answers
445 views

Tokenize Mathematica input in a simple way

Background Usually, I give detailed descriptions when I have a question which sometimes lead to that users don't write their answers because they maybe think their answer is too simple. Therefore, I ...
7
votes
1answer
125 views

ToExpression and ToBoxes aren't inverses of each other?

Applying ToExpression and ToBoxes repeatedly to Hold[1/1] gives many ...
10
votes
1answer
302 views

How to change the font color of a variable in whole input cell

I want to track the occurrence of a particular variable in a code. So the idea is to change its color. Usually I do it in a crude way - convert the code into text and then use ...
10
votes
2answers
267 views

Backslash commands in strings?

I discovered by playing around that Text[DisplayForm@SubscriptBox["\[Lambda]", "k"]] produces the same result as ...
11
votes
1answer
174 views

Functions returns Command Completion Output

Is there a function that returns the output as if you invoked Command Completion. To help clarify I am looking for a function that returns the Cell Data as if you invoked ...
7
votes
1answer
103 views

How to convert arbitrary raw boxes directly into String?

This question is motivated by the recent question about searching inside of the NB files. According to the Documentation, ToString expects a high-level WL ...
13
votes
2answers
577 views

How to embed an image into a string?

Note: The bug described in the post is in Mathematica 9, and has been fixed in 10.0. The documentation for String contains the following statements: Strings ...
7
votes
1answer
151 views

Converting string representation of boxes into explicit boxes [duplicate]

It is very easy and convenient to write textual labels as Strings in the WYSIWYG mode. For example, I define a short form describing a linear model: ...
4
votes
2answers
168 views

ToBoxes Respect Spaces Code

Is there a way to force either ToBoxes or MakeBoxes to respect the spacing that occurs in the code? For example is there a way ...
16
votes
3answers
416 views

Notebook vs. DocumentNotebook; display a Notebook inline, like a DocumentNotebook

If you evaluate a DocumentNotebook[] expression in the front-end, it nicely displays inline, inside of an output cell in the current notebook: For my purposes, <...
9
votes
1answer
188 views

Is there a way to have a Tooltip for non-editable raster graphics produced by MakeBoxes?

I have a function which produces a large object I would like to hide. Formatting is of course an option but I'm hoping for something a little more meaningful using raster graphics and ...
12
votes
1answer
528 views

How to convert a notebook cell to a string retaining all formatting, colorization of identifiers etc?

I have an opened Mathematica notebook containing several cells. Suppose, I am interested in one of them -- it may contain a complete or incomplete expression (e.g. with syntax errors, highlighted ...
8
votes
1answer
449 views

How to change brackets in TraditionalForm output

I'm trying to improve TraditionalForm's output by using different brackets when there are more than one. For instance, instead of $u(v(r(b))))$, I'd like to get $u\{...
5
votes
2answers
158 views

How do I mimic the functionality of “<>”?

The Cell expression for: <> is Cell[BoxData["<>"], "Input"] However similar expressions are parsed into RowBox(...
5
votes
2answers
102 views

Removing spurious parenthesis in `TraditionalForm`

I don't understand the following behavior (in v 9.0.1) of TraditionalForm regarding insertion of parenthesis. Let us start with the a definition for ...
5
votes
2answers
184 views

Customizing display of partial differential equations

I am manipulating partial differential equations symbolically, and would like to get the easily readable form $\rho \frac{\partial v}{\partial t}$, leaving variables implicit. Based on suggestions ...
4
votes
1answer
88 views

Combination of CellPrint and PrintTemporary, or DisplayForm for Cells

I'm programmatically generating some formatted output that generates a cell in the form of a Cell[] expression. For instance, the output might be ...
16
votes
0answers
101 views

Inconsistent handling of Dynamic option values; intended, omission, or bug?

In answering Dynamic ClipPlanes calculated from current ViewPoint Kuba and I got into a brief exchange regarding how Option values wrapped in Dynamic should be ...
5
votes
1answer
79 views

What are “\<” and “\>” delimiters in box expressions?

If I enter a string (say, "abc") in a cell, and then switch to box representation (Shift+Ctrl+E or menu item ...
4
votes
1answer
156 views

Unexpected result when reading Cell with comment-lines by NotebookRead

Bug introduced in 9.0 and fixed in 9.0.1 When considering this question about re-formatting Cell (also this one), I encountered an issue which confuses me. I'll ...
2
votes
1answer
1k views

How to import a Microsoft Word document into Mathematica?

I have a Microsoft Word document in DOCX format. I need to import it into Mathematica as a String preserving all formatting (font, size, bold/italic style, colors, ...