Latex support #531

Open
opened 2026-02-04 20:47:23 +03:00 by OVERLORD · 23 comments
Owner

Originally created by @hyer on GitHub (Dec 27, 2017).

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
Originally created by @hyer on GitHub (Dec 27, 2017). ### 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
OVERLORD added the 🔨 Feature Request label 2026-02-04 20:47:23 +03:00
Author
Owner

@Chris3Arcadia commented on GitHub (Jul 13, 2018):

Seems like KaTex could easily be added to the renderer : https://github.com/Khan/KaTeX

@Chris3Arcadia commented on GitHub (Jul 13, 2018): Seems like KaTex could easily be added to the renderer : https://github.com/Khan/KaTeX
Author
Owner

@pedrovhb commented on GitHub (Jul 31, 2018):

This would also be quite useful to me!

@pedrovhb commented on GitHub (Jul 31, 2018): This would also be quite useful to me!
Author
Owner

@Semihal commented on GitHub (Feb 18, 2020):

Hi! Please tell me how to install LaTeX support? How to integrate Latex?

@Semihal commented on GitHub (Feb 18, 2020): Hi! Please tell me how to install LaTeX support? How to integrate Latex?
Author
Owner

@homotechsual commented on GitHub (Feb 18, 2020):

@Semihal this doesn't exist as a feature yet.

@homotechsual commented on GitHub (Feb 18, 2020): @Semihal this doesn't exist as a feature yet.
Author
Owner

@Semihal commented on GitHub (Feb 18, 2020):

It is a pity that there is no support for Latex. The engine then doesn't make sense to me :(

@Semihal commented on GitHub (Feb 18, 2020): It is a pity that there is no support for Latex. The engine then doesn't make sense to me :(
Author
Owner

@toomastamm commented on GitHub (Mar 10, 2020):

If this had latex i'd install this in a heartbeat

@toomastamm commented on GitHub (Mar 10, 2020): If this had latex i'd install this in a heartbeat
Author
Owner

@homotechsual commented on GitHub (Mar 10, 2020):

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?

@homotechsual commented on GitHub (Mar 10, 2020): 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 2. 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?
Author
Owner

@toomastamm commented on GitHub (Mar 10, 2020):

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.

@toomastamm commented on GitHub (Mar 10, 2020): 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.
Author
Owner

@Semihal commented on GitHub (Mar 10, 2020):

@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).

@Semihal commented on GitHub (Mar 10, 2020): @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).
Author
Owner

@ssddanbrown commented on GitHub (Mar 10, 2020):

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 commented on GitHub (Mar 10, 2020): 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: ```latex $$\sqrt{3×-1}+(1+x)^2$$ ``` 5. Save the drawing and it'll be inserted in your page. 6. 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-
Author
Owner

@Semihal commented on GitHub (Mar 10, 2020):

@ssddanbrown, Hi!
How workaround works. But otherwise it is inconvenient (when there are a lot of formulas ).

@Semihal commented on GitHub (Mar 10, 2020): @ssddanbrown, Hi! How workaround works. But otherwise it is inconvenient (when there are a lot of formulas ).
Author
Owner

@Semihal commented on GitHub (Mar 10, 2020):

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

@Semihal commented on GitHub (Mar 10, 2020): This, unfortunately, does not work very correctly:( ![test](https://user-images.githubusercontent.com/21113432/76327383-fc274700-62fa-11ea-84f6-303934162111.png)
Author
Owner

@RyanGreenup commented on GitHub (Jun 3, 2020):

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

@RyanGreenup commented on GitHub (Jun 3, 2020): I managed to get math/latex notation working to a degree: 1. I just set up bookstack using [this docker compose](https://hub.docker.com/r/linuxserver/bookstack) 2. switched it to markdown-mode in the settings 3. Went to the settings and added mathjax to the *HTML* header [as described here](http://docs.mathjax.org/en/latest/web/start.html): ```html <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](https://user-images.githubusercontent.com/47832594/83656149-8b927c80-a602-11ea-957c-0ba129f0a989.png)
Author
Owner

@xind commented on GitHub (Jul 14, 2020):

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

Just enlarge the text to get full view.

@xind commented on GitHub (Jul 14, 2020): > This, unfortunately, does not work very correctly:( > ![test](https://user-images.githubusercontent.com/21113432/76327383-fc274700-62fa-11ea-84f6-303934162111.png) Just enlarge the text to get full view.
Author
Owner

@merkliopas commented on GitHub (Apr 6, 2021):

@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

Screenshot 2021-04-06 at 10 40 03

even though it is rendered correctly once I double click the diagram:

Screenshot 2021-04-06 at 10 41 25

is it a problem on BookStack side or Draw.io side? thanks

@merkliopas commented on GitHub (Apr 6, 2021): @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 ![Screenshot 2021-04-06 at 10 40 03](https://user-images.githubusercontent.com/6330027/113675878-7d026f00-96c4-11eb-8bb0-a9c1a982d396.png) even though it is rendered correctly once I double click the diagram: ![Screenshot 2021-04-06 at 10 41 25](https://user-images.githubusercontent.com/6330027/113676067-af13d100-96c4-11eb-9801-6d63ed788783.png) is it a problem on BookStack side or Draw.io side? thanks
Author
Owner

@Linbreux commented on GitHub (Apr 15, 2021):

@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 😉

@Linbreux commented on GitHub (Apr 15, 2021): @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): ![](https://user-images.githubusercontent.com/29354411/114780734-14785980-9d78-11eb-9b98-835c1b51cba8.png) exported image: ![](https://user-images.githubusercontent.com/29354411/114781097-83ee4900-9d78-11eb-88e2-432e4e8a631e.png) When I use export -> png the content is rendered correctly. ![](https://user-images.githubusercontent.com/29354411/114781333-d29be300-9d78-11eb-9f6a-a5a2df05bd9c.png) 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 😉
Author
Owner

@consecrate commented on GitHub (Oct 15, 2021):

I would love this feature!

@consecrate commented on GitHub (Oct 15, 2021): I would love this feature!
Author
Owner

@Hutch79 commented on GitHub (Jan 13, 2023):

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.

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

Source: https://www.mathjax.org/#gettingstarted

@Hutch79 commented on GitHub (Jan 13, 2023): 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. > <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> Source: https://www.mathjax.org/#gettingstarted
Author
Owner

@kimkyngt commented on GitHub (Aug 27, 2023):

It would be great to have a side-by-side editor! Scientists, mathematicians would love to have this feature.

@kimkyngt commented on GitHub (Aug 27, 2023): It would be great to have a side-by-side editor! Scientists, mathematicians would love to have this feature.
Author
Owner

@sfahmy commented on GitHub (Feb 19, 2024):

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.

@sfahmy commented on GitHub (Feb 19, 2024): 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.
Author
Owner

@Rami-Pastrami commented on GitHub (Nov 3, 2024):

Would love to see support for latex, and/or an editor like Microsoft office has that lets you quickly type in equations using a GUI editor

@Rami-Pastrami commented on GitHub (Nov 3, 2024): Would love to see support for latex, and/or an editor like Microsoft office has that lets you quickly type in equations using a GUI editor
Author
Owner

@erenirmak commented on GitHub (Mar 18, 2025):

I know there are workarounds, but is LaTeX too big or heavy to lead some overheads in terms of performance and/or system requirements ? in addition to markdown, isn't it possible to add full LaTeX support ?

@erenirmak commented on GitHub (Mar 18, 2025): I know there are workarounds, but is LaTeX too big or heavy to lead some overheads in terms of performance and/or system requirements ? in addition to markdown, isn't it possible to add full LaTeX support ?
Author
Owner

@mfide commented on GitHub (May 13, 2025):

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:

This looks great for me, thanks @RyanGreenup
Image

@mfide commented on GitHub (May 13, 2025): > I managed to get math/latex notation working to a degree: > > 1. I just set up bookstack using [this docker compose](https://hub.docker.com/r/linuxserver/bookstack) > 2. switched it to markdown-mode in the settings > 3. Went to the settings and added mathjax to the _HTML_ header [as described here](http://docs.mathjax.org/en/latest/web/start.html): > > <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 looks great for me, thanks @RyanGreenup ![Image](https://github.com/user-attachments/assets/b5a36252-581d-4554-9a96-defb988766db)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#531