Skip to content

LaTeX formulas in documentation pages #852

Closed

Description

@Didayolo

It should be possible to include LaTeX formulas in the HTML or Markdown pages, using $$ tags.

Related issue:

Activity

  1. added
    Enhancement
    Post-it
    on May 9, 2023
  2. Didayolo commented on May 27, 2023

    @Didayolo
    MemberAuthor

    File concerned: https://github.com/codalab/codabench/blob/develop/src/static/riot/competitions/detail/_tabs.tag

    One possibility:

    Markdown doesn't support LaTeX math formulas by default, but there are tools that can help. You can use JavaScript libraries such as MathJax or KaTeX to render LaTeX syntax within Markdown in web browsers. I'll guide you through the setup using MathJax, which is widely used and well-supported.

    1. Embed MathJax Script in Your HTML: First, include the MathJax library in your website by placing the following script in the head section of your HTML:
    <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    1. Configure MathJax: You will need to configure MathJax to recognize the $$...$$ as delimiters for LaTeX equations. You can do this by adding a MathJax configuration script in your HTML before the above script, like so:
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [['$','$'], ['\\(','\\)']],
          displayMath: [['$$','$$'], ['\\[','\\]']],
          processEscapes: true
        }
      });
    </script>
    <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    1. Rendering LaTeX in Markdown: Now, you can type LaTeX math formulas inside $$...$$ in your Markdown. For example, to render the quadratic formula, you would write:
    $$
    x = \frac{{-b \pm \sqrt{{b^2-4ac}}}}{{2a}}
    $$

    After you've set this up, any LaTeX syntax inside $$...$$ in your Markdown will be rendered as a mathematical formula in the browser.

  3. self-assigned this
    on Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

EnhancementPost-itUI

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions