Body: <p>I have a question similar to the one asked <a href="https://ebooks.stackexchange.com/questions/2348/using-the-same-javascript-library-several-times-in-an-ebook/7233#7233">here</a>, but I did not understand the answer given to that question. I would like to use mathjax and JSXGraphs in several widgets with iBooksAuthor, but I would like to add these only once. The default way is to add the necessary js libraries to every widget, but this way the resulting ibook gets very large. Can someone please give more details (or guide me to a website with more details) on how to do this without including these libraries in all widgets? </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-02T19:22:15.150Z
Comments.Text: The answer you linked to is the correct answer to your problem. It would help to know what part of that answer you were having difficulty understanding.
Comments.UserDisplayName: blendenzo
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-03T01:20:29.480Z
Comments.Text: When I look inside the ibook (with an archive manager) I don't see the .oebps folder. I can see an OPS folder, inside of which I can find assets/widgets. I assume this is where I need to store the js files. My main problem is that in the iBooksAuthor documentation ( https://support.apple.com/en-gb/HT204433 ) I see that widgets created by ibooks author cannot access the general file system. By placing the js files outside the widget, isn't this what I am asking the widget to do? Also, since I am adding a new file manually to the ibook, do I need to record it in some bookkeeping file?
Comments.UserDisplayName: Ferenc Beleznay
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-03T01:26:36.447Z
Comments.Text: @blendenzo : All in all, can this be done within iBooksAuthor or do I need to hack the file created by iBooksAuthor, in which case will my new file be compatible with the iBooks reader (I can try it now, but will it stay compatible in the future)?
Comments.UserDisplayName: Ferenc Beleznay
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-03T20:20:50.203Z
Comments.Text: Other files in the book archive are not the general filesystem, so the widgets should have no trouble accessing another file or folder inside the book. This info was confirmed by the OP on the question you linked. I don't use iBooksAuthor, but if I were trying to follow the instructions from the linked answer, I would put a Javascript folder in the OPS directory you are seeing, then use a relative URL to link to the script. Something like `<script src="../Javascript/my_script.js">`
Comments.UserDisplayName: blendenzo
Tags: <apple-books>
Title: using the same javascript library several times in an ibook
UserDisplayName: Ferenc Beleznay
ThreadText: # using the same javascript library several times in an ibook
  
  (Asked by: username_0 on 2017-06-02)
  
  I have a question similar to the one asked [here](https://ebooks.stackexchange.com/questions/2348/using-the-same-javascript-library-several-times-in-an-ebook/7233#7233), but I did not understand the answer given to that question. I would like to use mathjax and JSXGraphs in several widgets with iBooksAuthor, but I would like to add these only once. The default way is to add the necessary js libraries to every widget, but this way the resulting ibook gets very large. Can someone please give more details (or guide me to a website with more details) on how to do this without including these libraries in all widgets?
  
  **Tags:** apple-books
  
  > **Comments:**
  > **username_1**: The answer you linked to is the correct answer to your problem. It would help to know what part of that answer you were having difficulty understanding.  
  > **username_0**: When I look inside the ibook (with an archive manager) I don't see the .oebps folder. I can see an OPS folder, inside of which I can find assets/widgets. I assume this is where I need to store the js files. My main problem is that in the iBooksAuthor documentation ( https://support.apple.com/en-gb/HT204433 ) I see that widgets created by ibooks author cannot access the general file system. By placing the js files outside the widget, isn't this what I am asking the widget to do? Also, since I am adding a new file manually to the ibook, do I need to record it in some bookkeeping file?  
  > **username_0**: @username_1 : All in all, can this be done within iBooksAuthor or do I need to hack the file created by iBooksAuthor, in which case will my new file be compatible with the iBooks reader (I can try it now, but will it stay compatible in the future)?  
  > **username_1**: Other files in the book archive are not the general filesystem, so the widgets should have no trouble accessing another file or folder inside the book. This info was confirmed by the OP on the question you linked. I don't use iBooksAuthor, but if I were trying to follow the instructions from the linked answer, I would put a Javascript folder in the OPS directory you are seeing, then use a relative URL to link to the script. Something like `<script src="../Javascript/my_script.js">`  
  
  ---
  
  ## 0 answers
  
  