Questions about highlighting for Mathematica input in the Mathematica front-end, and Wolfram Workbench.
Questions tagged [syntax-highlighting]
100 questions
26
votes
1 answer
SyntaxInformation cannot reproduce syntax coloring of Block
Is there any way to have the same syntax coloring with SyntaxInformation that Block has?
SyntaxInformation[func] = {"ArgumentsPattern" -> {{__}, _},
"LocalVariables" -> {"Solve", {1, Infinity}}};
func[vars : {__}, body_] :=…
István Zachar
- 47,032
- 20
- 143
- 291
12
votes
1 answer
Syntax information "ArgumentsPattern" for function of function?
Is is possible to write SyntaxInformation of "ArgumentsPattern" for functions of the form:
f[a,b][x,y,z]
That is, I get syntax coloring such that the first set of square braces takes exactly 2 arguments, and the second set takes 3?
I tried…
QuantumDot
- 19,601
- 7
- 45
- 121
7
votes
2 answers
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 of Lists, each with exactly two elements, and the second argument is a list of symbols.
So I thought the appropriate…
QuantumDot
- 19,601
- 7
- 45
- 121
7
votes
1 answer
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 custom checks which work in the same way.
For example I would like to highlight double…
Ray Shadow
- 7,816
- 1
- 16
- 44
5
votes
0 answers
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:
SyntaxInformation[f] =
{
"ArgumentsPattern" -> {___},
"LocalVariables" -> {"Table", 0},
…
b3m2a1
- 46,870
- 3
- 92
- 239
4
votes
1 answer
$ContextAliases and symbol color
The example below shows that the symbol test`MyFunction is still in blue, which suggests that it is not defined. The color is defined in menu Edit > Preferences> Appearance > SyntaxColoring > Global symbols that have no value…
ScotMartin
- 191
- 5
3
votes
0 answers
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 (invoked from command line by "python").
Again with…
murray
- 11,888
- 2
- 26
- 50
2
votes
1 answer
Why the coloring in Block construct?
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 Block to avoid expr being evaluated if variable var holds a value in the notebook.…
Betelgeuse
- 101
- 2
2
votes
0 answers
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, it highlights all cells from the bottom of the…
cmm0052
- 195
- 6
1
vote
0 answers
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 need to evaluate it)
ol[a_, b_] :> {a, b} (*click in this expression*)
Of course…
Jacob Akkerboom
- 12,215
- 45
- 79
1
vote
0 answers
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?
zhangwfjh
- 239
- 1
- 6
1
vote
0 answers
Demo for Pygments-Mathematica for static webpages?
Context
So @rsmenon's pygments-mathematica looks awesome. Admittedly I still use minted for $\LaTeX$ documents...
Anyway, I would like to add some Mathematica syntax highlighting for a few static webpages (built without Jekyll, Octopress, or…
SumNeuron
- 5,422
- 19
- 51