LaTex display for mathematical equations in Synapse Analytics

Chintan Rajvir 426 Reputation points Microsoft Employee
2021-03-15T13:28:10.807+00:00

I am using Azure Synapse Analytics to analyse my output data using a notebook running on a Spark pool in Synapse. In the process, I have a CSV loaded (as model output) from the ADLS Gen2. One of these columns is a list of model parameters and I want to programmatically build the equation string in LaTex and print it as a part of code cell output. I tried the following way (considering it to be an example for now):

import IPython.display as disp
fr=2 
disp.display(disp.Latex("$f_r = %i$ GHz"%(fr)))

As expected, the output should be the visualisation of the LaTex string. However, I receive the following output from the code cell: <IPython.core.display.Latex object>.

I am looking for some pointers to achieve the same.

Regards,
Chintan Rajvir

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,395 questions
{count} votes

Accepted answer
  1. KranthiPakala-MSFT 46,422 Reputation points Microsoft Employee
    2021-03-16T06:13:41.253+00:00

    Hi @Chintan Rajvir ,

    After having conversation with internal team, it is confirmed that outputting LaTeX is not directly supported in the Notebook code cell in Synapse Studio.

    As of now, however, you may try with displayHTML function and to render the LaTeX expression via HTML output. This may need some HTML boilerplate like the one provided by MathJax: https://www.mathjax.org/#gettingstarted. And you may need to enable “Preview Features” on the notebook toolbar in order to properly consume external scripts in the HTML output.

    An example of the HTML snippet is here: 78097-htmlsnippet.txt

    And the outcome is as follows:

    78131-image.png

    If you have any feedback/suggestion regarding the product improvements, I would recommend you to please share your feedback in Azure Synapse Analytics user voice forum: https://feedback.azure.com/forums/307516-azure-synapse-analytics .

    Please do share the feedback link one it is posted so that other users with similar idea can up-vote and/or comment on your suggestion.

    Hope this info helps.

    ----------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful