vscode-terosHDL icon indicating copy to clipboard operation
vscode-terosHDL copied to clipboard

Add the option to insert a formula in documenter

Open DRubioG opened this issue 3 months ago • 3 comments

Is your feature request related to a problem? Please describe. I think it could be interesting to add the option of see in documenter a formula.

Describe the solution you'd like Something like markdown using dolar symbol '$' between the parameters of the formula, or the label @formula want to see in documenter.

DRubioG avatar Sep 20 '25 09:09 DRubioG

@DRubioG The math formula should work in markdown. But it seems there is a problem with the html export.

Image

gmartina avatar Oct 13 '25 16:10 gmartina

Could you provide me that formula example, please?

Because if I create a formula in markdown or HTML.

Image

Example Code:

 Markdown formula:
 --
$$
 \int_0^{\pi} \sin(x) \cdot e^{-x} \, dx
$$


 HTML formula
 --
 <math xmlns="http://www.w3.org/1998/Math/MathML" play="block">
   <mrow>
     <mo>&int;</mo>
     <msub>
       <mo></mo>
       <mrow>
         <mn>0</mn>
       </mrow>
     </msub>
     <msup>
       <mo></mo>
       <mrow>
         <mi>&pi;</mi>
       </mrow>
     </msup>
     <mrow>
       <msin>
         <mi>x</mi>
       </msin>
       <mo>&InvisibleTimes;</mo>
       <msup>
         <mi>e</mi>
         <mrow>
           <mo>-</mo>
           <mi>x</mi>
         </mrow>
       </msup>
       <mo>&InvisibleTimes;</mo>
       <mi>dx</mi>
     </mrow>
   </mrow>
 </math>

And I ported to VHDL file, only works the HTML formula

Image

VHDL example code:

--! Markdown formula:
--! --
--!$$
--! \int_0^{\pi} \sin(x) \cdot e^{-x} \, dx
--!$$


--! HTML formula
--! --
--! <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
--!   <mrow>
--!     <mo>&int;</mo>
--!     <msub>
--!       <mo></mo>
--!       <mrow>
--!         <mn>0</mn>
--!       </mrow>
--!     </msub>
--!     <msup>
--!       <mo></mo>
--!       <mrow>
--!         <mi>&pi;</mi>
--!       </mrow>
--!     </msup>
--!     <mrow>
--!       <msin>
--!         <mi>x</mi>
--!       </msin>
--!       <mo>&InvisibleTimes;</mo>
--!       <msup>
--!         <mi>e</mi>
--!         <mrow>
--!           <mo>-</mo>
--!           <mi>x</mi>
--!         </mrow>
--!       </msup>
--!       <mo>&InvisibleTimes;</mo>
--!       <mi>dx</mi>
--!     </mrow>
--!   </mrow>
--! </math>

DRubioG avatar Oct 13 '25 18:10 DRubioG

--!
--! This sentence uses `$` delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
--!
--! This sentence uses other delimiters to show math inline: $`\sqrt{3x-1}+(1+x)^2`$
--!
--! Formula:
--! $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
--!
--! Formula:
--! ```math
--! \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
--! ```
--! 

Output in markdown:

Image

gmartina avatar Oct 13 '25 19:10 gmartina