diff --git a/lms/templates/courseware.html b/lms/templates/courseware.html
index 78114d601f..eb8aed7e1b 100644
--- a/lms/templates/courseware.html
+++ b/lms/templates/courseware.html
@@ -28,28 +28,8 @@
<%static:js group='courseware'/>
-
-
-
-
-
-
-
-
-
+ <%include file="discussion/_js_dependencies.html" />
+
+
+ ## This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
+ ## It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of MathJax extension libraries
+
+
+
+
+
+
+
+
+
+
diff --git a/lms/templates/discussion/index.html b/lms/templates/discussion/index.html
index 6a1ab7d130..cb5b42333c 100644
--- a/lms/templates/discussion/index.html
+++ b/lms/templates/discussion/index.html
@@ -8,33 +8,7 @@
%block>
<%block name="js_extra">
-
-
-
- ## This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
- ## It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of MathJax extension libraries
-
-
-
-
-
-
-
-
-
-
+<%include file="_js_dependencies.html" />
%block>
<%include file="../course_navigation.html" args="active_page='discussion'" />