diff --git a/README.md b/README.md
index 86a89943..1bb66241 100644
--- a/README.md
+++ b/README.md
@@ -112,6 +112,7 @@ Options:
--live-preview Enables livepreview.
--allow-uploads [MODE] Allows file uploads. Modes: dir (default, store all uploads in the same directory), page (store each upload at the same location as the page).
--mathjax Enables mathjax.
+ --mathjax-config [SOURCE] Inject custom mathjax config. Uses mathjax.config.js from root repository by default
--user-icons [SOURCE] Set the history user icons. Valid values: gravatar, identicon, none. Default: none.
--show-all Shows all files in file view. By default only valid pages are shown.
--collapse-tree Collapse file view tree. By default, expanded tree is shown.
diff --git a/bin/gollum b/bin/gollum
index 3a4908e2..4a5c1f4a 100755
--- a/bin/gollum
+++ b/bin/gollum
@@ -93,6 +93,10 @@ opts = OptionParser.new do |opts|
wiki_options[:mathjax] = true
end
+ opts.on("--mathjax-config [SOURCE]", "Inject custom mathjax config file. Uses mathjax.config.js from root repository by default") do |source|
+ wiki_options[:mathjax_config] = source || 'mathjax.config.js'
+ end
+
opts.on("--user-icons [SOURCE]", "Set the history user icons. Valid values: gravatar, identicon, none. Default: none.") do |source|
wiki_options[:user_icons] = source
end
diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb
index 600ec654..d5000efe 100644
--- a/lib/gollum/app.rb
+++ b/lib/gollum/app.rb
@@ -91,6 +91,7 @@ module Precious
settings.wiki_options.merge!({ :base_path => @base_url })
@css = settings.wiki_options[:css]
@js = settings.wiki_options[:js]
+ @mathjax_config = settings.wiki_options[:mathjax_config]
end
get '/' do
diff --git a/lib/gollum/templates/layout.mustache b/lib/gollum/templates/layout.mustache
index 7c58bdd4..805b6361 100644
--- a/lib/gollum/templates/layout.mustache
+++ b/lib/gollum/templates/layout.mustache
@@ -31,15 +31,21 @@
{{/use_identicon}}
{{#mathjax}}
-
+ {{/mathjax_config}}
+ {{#mathjax_config}}
+
+ {{/mathjax_config}}