diff --git a/ford/output.py b/ford/output.py
index <HASH>..<HASH> 100644
--- a/ford/output.py
+++ b/ford/output.py
@@ -249,14 +249,12 @@ class Documentation(object):
                 shutil.copy(src.path, os.path.join(out_dir, "src", src.name))
 
         if "mathjax_config" in self.data:
-            os.mkdir(os.path.join(out_dir, "js", "MathJax-config"))
+            mathjax_path = os.mkdir(os.path.join(out_dir, "js", "MathJax-config"))
+            if not os.path.join(mathjax_config)
+                os.mkdir(mathjax_config)
             shutil.copy(
                 self.data["mathjax_config"],
-                os.path.join(
-                    out_dir,
-                    "js",
-                    "MathJax-config",
-                    os.path.basename(self.data["mathjax_config"]),
+                os.path.join(mathjax_config, os.path.basename(self.data["mathjax_config"]),
                 ),
             )
         # By doing this we omit a duplication of data.
Don't fail when MathJax-config dir already exists

Only create the directory MathJax-config when it doesn't exist yet. Avoids a crash with FileExistsError, which I don't see why it should be fatal.