gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

Cannot get latex / maths symbols to display in 'published' books

Open thacker7 opened this issue 10 years ago • 17 comments

Everything looks fine in edit mode. But in 'published' books, just see raw characters e.g. $$y = ax +b$$

https://drewbuchan.gitbooks.io/test-markdown-and-latext/content/

what am i doing wrong?

thacker7 avatar Jun 03 '16 14:06 thacker7

Hi,

Could you paste your book.json content?

Imre

nagim avatar Jun 06 '16 07:06 nagim

Hi Imre

I think this is it. Thanks Andrew

On Mon, Jun 6, 2016 at 8:45 AM, nagim [email protected] wrote:

Hi,

Could you paste your book.json content?

Imre

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GitbookIO/gitbook/issues/1356#issuecomment-223889489, or mute the thread https://github.com/notifications/unsubscribe/APPzlzsUT2CTWKw2acigaEnN1fOJ4cjeks5qI9AvgaJpZM4ItkBg .

thacker7 avatar Jun 06 '16 08:06 thacker7

Don't see anything, must be left out?

nagim avatar Jun 06 '16 08:06 nagim

I thought I had emailed a copy to you... Maye I sent wrong file. Where should I be getting this book.json file from?

thacker7 avatar Jun 06 '16 12:06 thacker7

You have a file name book.json in your book repo. Could you please open it and copy-paste the content? On Jun 6, 2016 2:17 PM, "thacker7" [email protected] wrote:

Sorry, you've lost me now. What else can I do to illustrate the problem?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GitbookIO/gitbook/issues/1356#issuecomment-223942359, or mute the thread https://github.com/notifications/unsubscribe/APdFOyV3NmR7KuB0wkLP35TYlaNDIzTOks5qJA_QgaJpZM4ItkBg .

nagim avatar Jun 06 '16 12:06 nagim

Okay, here it is. It is one of the plug-ins on your site.

{ "plugins": [ "autocover" ], "pluginsConfig": {} }

thacker7 avatar Jun 06 '16 13:06 thacker7

OK, depending on what syntax your're using, you must add the mathjax or katex plugin to your book config (book.json):

"plugins": [
        "autocover",
        "mathjax"
    ],
"pluginsConfig": {}
}

Run a build with the new config, it should be fine.

nagim avatar Jun 06 '16 13:06 nagim

same issue here.

act65 avatar Aug 23 '16 06:08 act65

Well, seems some equation cannot be generated successfully in pdf, but can be shown in the html page content.

Like $$\frac{a}{b}$$.

yeasy avatar Dec 04 '16 04:12 yeasy

Same issue here - any update on this?

books.json:

{
  "plugins": [
    "mathjax",
    "include-codeblock",
    "ace"
  ],
  "pluginsConfig": {
    "include-codeblock": {
      "template": "ace",
      "unindent": true,
      "theme": "monokai"
    }
  }
}

Math looks great in edit mode, but in regular mode, all math is omitted.

I think I figured out that if you do Command R to refresh without cache in chrome, then it reloads the math in the published version, so maybe mathjax is using a cache.

codekiln avatar Jun 23 '17 12:06 codekiln

I have same issue as @codekiln - latex does not display immediately in chrome but it appears on refresh.

cjdbarlow avatar Sep 20 '17 23:09 cjdbarlow

Are there any updates here? Same issue, latex renders beautifully in edit mode, but not in read mode or pdf (not even refreshing)

pbeltranp avatar Oct 12 '17 16:10 pbeltranp

@thacker7 please could you tell us how did you got rendered math expressions in your book?

pbeltranp avatar Oct 12 '17 17:10 pbeltranp

Same issue. I even couldn't find book.json file on the website. new to gitbook

WeiFoo avatar Oct 20 '17 04:10 WeiFoo

Same issue in published book, just see raw math expressions, but edit/read mode is ok.

xingdl2007 avatar Oct 31 '17 01:10 xingdl2007

I had the same issue and solved it by editing the book.json file to include "mathjax" into the plugins array.

book.json

{
"plugins": ["autocover", "mathjax"],
"pluginsConfig": {}
}

Yemolai avatar Nov 01 '17 13:11 Yemolai

Is there still updated? I have the similar issue. And I find when I use "gitbook build" and "gitbook install" in my local repo, it never recognizes my book.json whatever it includes. Here is my book.json { "plugins": [ "mathjax" ], "pluginsConfig": {} } But I clone a repo from user athacker, when I use “gitbook build”, it reminds me to install mathjax. Here is his book.json { "plugins": [ "mathjax" ], "pluginsConfig": {} } I nearlly give up. I have waste much time on it. Damn.

auroneboss avatar Dec 29 '17 13:12 auroneboss