Draft
Conversation
This is a work in progress, little fun experiment, of rendering document written in tex in the web app. There's `notes/notex.tex` file with some complex equations. First I used `pandoc` to convert tex to markdown: ```bash sudo apt-get install pandoc pandoc -s notes/notes.tex -o web/src/content/en/Notes.md ``` Then I replaced home page content with the generated `web/src/content/en/Notes.md`. I use `remark-math` and `rehype-katex`plugins for the `@next/mdx` renderer. I had to also add global CSS from `katex` so that formulas look a bit prettier. I had to remove `%` comment from the formula in the tex file, because it was confusing the parser it seems and it generated red unformatted text past the `%` sign . The document has hard line breaks at char 80, and this unfortunately translates into line breaks in the final render too, even though I'd expect it not to. This might be configurable (by i.e. using GitHub flavor of markdown rendering). Otherwise we could tell doc authors to remove the hard breaks and use soft-wrap in the editor instead. Otherwise it seems to be working very well. This feature might allow to: - have shared tex snippets, let's say between a paper and the website - add formulas to existing markdown content
| The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a work in progress, little fun experiment, of rendering document written in tex in the web app.
There's
notes/notex.texfile with some complex equations. First I usedpandocto convert tex to markdown:Then I replaced home page content with the generated
web/src/content/en/Notes.md.I use
remark-mathandrehype-katexplugins for the@next/mdxrenderer. I had to also add global CSS fromkatexso that formulas look a bit prettier.I had to remove
%comment from the formula in the tex file, because it was confusing the parser it seems and it generated red unformatted text past the%sign .The document has hard line breaks at char 80, and this unfortunately translates into line breaks in the final render too, even though I'd expect it not to. This might be configurable (by i.e. using GitHub flavor of markdown rendering). Otherwise we could tell doc authors to remove the hard breaks and use soft-wrap in the editor instead.
Some styling will be needed, but otherwise it seems to be working very well. This feature might allow to: