diff --git a/app/views/layouts/application.pdf.erbtex b/app/views/layouts/application.pdf.erbtex index 1eafb3d38..150c455f0 100644 --- a/app/views/layouts/application.pdf.erbtex +++ b/app/views/layouts/application.pdf.erbtex @@ -13,7 +13,7 @@ \input|"python3 jupynotex.py #2 #1" } -\usepackage[fencedCode,hashEnumerators]{markdown} +\usepackage[fencedCode,hashEnumerators,pipeTables,texMathDollars]{markdown} \usepackage{luatextra} \defaultfontfeatures{Ligatures=TeX} diff --git a/test/models/task_test.rb b/test/models/task_test.rb index b8e73a412..1de9c9d9e 100644 --- a/test/models/task_test.rb +++ b/test/models/task_test.rb @@ -1,4 +1,5 @@ require 'test_helper' +require 'pdf-reader' # # Contains tests for Task model objects - not accessed via API @@ -357,6 +358,10 @@ def test_ipynb_to_pdf assert File.exist? path assert File.exist? task.final_pdf_path + # Test if latex math was rendered properly + reader = PDF::Reader.new(task.final_pdf_path) + assert reader.pages[3].text.include? "bmi = weigh2\n height" + td.destroy assert_not File.exist? path unit.destroy! diff --git a/test_files/submissions/vectorial_graph.ipynb b/test_files/submissions/vectorial_graph.ipynb index 3176f1dab..1575481cb 100644 --- a/test_files/submissions/vectorial_graph.ipynb +++ b/test_files/submissions/vectorial_graph.ipynb @@ -937,6 +937,20 @@ "source": [ "Testing a raw cell with $10 invalid latex code" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Testing inline latex math display" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Formula for calculating BMI: $\\text{bmi}=\\frac{\\text{weight}}{\\text{height}^2}$" + ] } ], "metadata": {