The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [syntax-highlighting]

Questions about highlighting for Mathematica input in the Mathematica front-end, and Wolfram Workbench.

Filter by
Sorted by
Tagged with
2
votes
1answer
33 views

How can we change the Highlighted elements to a specific color?

edit I don't want highlighting, only font color. Sorry. I want the Highlighted elements to be Blue Font. I can't understand this suggested previous post. When I ...
2
votes
1answer
47 views

Code not working when I'm breaking it up into different lines

The following code works perfectly For[i=1,i<4,i++,Print[i]] However, when I break this into different lines, it stops working. Moreover, the braces appear to ...
0
votes
0answers
41 views

Syntax-coloring specific to function heads

I've been playing around a lot with making a new style sheet with corresponding syntax colorings in the past few days, but I'm finding the default options pretty lacking. While you can use the ...
1
vote
0answers
30 views

Multiple lines of text are being highlighted every time I click

I've had this weird/annoying problem appear a few times now in Mathematica 10.4 where whenever I click, it highlights everything from the bottom of the cell to my cursor. If I click outside a cell, ...
2
votes
1answer
84 views

Syntax highlighting indicates I'm unable to comment properly in Mathematica using (**)

I wanted to "comment" some code so the input inside (* *) is ignored. I tried this but the last term z[3] looks like it is not ...
4
votes
1answer
60 views

Dynamic InputField with syntax highlighting?

I'm trying to create a notebook where a user can enter a Mathematica expression, and its syntax is analyzed (number of tokens, compressed size, etc.). Trying this answer, ...
1
vote
1answer
31 views

Variable refactoring and multi-selection

In IDEs like PyCharm for Python, I can select a variable name or method name and it will highlight to show where all I have used it. Also its easy to refactor the names under a given text selection. ...
5
votes
1answer
50 views

How to set “SymbolContextStyles” for `$Context` symbols?

How to change the font colour of symbols defined in the current context (e.g. $Context) from black to some other colour, say purple? There is a ...
3
votes
0answers
48 views

Installing pygments to be able to use lexer & highlighter for Mathematica

I'd like to try the lexer and highlighter for Mathematica that's based on Pygments, but I'm lost in a morass of getting Pygments installed. Here's what I have so far. I'm using MacPorts python37 (...
1
vote
2answers
122 views

Input editor does not like my Thread over Circle expression

I am using Mathematica 11.3.0.0, 64 bit. Here is my code: Graphics[Thread[Circle[{{-1, 0}, {0, 0}, {1, 0}}, {0.5, 1.0, 0.5}]]] Here is code as it looks in a ...
4
votes
0answers
68 views

Highlight selected text everywhere?

Notebook++ has a very useful feature which highlights all occurrences of certain text once it has been selected with the mouse cursor in one spot: It is very useful in order to jump between different ...
5
votes
0answers
35 views

Reset SyntaxInformation completely

As was pointed out here clearing the SyntaxInformation isn't trivial to do. The best I was able to come up with for clearing it was: ...
11
votes
1answer
175 views

Syntax information for pure functions

Mathematica's help on SyntaxInformation does not rule out syntax information for pure functions. SyntaxInformation[f] gives information used to generate syntax coloring and other advisories when f[…...
2
votes
1answer
135 views

Why are `Control` variables indicated as undefined in the frontend?

Inside Manipulate, symbols defined in controls that are created by hand with Control are given "undefined" syntax coloring. For ...
4
votes
1answer
94 views

Why does SyntaxInformation “ColorEqualSigns” color like wrong options?

In my copy of Mathematica 11.1, SyntaxInformation[f] = {"ColorEqualSigns" -> {1, 1}} colors like wrong options: How do I make it not color like wrong options?...
5
votes
2answers
126 views

How to prevent front end from suggesting Symbol option names (when actually String), and from adding them to Global` context

Help! I am writing a package with a function which takes lots and lots of different options which are Strings. When used, the front end autocompletion is ...
7
votes
1answer
284 views

Syntax Highlighting for WL files in Atom/Sublime?

What packages do people use for syntax highlighting in Atom, Sublime Text 3, etc?
6
votes
1answer
124 views

How to add a custom syntax error check

When Mathematica encounters a syntax error like a./b it generates a red bracket and highlights offending symbols with yellow background. I would like to add some ...
1
vote
0answers
141 views

Demo for Pygments-Mathematica for static webpages? [closed]

Context So @rsmenon's pygments-mathematica looks awesome. Admittedly I still use minted for $\LaTeX$ documents... Anyway, I ...
6
votes
1answer
105 views

Customize syntax highlighting for a particular symbol

the comma in Chinese is different from that in English. But they are too similar. correct English comma incorrect Chinese comma As a non-English user, we have to switch the input quite often. If I ...
1
vote
1answer
105 views

Saving a notebook as CDF, preserving syntax highlighting

My question is virtually the same as Saving a notebook as PDF, preserving syntax highlighting except that I'd like to save my file (a tutorial on Mathematica) as a .CDF file and thus keep the syntax ...
3
votes
1answer
82 views

Why does syntax highlighting in `Set` and `Rule` not color pattern names on the RHS?

The mathematica front-end colors x on the right hand side of x_ :> x and f[x_] := x but ...
12
votes
1answer
215 views

Is there a syntax coloring type that highlights only when not in a list?

How do I define the syntax coloring of local variable of function myfunc so that it only colors the variable that is not in a ...
11
votes
2answers
207 views

How to correctly implement in a new function the scoping behavior of Table, Sum and other commands that use Block to localize iterators?

It is documented that "Block is automatically used to localize values of iterators in iteration constructs such as Do, Sum, and Table." Therefore the dummy index (iterator) in a Sum is shielded ...
2
votes
3answers
248 views

Can highlight an expression in mathematica in an expansion?

I ask mathematica to make an expansion of some expression. Is there a way to ask mathematica to highlight all terms that, say, goes by x^3 since it is really hard to find them? E.g. ...
1
vote
1answer
158 views

Mathematica code to $\LaTeX$ [duplicate]

...
6
votes
1answer
145 views

How to recognize variables like built-in functions?

Many built-in functions can recognize variables. For example, function 'Table' makes its iterator change color. How can I implement a function that has a similar behavior? In this function, I can pass ...
5
votes
1answer
122 views

SyntaxInformation and Options

I wonder if the following behaviour of SyntaxInformation is a bug: I want a function f to accept one argument and options, so I ...
0
votes
2answers
88 views

Function input syntax [closed]

My functions are ...
12
votes
1answer
371 views

SyntaxInformation: take allowed options from multiple symbols – possible?

Suppose I have a function like Options[f] = {foo -> 1}; f[opt : OptionsPattern[{f,g}]] := h@g[Sequence @@ FilterRules[{opt}, Options[g]]] I purposefully do ...
6
votes
3answers
249 views

Syntax highlighting in text cells

I want to write some documentation for a notebook using text cells. Now, I can select parts of the text within such a text cell and set its style to "Input". This does change its font, but there is no ...
1
vote
0answers
55 views

How to disable OperatorSubstitution in a style sheet without losing syntax highlighting for local variables

I'm trying to define a custom style sheet that has "OperatorSubstitution" set to false in order to keep fonts consistent. However, whenever I disable this, I lose ...
6
votes
4answers
155 views

Output code not highlighted when used as input

I have reported this issue: [CASE:3389542] Today, I accidentally found what I believe is an unwanted feature of the front-end, where input code is not appropriately highlighted and the dynamic ...
7
votes
1answer
147 views

Update/refresh notebook variable color on clear

By default, Mathematica displays variable names already assigned as black while new variables are displayed in blue. When executing Clear["Global`*"], variables ...
4
votes
0answers
61 views

Mathematica doesn't italicise a function's argument in the function's body if it appears in the denominator and the denominator is edited. A bug?

Bug introduced in 10.0.0 and persisting through 10.1.0 or later I'm using Mathematica 10.0.2 for Mac. On a fresh kernel, I type this: a is not italicised after ...
1
vote
1answer
318 views

Module and Manipulate: Why the Red Highlighting? [duplicate]

If I define a function that returns a Manipulate object, and the Manipulate has a local variable inside of it, the local ...
1
vote
0answers
59 views

Syntax highlighting of RuleDelayed involving Orderless symbols

I am using version 10.0.2 If I set SetAttributes[ol, Orderless] Then the following expression appears to be highlighted incorrectly after clicking in it (no ...
12
votes
1answer
165 views

Syntax information “ArgumentsPattern” for function of function?

Is is possible to write SyntaxInformation of "ArgumentsPattern" for functions of the form: ...
24
votes
1answer
1k views

Colored marks appearing in notebook input text?

Bug introduced in 10, persisting through 11.0.1 or later What is the causing these colored marks to appear in my Mathematica notebook? I'm particularly annoyed with the black ovals that occasionally ...
7
votes
2answers
119 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
82 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 ...
25
votes
1answer
333 views

StringCases is Confused with Patterns in Version 10.0.1

Bug introduced in 10.0.1 and fixed in 10.0.2 I observed the following with StringCases when trying to use rules/patterns. Here is a screenshot of the behavior: ...
28
votes
1answer
415 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" ...
7
votes
2answers
832 views

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

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

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

I have written a function Fun as below: ...
1
vote
1answer
126 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
159 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 ...
9
votes
1answer
1k 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
303 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
169 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 ...