BookStack
BookStack copied to clipboard
Latex support
For Feature Requests
Desired Feature: I wonder if the Latex expression will be support in the future. thanks.
For Bug Reports
- BookStack Version (Found in settings, Please don't put 'latest'):
- PHP Version:
- MySQL Version:
Expected Behavior
Current Behavior
Steps to Reproduce
Seems like KaTex could easily be added to the renderer : https://github.com/Khan/KaTeX
This would also be quite useful to me!
Hi! Please tell me how to install LaTeX support? How to integrate Latex?
@Semihal this doesn't exist as a feature yet.
It is a pity that there is no support for Latex. The engine then doesn't make sense to me :(
If this had latex i'd install this in a heartbeat
Not one person has actually expressed what latex support would look like. It's all well-and-good saying "it should have x" but this is open-source - which means:
- Provide more detail on what you're looking for if you're expecting other people to put in the effort.
or
- Add latex support yourself and submit a PR
Edit:
Are you looking for latex as another editor? Are you looking to be able to add latex expressions within TinyMCE?
I'm looking to include math formulas in the documentation I'm writing. So having the ability to add latex expressions and edit them later if needed within TinyMCE and having them rendered as an image is what I am looking for yes.
This plugin for TinyMCE pretty much replicates what I am looking for: http://latex.codecogs.com/eqneditor/integration/tinymce_v4/install.php
The plugin has a bunch of shortcuts for latex that is not what I need but might be useful for others.
@MikeyMJCO , Hi! @toomastamm suggested a good option or maybe just enable Latex support. I would like to write formulas inside the $latex$ or $$latex$$ (for centered) tag, and after opening the page, they are drawn (this allows KaTeX do).
It is kind of possible to insert Latex in the BookStack editor right now through the draw.io integration:
- Edit your page.
- Click the drawing (Shapes) icon in the top editor bar (WYSIWYG editor), Draw.io will open.
- In the toolbar at the top enable: Extras > Mathematical Typesetting
- Insert a text section and insert latex text like so:
$$\sqrt{3×-1}+(1+x)^2$$
- Save the drawing and it'll be inserted in your page.
- Double click the drawing to re-edit.
Draw.io page for reference: https://desk.draw.io/support/solutions/articles/16000032875-how-to-use-mathematical-typesetting-
@ssddanbrown, Hi! How workaround works. But otherwise it is inconvenient (when there are a lot of formulas ).
This, unfortunately, does not work very correctly:(
I managed to get math/latex notation working to a degree:
- I just set up bookstack using this docker compose
- switched it to markdown-mode in the settings
- Went to the settings and added mathjax to the HTML header as described here:
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
this rendered math just fine for me, granted it would require web access but you could download the library locally if you wanted I should imagine.
here's a screenshot:
This, unfortunately, does not work very correctly:(
Just enlarge the text to get full view.
@ssddanbrown latex integration via draw.io would suffice but if try to do it on the demo site for BookStack - this does not seem to work
even though it is rendered correctly once I double click the diagram:
is it a problem on BookStack side or Draw.io side? thanks
@merkliopas I got the same problem. I guess this is an export problem from drawio. Went to the drawio site and tried to embed it as an image.
app.diagrams.net -> embed -> image (guess this is used for bookstack):
exported image:
When I use export -> png the content is rendered correctly.
For now you can copy the embedded code (image/svg) and paste it in the source of the page. For some reason this works. Hopefully this will be resolved because this is one of the few ways to write math in bookstack 😉
I would love this feature!
Since this request is still open, here is a possible solution everyone can do themselves.
You can simply add the following scripts to your Custom HTML to render MathJAX. Important to know: This does not work with Exporting the Book/Page. If you print it to a PDF it works fine.
Source: https://www.mathjax.org/#gettingstarted
It would be great to have a side-by-side editor! Scientists, mathematicians would love to have this feature.
The MathJAX script works well, but every time you edit the page (in Markdown mode at least) it somehow strips off the delimiters and turns the LaTeX into just native text characters. Anyone know why this might be or a workaround? I do agree that this is an important feature for various academic uses.