Introducing “Math Rendering” in Notepadqq 1.4

We all know that code is meant to be read, and comments should be clear and concise. A problem with text editors is that, while they are perfect for writing and displaying code, they do a pretty poor job with comments. Comments shouldn’t be restricted to the rigid rules of all the rest of the code, as they are (usually) completely ignored by any parser.

If you are working in a math heavy field, you have experienced at least once the frustrating feeling of not being able to comment your code by using a simple, straightforward formula. I mean, you can, but… how should you write it?

W_i = V_i - sum (V_i * W_j * W_j / ||W_j||^2) from j=1 to i-1

Or, maybe:

W_i = V_i - (V_i * W_1 * W_1 / ||W_1||^2) - ... - (V_i * W_i-1 * W_i-1 / ||W_i-1||^2)

That quickly gets messy and difficult to understand. What about this, instead?

Notepadqq 1.4 introduces a Math Rendering mode that can be used to do just that: insert math formulas within comments by using the well-known TeX syntax.

You can enable it via the “View -> Math Rendering” menu.

How to use it

First, enable Math Rendering from the View menu. Then start a comment in your favourite programming language and write your formula within dollar markers, like this: $ formula $. It’s as simple as that.

You can also use two dollar markers, as in $$ formula $$, in order to allow the editor to vertically expand the line if needed.

Take a look here for a good reference of the syntax we support: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference

0 0 vote
Article Rating
Subscribe
Notify of
guest
7 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Kresimir
Kresimir
5 years ago

It would be useful if this worked in LaTeX files, where it is not just in the comments, but everywhere.

Alexis Prel
Alexis Prel
5 years ago

This is brilliant! I wish all editors had that feature!
It is also quite nice to write latex documents: just comment out the line of an equation to see a quick display, uncomment to see syntax highlighting again!

Sean Parry
Sean Parry
5 years ago

Many thanks

wtlin
wtlin
5 years ago

This is an amazing feature. It looks simple, but Notepadqq is the only editor I know that has this feature.

I study physics, and sometimes need to do numerical calculations. Comments with rendered math are so important for me!

trackback

[…] >>> Подробности […]

uomouni
uomouni
5 years ago

It would be awesome to have this for markdown files everywhere, as there are no comments.