Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions MJxPrep.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
* Modifies MathJax AsciiMath renderer to accept a variety of new functions
* Also defines a preprocessor for further beautification
*
* Options can be specified at the top of the script
* Custom replacements can be specified at the bottom of the script
*/

// Make sure that this script only loads once
if (window.MJxPrep) {
} else {
// Specify options
// Specify options here!
window.MJxPrepOptions = {
conj_as_star: false,
vectors_as_columns: true
Expand Down Expand Up @@ -81,12 +83,8 @@ if (window.MJxPrep) {
eqn = columnizeVectors(eqn)
}

/*
* If you want to do any custom preprocessing, here is the place to do it
*/



// Do any custom replacements (see end of script)
eqn = customReplacements(eqn)

// This is done last, so that it doesn't mess up subsequent processing
eqn = wrapVariables(eqn)
Expand Down Expand Up @@ -608,4 +606,13 @@ if (window.MJxPrep) {
columnizeVectors: columnizeVectors,
funcToPostfix: funcToPostfix
}

// A function to allow for custom replacements
function customReplacements(eqn) {
var working = eqn;

// Manipulate working however you like here!

return working;
}
}