Skip to content

Commit

Permalink
Merge branch 'development' into pdf-long-lines
Browse files Browse the repository at this point in the history
  • Loading branch information
macite authored May 25, 2024
2 parents 490fdb5 + cdd9edc commit 757adba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/layouts/application.pdf.erbtex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions test/models/task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.]"
Expand Down
14 changes: 14 additions & 0 deletions test_files/submissions/vectorial_graph.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 757adba

Please sign in to comment.