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

learn more… | top users | synonyms

17
votes
3answers
470 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}] ...
13
votes
3answers
361 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, ...
13
votes
2answers
504 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 ...
12
votes
2answers
387 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 ...
11
votes
1answer
392 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 ...
10
votes
1answer
152 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 ...
9
votes
2answers
164 views

Backslash commands in strings?

I discovered by playing around that Text[DisplayForm@SubscriptBox["\[Lambda]", "k"]] produces the same result as ...
9
votes
1answer
177 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 ...
8
votes
1answer
118 views

How to get a list of all expressions in a notebook matching a certain pattern?

Suppose I have a Mathematica notebook saved to a certain location on disk. Given a pattern I need to get the list of all expressions matching this pattern that appear in input, output or print cells ...
8
votes
1answer
190 views

Pasting TemplateBox with a Dynamic argument

Ok, this is pretty specific... The objective is to use a TemplateBox to format something that is programatically inserted with ...
7
votes
3answers
159 views

How to avoid spaces between numbers when displaying TagBox(es)

The instruction : DisplayForm[RowBox[List[0,1,Superscript[2,3],Superscript[1,2],a]]] displays a gap between the first two items of the list but if one is ...
7
votes
1answer
362 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 ...
6
votes
2answers
807 views

Formatted text in a Dynamic or Manipulate control

I am using a Manipulate control to show different calculations for the same user-specified parameters. I would like to show the results for the calculation the ...
6
votes
1answer
215 views

On Reverting Code that Mma Switches to Raw Input Form Back to Standard Form

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the ...
6
votes
1answer
94 views

Why only up to two \[Prime] superscripts are interpreted as derivatives?

I noticed that only up to two \[Prime] superscripts are interpreted as derivatives. Is there a reason for this restriction? Is it documented? ...
6
votes
2answers
145 views

Prevent front-end from reformatting long fractions while editing

I am editing an expression containing wide fractions (typeset with fraction boxes): But if, while editing the equation, the fraction exceeds some threshold (seems to be approximately the window ...
5
votes
2answers
116 views

Why does MakeBoxes mess up RowBox ordering?

When I use RowBox for MakeBoxes the order of the elements is changed for TraditionalForm, if there is a plus (+) in the list of elements. ...
5
votes
2answers
137 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 ...
5
votes
2answers
76 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
147 views

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

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

How to robustly apply ToBoxes to a Dynamic expression?

Inserting a Dynamic object in a boxform expression messes up syntax colouring. See the following example. where the variable ...
5
votes
1answer
258 views

How to convert an image to a compressed string representation equivalent to one copied to clipboard by `CopyToClipboard[image]`?

In my recent question I asked How to embed an image into a string? The suggested solution was ...
5
votes
1answer
170 views

Extracting text from cells, preserving non-ASCII characters

Consider the following setup, based on this answer by WReach: ...
4
votes
2answers
134 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 ...
4
votes
1answer
410 views

How to extract a possible closed form from WolframAlpha[] output

To find a possible closed form of a number, I can use the function WolframAlpha["6.38905609893065", IncludePods -> "PossibleClosedForm"] It returns a result ...
4
votes
1answer
109 views

Converting string representation of boxes into explicit boxes

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
1answer
132 views

Unexpected result when reading Cell with comment-lines by NotebookRead

When considering this question about re-formatting Cell (also this one), I encountered an issue which confuses me. I'll let the code itself speak: Consider the ...
4
votes
0answers
83 views

Using an external Pattern breaks Format

I noted while writing this answer that using an external Pattern on Format doesn't work: ...
3
votes
2answers
169 views

Subscript and Part: What's going on in this example?

Example I came across the following simple example from A Beginner's Guide to Mathematica, by McMahon and Topa, which I believe was written circa version 5.2. (FWIW, I'm using v9.) ...
3
votes
1answer
104 views

Vertical “fractions” with more than 2 parts

Standard FractionBox syntax allows only 2 arguments and creates 2-part fraction for numerator and denominator. Is it possible to draw similar construction, but ...
3
votes
1answer
40 views

Splitting formatted output to multiple lines in a controlled fashion

Let's consider a slightly complicated expression in TraditionalForm: ...
3
votes
2answers
338 views

FrameStyle in Inset with Framed expression

I am creating some plots that use FrameStyle->AbsoluteThickness@5 and PlotStyle->AbsoluteThickness@0.5. In my plots' ...
3
votes
1answer
74 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 ...
3
votes
0answers
38 views

To UpSet or not to UpSet when using MakeBoxes

What is the difference between the following two: ...
2
votes
2answers
65 views

NotebookWrite in EvaluationBox forces Input CellStyle

There is a promissing new function EvaluationBox[] and a nice last example in documentation section for it: ...
2
votes
1answer
834 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, ...
2
votes
1answer
77 views

How to suppress clutter parentheses in output?

Dozens of unnecessary parentheses are making my output hard to read. For example, this: expr = D[f[x], {x, 2}]^2; returns this: (* f"[x]^2 *) But when I try ...
2
votes
1answer
117 views

A Box for the integral or partial derivative d

I am looking for the name of the box in the Box Language of Mma making integrals, such as those shown in the image below as well as of the sign of the partial derivative. I understand that I can get ...
2
votes
2answers
70 views

How to paste multiple expression using PasteButton?

Is there a way to paste multiple expressions into notebook using PasteButton? For example, I want to do ...
1
vote
1answer
100 views

Strange setting in FormatValues[MakeExpression]

My sytem is: 8.0 for Mac OS X x86 (64-bit) (October 5, 2011) When I start Mathematica and call FormatValues[MakeExpression] I get the following output: ...
1
vote
2answers
167 views

How to convert comment in RowBox to DisplayForm string

ToExpression[RowBox[{"a","(*","what", "*)"}],StandardForm] This conversion above ignores the commment content (*what*) The ...
1
vote
1answer
141 views

How to copy an image given as a GraphicsBox expression to the clipboard?

I have a GraphicsBox expression encoding an image. I need to copy this image to the clipboard so that it can be inserted in a Microsoft Word document. When I invoke ...
0
votes
0answers
34 views

Possible bug in shallow representations of expressions in messages

I got the following message in Mathematica 10.0.2: I do not have questions about the message itself, but rather about its representation. The program was maninulating with mathematical expressions ...