diff --git a/app/views/layouts/application.pdf.erbtex b/app/views/layouts/application.pdf.erbtex index 59e40ed56..ab70189c8 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' '95'" } -\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 0951a7858..28171ca72 100644 --- a/test/models/task_test.rb +++ b/test/models/task_test.rb @@ -358,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" + # ensure the notice is not included when the notebook doesn't have long lines source code cells reader = PDF::Reader.new(task.final_pdf_path) assert_not reader.pages[1].text.gsub(/\s+/, " ").include? "[The rest of this line has been truncated by the system to improve readability.]" 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": {