From 62ba36a4c696d93578ab731a0da323427b97d492 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Thu, 10 Jun 2021 16:36:03 -0500 Subject: [PATCH] Add problem pdf using browser print --- templates/problem/problem.html | 39 ++++++++++++++++++++++++++-------- templates/problem/raw.html | 26 ++++++++++++----------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/templates/problem/problem.html b/templates/problem/problem.html index 65bd6a3..9dab1f6 100644 --- a/templates/problem/problem.html +++ b/templates/problem/problem.html @@ -41,11 +41,28 @@ .problem-info-entry { padding-top: 0.5em; } + + #raw_problem { + visibility: hidden; + width: 0; + height: 0; + } {% endblock %} {% block content_js_media %} {% include "comments/media-js.html" %} + {% endblock %} {% block title_row %} @@ -81,16 +98,19 @@ {% endfor %} {% endif %} - {% if has_pdf_render %} - - - - - - - {{ _('View as PDF') }} - + + + {% if has_render %} + + {% else %} + {% endif %} + + + + + {{ _('View as PDF') }} + {% endblock %} @@ -324,6 +344,7 @@ {% else %} {% include "comments/list.html" %} {% endif %} + {% endblock %} {% block bodyend %} diff --git a/templates/problem/raw.html b/templates/problem/raw.html index 573db37..bca3412 100644 --- a/templates/problem/raw.html +++ b/templates/problem/raw.html @@ -1,6 +1,8 @@ + + @@ -79,18 +81,18 @@
- {{ description|markdown('problem', 'tex' if math_engine == 'jax' else math_engine)|reference|absolutify(url)|str|safe }} + {{ description|markdown('problem', 'tex')|reference|absolutify(url)|str|safe }}
-{% if math_engine == 'jax' %} - - - -{% endif %} + + + + +