Bookstack: Latex support

Created on 27 Dec 2017  路  14Comments  路  Source: BookStackApp/BookStack

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
Feature Request

Most helpful comment

I managed to get math/latex notation working to a degree:

  1. I just set up bookstack using this docker compose
  2. switched it to markdown-mode in the settings
  3. 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:

screenshot

All 14 comments

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:

  1. Provide more detail on what you're looking for if you're expecting other people to put in the effort.

or

  1. 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:

  1. Edit your page.
  2. Click the drawing (Shapes) icon in the top editor bar (WYSIWYG editor), Draw.io will open.
  3. In the toolbar at the top enable: Extras > Mathematical Typesetting
  4. Insert a text section and insert latex text like so:
$$\sqrt{3脳-1}+(1+x)^2$$
  1. Save the drawing and it'll be inserted in your page.
  2. 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:(
test

I managed to get math/latex notation working to a degree:

  1. I just set up bookstack using this docker compose
  2. switched it to markdown-mode in the settings
  3. 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:

screenshot

This, unfortunately, does not work very correctly:(
test

Just enlarge the text to get full view.

Was this page helpful?
0 / 5 - 0 ratings