# Tagged Questions

Questions on correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and ~ characters.

436 views

### Do any mainstream text editors support Wolfram Language syntax for highlighting? [duplicate]

Syntax Highlighting for Mathematica on a Blog There is the above, but I'm not terribly excited to install rogue packages. For example on github, I share lots of Mathematica code. I see no way to ...
900 views

### Can't comment strings with '*)' inside it

I believe it's a bug in notebook's comment parser. I can't comment strings with *) inside it. Something like: ...
330 views

### Long list of similar rules

Given the following: ...
2k views

### Keep function range as a variable

Plot[2*x^2 - x + 2, {x, -1, 1}] plots a function of x from -1 to 1. As far as I can see, I cannot "save" this range in a variable: ...
608 views

### Syntax for prefix mode with multiple arguments using @ shorthand

Is it possible to use the @ symbol with multiple arguments? The Prefix command suggested not. If so, why?
316 views

### How can I create currying functions using pure function syntax?

For example how can I write In: pureFunctionSyntax[myF] /@ {7, 3} Out: {myF[7, Log[7]], myF[3, Log[3]]}
176 views

### How to Write Partition with Infix?

The documentation says that using Infix ~, the following input f[e1,e2,e3,...] can be rewritten as ...
536 views

### What does (0 &) mean in an evaluation? [closed]

My Mathematica code is this: Simplify[D[Sqrt[1 + (u')^2 + (-60 x - 20 u u')^2], u]] It returns this: ...
367 views

### Finding the square root of a squared number?

Taking the square root of the square of a number Variable set to a real value I'm wondering why these examples a = -4.3; Sqrt@a² Sqrt@(a^2) Sqrt[a^2] Sqrt[a²] ...
151 views

### Ignore some values at return

Is there Mathematica analogue of Python _ (underscore) or Matlab ~, a special variable, that can be used when a function returns ...
203 views

### How can I define a ⊕ operator?

What is wrong with the following code? CirclePlus := SparseArray[Band[{1, 1}] -> {##}] & a_ ⊕ b_ := CirclePlus[a, b] SetDelayed::write: Tag Function in ...
115 views

### Why can Format be used on the left side?

I am learning Mathematica in random order by reading its documentation. This approach is what I like most when learning new things. Consider the following 2 cases. Syntax A: ...
1k views

246 views

### Why does the Front End group backslashes into pairs?

What is \\ for? Help finds nothing on it. An odd number of backslashes greater than one are grouped by two and the last one is displayed with a different color. ...
365 views

### Defining a function with parameters as variables

I have an expression V = (a[1] + a[2])b[1]. How would I define a function of a[1], a[2] and <...
95 views

### Syntax for FrontEndSelectionSetStyle

I know FrontEndSelectionSetStyle is undocumented, but its name suggests it does what I need. What is its syntax? I have already tried several variations of the ...
378 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 ...
138 views

### Is there an internal logic behind short form symbols, such as @ (Prefix), @@ (Apply), /@ (Map), /. (ReplaceAll) [closed]

To me, function names (such as Apply and Map) seem more intuitive than their symbols (e.g. @@...
1k views

### Orthonormalization of non-hermitian matrix eigenvectors

When using Orthogonalize[] one can specify which definition of "inner product" is to be used. For example, ...
909 views

### Single dot textual form

How do I render a letter with a single dot above it? I see \[DoubleDot] and \[TripleDot] are readily available, but what about ...
678 views

### Write a function that returns the logarithmic derivative

How can we write a function that if we input an expression f, it returns the log derivative $\frac{1}{f} \frac{df}{dx}$. We have to use a conditional or pattern test so that the function accepts any ...
245 views

### How to set multiple parameters to zero?

Say I have the matrix A = {{a,b,c,d,e}, {f,g,h,j,k}} and I want to set some of these to zero. I have been doing this via ...
426 views

### List reversion inspired by Python

In python, if you wish to reverse a list, here is the trick: range(10)[::-1] => [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] Note: ...
292 views

### Get Axes Range of Plot?

Say I have some plot plot = Plot[Sin[x], {x,0,10}] (*as an example*) Is there a way I can get the x and y axes min/max values from the "plot" variable? If I ...
118 views

### Sorting and keeping the main format of list numbers [duplicate]

I have a list with these elements: list={1/2 (1 + Sqrt[5]), 1, 1, 1/2 (1 - Sqrt[5]), 0}; I want to sort them with ...