Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
0answers
110 views

What is the causing these colored marks to appear in my Mathematica notebook?

I'm particularly annoyed with the black ovals that occasionally obscure parts of the input as I'm typing: I have also observed the appearance of rectangular blue marks with similar behavior: ...
4
votes
2answers
43 views

Nested list of patterns in SyntaxInformation “ArgumentsPattern”

I have a function with the following input structure: f[{{a1, n1}, {a2, n2}...}, {i1, i2,...}] The first argument is a List ...
2
votes
1answer
60 views

Error with comments inside and expression

I found this strange parsing error with comments inside of an expression in Version 7. And example is {{1, x}, {1, y} (* {1, z (= 5+6)} *)}; It occurs depending ...
20
votes
0answers
236 views

StringCases is Confused with Patterns in Version 10.0.1

I observed the following with StringCases when trying to use rules/patterns. Here is a screenshot of the behavior: Not only is the pattern highlighted in red, ...
12
votes
0answers
153 views

What is ColorEqualSigns and how does one use it?

I'm setting up the SyntaxInformation for a package I'm writing and I'm struggling to understand what the "ColorEqualSigns" ...
3
votes
1answer
50 views

Is it possible to change the fontsize when printing a notebook in the working enviroment?

I want to print a notebook that owns syntax color,I use the Szabolcs's method SetOptions[$FrontEndSession, PrintingStyleEnvironment -> "Working"] Then I can ...
4
votes
2answers
108 views

How do I make my function behave more like Plot? [duplicate]

I have written a function Fun as below: ...
1
vote
1answer
46 views

Overloading ClearAll[] to take no arguments

I use the command ClearAll["Global`*"] so much that I thought it would be nice to have a function that called it. Since by default ClearAll requires an ...
2
votes
1answer
56 views

Having variables appear aqua in user defined function [duplicate]

In many of the inbuilt mathematica function, variables appear aqua like in: However, when creating your own function, variables no longer have that green coloring and are instead colored like an ...
6
votes
1answer
179 views

Solarized stylesheet and other goodies. Feedback welcome!

I was inspired by this post so I've made a Solarized stylesheet after mucking around with the text options and asking stupid questions on here. I know you can change the syntax highlighting by running ...
5
votes
2answers
152 views

Syntax highlighting conflict

I'm trying to syntax highlight this expression: x=$\sqrt{\pi }$//N and from various sources I've learned that x (the assigned symbol) belongs to context Global while the Pi and N belongs to System. So ...
0
votes
0answers
60 views

My “N” turned red randomly [duplicate]

For some reason my N function showed up in red even though I haven't noticed it in that color before. The color actually makes the code much more readable but I just don't know if I should be alarmed ...
3
votes
1answer
73 views

Highlight the same symbol throughout notebook

Once I saw people using Matlab use a keystroke shortcut that made all the same symbols as a selected symbol become blue. I am wondering is there is a function in Mathematica that is similar. If so, ...
8
votes
1answer
107 views

Does the syntax coloring I see indicate a real problem?

I need a behaviour provided by: x = 2; Block[{x = HoldForm[x]}, x] x FrontEnd marks ...
2
votes
1answer
145 views

What's the difference between variables with and without a subscript?

If I input $x = a + b$, the $x$, $a$ and $b$ are blue. When I hit Shif+Enter, the $x$ turns black, indicating the kernel now knows this variable. But when I input $x_r = a + b$, and hit Shift+Enter, ...
9
votes
2answers
1k views

Why is this semicolon in red?

I have a piece of code that works well, but when I put a semicolon after a plotting statement, the semicolon appears in red. What's the error?
5
votes
2answers
101 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 ...
1
vote
0answers
68 views

Why has my syntax coloring changed?

Local variables in Module are no longer specially colored for me, but other syntax coloring remains, for example iterators in a ...
1
vote
1answer
95 views

Custom highlighting in definitions

Suppose we defined a pattern with custom pattern name provided by user, like Quiet[myCustomPattern@terms_ := f[terms : (_[_, _])..]] for use in further ...
7
votes
0answers
158 views

Highlighting Mathematica code in LaTeX document

I was thinking about the best way to include Mathematica code in a LaTeX document with a nice syntax highlighting. I have tried the packages listings and minted (with pygments), which both claim to ...
1
vote
0answers
69 views

Is there any other built-in color scheme for highlighting text?

Blue variable name and black key words seem boring to me now. I find that the color scheme of this site is better. Can I apply that in my notebook?
12
votes
1answer
425 views

What is available for editing Mathematica source code with Emacs?

I can find several Emacs libraries for Mathematica, but I'm not aware of a clear favourite, a definitive list, or of a library which is actively maintained and developed. None of these appear to be in ...
8
votes
0answers
53 views

SyntaxInformation cannot reproduce syntax coloring of Block

Is there any way to have the same syntax coloring with SyntaxInformation that Block has? ...
3
votes
1answer
93 views

Is there really a bug in the following code, taken from the reference documentation for PetersenGraph?

PetersenGraph[5, 2, EdgeLabels -> {8 \[UndirectedEdge] 9 -> "hello"}] appears to evaluate perfectly, as expected, but in my version 9.0.1.0, the option ...
5
votes
1answer
97 views

Syntax formatting when Condition is used with Blank

Consider the following codes: x_/;x>y Condition[x_,x>y] Condition[Pattern[x,Blank[]],x>y] All the three codes are equivalent. As we can see, in the ...
4
votes
1answer
93 views

Is it possible to enable syntax highlighting for \[Function]?

This is a bit of a long shot but I am wondering if it is possible to enable syntax highlighting in a function defined with \[Function] without resorting to anything ...
6
votes
0answers
92 views

Automatization of SyntaxInformation and argx?

Does anybody have a good way to automate the setting of SyntaxInformation for any custom function? I have a ton of functions for which I want to set SyntaxInformation, and doing it by hand seems a ...
11
votes
3answers
463 views

How to program a F::argx message?

How useful is it to program a user-built function in a package to produce a red warning message F::argx if you give the wrong number of arguments to that function? ...
2
votes
1answer
81 views

Why the coloring in Block construct? [duplicate]

I want a function that works like in the following example: it gets an expression which contains a variable var and evaluate it setting setting var = value. I used ...
8
votes
1answer
499 views

High Contrast Syntax-Highlighting

I have a neurological disorder which causes me to have migraines if I look at a white computer screen. To combat this, I have put the following at the top of all of my Mathematica notebooks: ...
2
votes
1answer
128 views

Looking for documentation on code editor's color/style highlighting

Where can I find reference documentation (as opposed to, e.g., tutorials, etc.) on the meanings of the various color/style highlightings that Mathematica automatically assigns to code as one types it? ...
3
votes
2answers
249 views

Why does the syntax highlighter color a local symbol red inside DynamicModule?

I am adding a Module inside DynamicModule here is an example (thanks to @rm-rf for this simple example) ...
3
votes
0answers
94 views

Highlighting bracketing in Mathematica [duplicate]

I'm working with lists of lists of lists. Each box with information has a specific format like information = {{a},{{b}},{{{c},{d}},{e,{f}}},{g}} and so ...
5
votes
1answer
120 views

Syntax highlighting in patterns with built-in functions

While working on my own plotLegends package I encoutered some weird behaviour of the front end's syntax highlighting. I reduced the problem to the following minimal ...
9
votes
2answers
254 views

Wolfram workbench syntax highlighting for local variables inside compile

Lately I've been working quite a lot with Compile. I also started using Wolfram Workbench. So a natural question arises: Is it possible to have syntax ...
2
votes
0answers
192 views

Syntax colouring when using Symbolize

I need to use symbols with suffixes in order to make my code readable in relation to the Eurocodes. To do this I use Symbolize from the ...
9
votes
1answer
334 views

Syntax Highlighting for Mathematica on a Blog

Every once in a while I want to paste Mathematica code on my blog. When I do, I would like it to be somewhat readable, and it would be nice to have syntax highlighting. So far all my searches have ...
11
votes
1answer
392 views

Saving a notebook as a $\LaTeX$ file, with syntax highlighting preserved

How can I save a notebook as a $\LaTeX$ file, while preserving the syntax highlighting (such as input/output boxes)?
9
votes
2answers
597 views

How can one define an infix operator with an arbitrary unicode character?

You can setup "UsefulFunction[a, b]" to use custom infix notation "a [LeftRightArrow] b" as follows: ...
31
votes
2answers
2k views

Is it possible to change the colors of the highlighted code in the Mathematica frontend?

With Format -> Edit Stylesheet... it is possible to adjust text-properties, text-colors, formatting of equations, etc of a notebook and to use this style-definitions again by installing it as ...
3
votes
1answer
90 views

Syntax Coloring for “Possible Unwanted Assignment” Issue

Apparently Mathematica's syntax coloring engine believes that the second assignment in the following code excerpt (concocted for illustration purposes only) is a "Possible Unwanted Assignment" since ...
8
votes
2answers
372 views

How to Enable Syntax Coloring of Pattern Match Variable Only (i.e. Without Coloring any Associated Pattern)?

Syntax coloring for the following function definition foo[x_List] := ... will color green (and italicize by default) the argument name ...
8
votes
1answer
266 views

No Syntax Highlighting of Package Functions

Lately, my installation of Mathematica has decided not to highlight any symbols loaded from packages. The picture below is a good representation of this: where after loading both ...
19
votes
1answer
2k views

Why are some function names red?

I need to evaluate Needs["GraphUtilities`"] before I can use functions such as GraphPath[]. When I do so, some functions get ...
50
votes
2answers
1k views

Syntax highlighting for your own functions

Mathematica has a useful feature that for functions and special constructs getting passed local variables (for example Minimize or ...
24
votes
1answer
967 views

Customizing syntax highlighting for private cell styles

Is there any way to set up a cell style with a particular syntax highlighting? For example, I'd like to have a CProgram cell to write in blue the C special words. I have done it by setting ...
27
votes
3answers
1k views

Saving a notebook as PDF, preserving syntax highlighting

Currently, one may save notebooks as PDFs from the menu by Save As... and then selecting PDF (on a Mac, I imagine it is similar on other OSs). However, the ...
7
votes
2answers
359 views

automatic coloring of function names

Usually, when I define a function and then use it later, the function name is colored in black. But every once in a while, the function color is blue, both in its definition and when I use it later. ...