Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latex support #242

Open
Cyberfly100 opened this issue Apr 9, 2018 · 6 comments

Comments

@Cyberfly100
Copy link

commented Apr 9, 2018

I tried to use latex in dash, but it is not working.
It seems that the mathjax javacript library is not loaded.

@chriddyp

This comment has been minimized.

@jessexknight

This comment has been minimized.

Copy link

commented May 24, 2018

It is possible to render MathJax in static Dash content, but not in dynamic content.

Here is a MWE

import dash
import dash_html_components as html

app = dash.Dash(__name__)
mathjax = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML'
app.scripts.append_script({ 'external_url' : mathjax })

app.layout = html.Div(id='main',children=[
  html.Div(id='static',children='$$ x=1 $$'),
  html.Div(id='dynamic',children=''),
  html.Button('Add Math',id='button'),
])

@app.callback(
  dash.dependencies.Output('dynamic','children'),
 [dash.dependencies.Input('button','n_clicks')]
)
def addmath(n_clicks):
  if n_clicks:
    return '$$ x=1 $$'
  else:
    return None

if __name__ == '__main__':
  app.run_server(debug=True)

related community.plot.ly thread

@aztan2

This comment has been minimized.

Copy link

commented Aug 22, 2018

Hi, I'm wondering if there has been progress on this issue? Specifically, I would like to be able to render latex in the axis titles/labels of a graph.

@jessexknight

This comment has been minimized.

Copy link

commented Aug 22, 2018

There is a pull request in progress to solve this issue, but it seems like it has stalled at the moment.

@xhlulu

This comment has been minimized.

Copy link

commented Nov 2, 2018

I created dash-katex, a library that let you render latex inside a component DashKatex, obviously using katex js. This does not solve the problem of rendering latex inside a plotly graph object, but lets you dynamically run latex inside divs.

Link: https://github.com/xhlulu/dash-katex

@vdkotian

This comment has been minimized.

Copy link

commented Jan 4, 2019

Is this issue still available for development? I am seeking to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
8 participants
You can’t perform that action at this time.