Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.37 KB

README.md

File metadata and controls

48 lines (33 loc) · 1.37 KB

VsTeXCommentsExtension

Intra-text adornment extension to the Visual Studio Editor for rendering TeX math comments inside editor.

Supports C#, F#, C, C++, VB.NET, Python, R, D and Fortran.

Extension is transforming all continuous code blocks where all lines starts with single line comment syntax (can be preceeded by white spaces) which for example in C# is '//' and the first line starts with '//tex:' prefix ('//' part is language dependent) to rendered image where math is rendered by MathJax. Math in this comments has to be surrounded by $ (for inline math) or $$ signs. Syntax of math is LaTex.

Examples:

  • C#, F#, C, C++, D:
  //tex:
  //Formula 1: $$(a+b)^2 = a^2 + 2ab + b^2$$
  //Formula 2: $$a^2-b^2 = (a+b)(a-b)$$
  • Python, R:
  #tex:
  #Formula 1: $$(a+b)^2 = a^2 + 2ab + b^2$$
  #Formula 2: $$a^2-b^2 = (a+b)(a-b)$$
  • VB.NET:
  'tex:
  'Formula 1: $$(a+b)^2 = a^2 + 2ab + b^2$$
  'Formula 2: $$a^2-b^2 = (a+b)(a-b)$$
  • Fortran:
  !tex:
  !Formula 1: $$(a+b)^2 = a^2 + 2ab + b^2$$
  !Formula 2: $$a^2-b^2 = (a+b)(a-b)$$

Example of C# code:

alt tag

Source code for screenshot above looks like this: alt tag