A more transparent highlighting with Defer and evaluate-in-place?

I’m using Highlighted[Defer[…]] on expressions and evaluate-in-place to highlight parts of queries for a book project.

Works well usually, but I notice it leaves out the quotations, see image – those should be strings. Strings should also be gray.

Is there an option to Highlight while leaving the other natural input form highlighting as-is?

2sNJN A more transparent highlighting with Defer and evaluate in place?

Toy example. Use shift-command-return (OSX) on Highlighted[Defer["a"]] to highlight

<| "a" -> 1, "b" -> 2|> // Query[Highlighted[Defer["a"]]]

1 Answer

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange