Is there a way to customize the directory for MathJax's configuration files?

I have set up MathJax to load from my server and concatenated it with my other JS assets in order to boost performance. Initially, when I loaded the source file from the MathJax vendor directory, everything worked smoothly:

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
      processEscapes: true
    },
    "HTML-CSS": { availableFonts: ["TeX"] }
  });
</script>
<script src="http://example.com/assets-raw/vendor/MathJax/MathJax.js" ></script>

However, after minifying and concatenating MathJax.js with my other assets, the combined JS file is now located in a different directory:

<script src="http://example.com/assets/js/minified.js" ></script>

The issue arises because MathJax can no longer locate files such as config.js and tex2jax.js along with its dependencies. It appears that MathJax relies on a default directory structure where these files are expected to be found.

In MathJax's documentation, they mention statements like

The default directory is MathJax/extensions/

However, there seems to be no clear instruction on how to override this default setting through MathJax's configuration. Is it even possible to do so?

Answer №1

There seems to be a hidden configuration option called root, which can be utilized to specify the root path in the Config settings. Here’s an example:

root: 'http://example.com/assets-raw/vendor/MathJax'

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing either Maps or Objects in Typescript

I'm in the process of developing a simple Pizza Ordering App. The concept is, you select a pizza from a list and it's added to a summary that groups all the selections together. Here's how I want it to appear: Pizza Margarita 2x Pizza Sala ...

Each div will display the same image twice when loading the image

I have a grid where images are dynamically loaded with a link to a lightbox. Currently, this is how I am achieving it: $(".selection_thumb").each( function(i) { $(this).append("<a data-lightbox='image-1' href='img/folder/folder/"+(++ ...

Is there a way to export a single page in NextJS?

How can I create a build and export a specific page in NextJS? For example, I would like to have only one specific HTML page in the "out" directory as a result. ...

What is the best way to maintain an active PostgreSQL connection?

Essentially, I establish my database client using the following code: client = new pg.Client(conString); client.connect(); However, after a period of inactivity on the database, the client connection is likely dropped and results in this error message: ...

In JavaScript, what is the maximum length permitted for the window.returnValue property?

When using window.returnValue (variant) in a modal, is there a maximum length restriction to be aware of? I have a setup where I call a modal window utilizing showModalDialog() and then retrieve a comma-separated string as a result. This string represents ...

Loading a div using Ajax within a frame

My php page includes a div that is supposed to be populated by an Ajax call. function showcopay() { var apa = document.getElementById("alert_id").value; $("#copay").load('show_copay.php?pid='+apa); } The parent page of the div used to be ...

What is the method for adding pages to the ion-nav component in Ionic with Angular?

How can I implement a UINavigationController-like functionality in iOS using an ion-nav element? The example provided here is in Javascript, but I need assistance with implementing it in Angular. Specifically, I'm unsure of how to programmatically add ...

What steps can be taken to achieve real-time capabilities for this websocket?

I've been working on integrating websockets with express on the backend and using the browser's native websocket API on the client side. I've successfully managed to send and receive messages between the client and server, but it only seems ...

Searching with Regex, excluding the initial character from the match

It's been a while since I last wrote JavaScript, so any mistakes are probably very obvious. I'm currently facing an issue with using RegExp.match(..) in JavaScript. It seems to be skipping the first character in the strings that are being search ...

Troubleshooting Problems with array.filter() Method in JavaScript

Currently, I am working on a JavaScript function that seems to be functioning properly in all browsers except for IE and Safari. Strangely enough, my editor is flagging an error on line 4. The function's basic concept involves taking the ID of an HTML ...

The addition of special characters to strings in TypeScript through JavaScript is not functioning as expected

I need assistance on conditionally appending a string based on values from captured DOM elements. When the value is empty, I want to include the special character "¬". However, when I try adding it, I get instead because the special character is not reco ...

Adjust dimensions of images in Bee3D carousel

I recently utilized the Bee3d library available on the following Github link: https://github.com/lukeed/bee3d While I found everything to be truly impressive, I am curious if there is a way to adjust the image size. Whenever I attempt to change the image ...

Tips for successfully using a string with a slash ("/") as a parameter in a route within vue.js

Currently, I am utilizing Vue Router with a specific route setup { path: '/my-route/:param?', component: MyComponent } To link to this route, I have created the following link <router-link :to="'/my-route/'+myParam">Link text&l ...

Styling text in JavaScript and CSS with colored fonts and underlines

I am looking to customize the CSS for the font style. <div id="a" onmouseover="chbg('red','b')" onmouseout="chbg('white','b')">This will change b element</div> <div id="b">This is element b</div ...

Encountering issues when trying to combine Sequelize with TypeScript

As I attempted to transition my NodeJs application to TypeScript, I encountered issues with Sequelize. Upon attempting to implement the code from a website, an error occurred: This expression is not constructable. Type 'typeof import("/home/de ...

When using node.js, the initial request yields no response while the subsequent request provides the expected data

Currently, I am in the process of setting up a node.js API using Express, Body-parser, and MySQL. An issue I am encountering is that when making a GET request to a route for the first time, it returns blank. However, on the second attempt, it retrieves th ...

``AngularJS: Harnessing the Power of Nested Arrays with ng-repeat

I've hit a roadblock on this one. After browsing through numerous answers on Stack Overflow, I've gained insight into creating nested arrays and utilizing .json files. Despite this, I still can't seem to pinpoint where I'm going wrong. ...

Understanding the relationship between JavaScript UI components and their impact on HTML is essential in grasping

Many JavaScript UI components, such as jQuery UI, Bootstrap, or Kendo UI, take an HTML element and dynamically render themselves. For example: $('#someselect').autocomplete(); I am curious if these frameworks can be successfully integrated wit ...

Exploring the Limits with VUE Trailing Path Queries

My goal is to implement an optional query language functionality. When a user visits localhost/#/, the page should automatically redirect to localhost/#/?lang=en (defaulting to English). If the user navigates to /localhost/#/?lang=es, the site will displa ...

Unlock the potential of HTML5 Datalist: A comprehensive guide on integrating it with

The latest version of HTML, HTML5, has introduced a new tag called datalist. This tag, when connected to <input list="datalistID">, allows for autocomplete functionality on web forms. Now the question arises - what is the most efficient approach to ...