Linked Questions

7
votes
1answer
233 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: ...
536
votes
19answers
135k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
25
votes
2answers
2k views

Using a list of tuples in a pure function

I want to use a list of tuples within a function to make assignments. Say I want to make assignments of the form value[i,j] = val What I have is a list of ...
33
votes
2answers
2k views

Going full functional (Haskell style)

I'm trying to define some notation so that Mathematica code would be more functional, similar to Haskell (just for fun): currying, lambdas, infix operator to function conversion, etc.. And I have some ...
27
votes
2answers
2k views

What is the complete list of valid FrontEnd Packet types?

In response to my question How can I get the unchanged Box form of an arbitrary expression? John Fultz answered with a method using the hilariously named ...
25
votes
3answers
3k views

How to find pieces of code responsible for syntax errors?

Especially: How to find the piece of code responsible for a missing parenthesis problem caused by a misplaced SuperScriptBox For last 30 minutes (and I was lucky ...
11
votes
5answers
592 views

Remove subscript from string

I have a list that I am using for the legend of a plot gases = {"Air", "He", "Ar", "\!\(\*SubscriptBox[\(N\), \(2\)]\)", "\!\(\*SubscriptBox[\(CO\), \(2\)]\)"}; ...
21
votes
1answer
2k views

How to strip all formatting from a string and convert it to plain text?

The documentation on String states: But if I try to perform some manipulations on this string, for example, take 2 words from the left, I get some shards of ...
19
votes
2answers
1k views

Paste data into Mathematica with formatting

Select the following Mathematica code and paste it into a notebook. In Windows 7(Mathematica 8) the line breaks are not interpreted in the expression. In fact any data copipasted from stackexchange ...
15
votes
2answers
464 views

Infix form of PutAppend ( >>> ) does not work with variable

I'm new to Mathematica, so I suspect this question involves either a misunderstanding involving variables or the usage of >>>. On a webMathematica page (...
12
votes
2answers
780 views

Why aren't parentheses ( ) an expression in Mathematica?

Why aren't parentheses ( ) an expression in Mathematica? Can I get an expression in a form where parentheses are represented by an expression?
13
votes
4answers
505 views

Transform fancy usage messages in 1D string

When we look at the usage messages of built-in functions nowadays (not in the good old times, when they were a simple descriptions) we see that although they look pretty in the front end, it is really ...
13
votes
3answers
786 views

ToExpression fails with long nested string expressions

Consider the following conversion from String to Mathematica Expression: ...
7
votes
4answers
814 views

How to rename a built-in function?

I want a built-in function renamed without loss of any properties, I want the shorter name to appear in all results and to be recognized as input. Is it possible?
5
votes
3answers
274 views

How to re-parse (or re-map) character '.' to user-defined function

The default behavior of the character . between two non-numeric characters is to be interpreted as the infix of the Mathematica function ...
14
votes
1answer
327 views

Import package with correct symbol contexts

I am looking to do some automated analysis on packages, e.g. automatically check for common mistakes. Mathematica makes it relatively easy to manipulate code as data, and ...
7
votes
3answers
356 views

Programmatically convert notebook input cells to text file

I have ~150 student-submitted Mathematica notebooks for an assessed assignment. While I've been marking them, I'm suspecting there is a reasonable amount of plagiarism going on, when multiple students ...
10
votes
1answer
405 views

Ghost trails with Animate?

What are some approaches to integrate Ghost trails methods with Animate, which otherwise seem more suited for exporting individual frames? For example, given this rootPlot function, how can trails ...
7
votes
2answers
335 views

HoldForm[Operator ##] on some list

Recently in response to this question Mr.Wizard suggested an unusual way to summing numbers. This doesn't seem to be documented. ...
5
votes
3answers
266 views

How can I improve NumberString?

I would like to test strings to see if they represent numbers. This should include number representations with precision marks and scientific notation. NumberString ...
2
votes
3answers
298 views

how can I generate a sequence of assignments?

I want to make a sequence like follows r[1]= r[2]= r[3]= r[4]= .... r[n]= The above r[i] represents coordinates which I have ...
2
votes
2answers
277 views

FullForm applied to functions

I would have expected FullForm[Cases[{a^2, a^3}, a_^1]] to produce Cases[List[Power[a, 2], Power[a ,3]], Pattern[a, Blank[]]]...
8
votes
1answer
328 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 ...
2
votes
1answer
980 views

How to parse string to expression? [closed]

When trying to make a string an expression I see some wrong results: ...
1
vote
1answer
435 views

Can Save[] produce a .nb file instead of a text file?

(I use Mathematica 9.0.1 on OS X 10.10.2.) Suppose I have a notebook in which I make some definitions and assignments. ...
3
votes
1answer
204 views

How to make some RowBox to be string

GeneralUtilities`GetUsages["System`Sin"] I want to get $\color{red}{\textbf{1}}$ plain string,but this function actually will give me some ...
8
votes
1answer
243 views

Converting to InputForm or StandardForm without deleting comments

Following on from this question: Is it possible to convert an expression to InputForm or StandardForm without losing the comments? For example, ...
3
votes
1answer
111 views

Want actual cell data from CellEvaluationFunction

Let's say I print a cell like so. CellPrint@Cell[ BoxData[" "], "Input", Evaluatable -> True, CellEvaluationFunction -> Function[Print[#];] ] Now I ...
4
votes
2answers
140 views

How to print unevaluated arguments in the form they were originally typed in?

I'm looking for a way to print a function's arguments, not only unevaluated, but also in the way they were originally typed in. By way of experimentation, I tried stuff like this: ...
2
votes
2answers
113 views

How to tell whether a character is a letter-like form

Is there any way to programmatically tell whether a given character is a letter or letter-like form (see this reference page for what I mean)? One idea I had was to use ...