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

feat: Inline math formulas (#1600) #1622

Merged
merged 4 commits into from
Jan 13, 2022
Merged

Conversation

andre-code
Copy link
Contributor

@andre-code andre-code commented Dec 23, 2021

  • support inline math code between $` and `$

Project example:
https://renku-ci-ui-1622.dev.renku.ch/projects/lorenzo.cavazzi.tech/math-example

/deploy

Closes #1600

@RenkuBot
Copy link
Contributor

You can access the deployment of this PR at https://renku-ci-ui-1622.dev.renku.ch

@andre-code andre-code temporarily deployed to renku-ci-ui-1622 December 23, 2021 15:19 Inactive
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline looks good, but there are still a few problems with the formulas.
In the example you linked, the second formula is the following

$$u(\mathbf{x}) = \beta\exp\left(-\frac{1}{2}\mathbf{x}^\top\Lambda \mathbf{x} + \nu^\top \mathbf{x}\right)\phi(\mathbf{x}).$$

It's rendered correctly on GitLab
Screenshot_20220103_104229
but it's not in our UI (look at the extra <=ft and right)
Screenshot_20220103_104300

P.S: I'm not sure if it's easy to fix this using replace or we should rather give a look at other alternative libraries for rendering the formulas.

@andre-code
Copy link
Contributor Author

The inline looks good, but there are still a few problems with the formulas. In the example you linked, the second formula is the following

u(\mathbf{x}) = \beta\exp\left(-\frac{1}{2}\mathbf{x}^\top\Lambda \mathbf{x} + \nu^\top \mathbf{x}\right)\phi(\mathbf{x}).

It's rendered correctly on GitLab Screenshot_20220103_104229 but it's not in our UI (look at the extra <=ft and right) Screenshot_20220103_104300

P.S: I'm not sure if it's easy to fix this using replace or we should rather give a look at other alternative libraries for rendering the formulas.

Many thanks for the review @lorenzo-cavazzi
According to this information https://docs.gitlab.com/ee/user/markdown.html#math the `$ and ```math delimiters are Gitlab's own that use Latex so the error was in using ascii math instead of the Latex typesetting, with the correct configuration the formulas are rendered as expected.

@andre-code andre-code temporarily deployed to renku-ci-ui-1622 January 12, 2022 14:19 Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-1622 January 12, 2022 16:10 Inactive
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to Latex for the math block codes has worked!
All the previous errors (left) are gone and the formulas are rendered correctly (right) 🎉

Let's merge it as soon as the acceptance tests pass 🎉

Screenshot_20220112_171446

@andre-code andre-code changed the base branch from master to 1.0-next January 13, 2022 08:35
@andre-code andre-code deployed to renku-ci-ui-1622 January 13, 2022 08:35 Active
@andre-code andre-code merged commit e1a570f into 1.0-next Jan 13, 2022
@andre-code andre-code deleted the 1600-inline-math-formulas branch January 13, 2022 10:32
@RenkuBot
Copy link
Contributor

Tearing down the temporary RenkuLab deplyoment for this PR.

lorenzo-cavazzi pushed a commit that referenced this pull request Jan 14, 2022
Use Latex typesetting to support GitLab mathematical delimiters

fix #1622
ciyer pushed a commit that referenced this pull request Jan 26, 2022
Use Latex typesetting to support GitLab mathematical delimiters

fix #1622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline math formulas
3 participants