diff --git a/scipost/templatetags/texfilters.py b/scipost/templatetags/texfilters.py index aa755d998bd6d533e54f29838c8f69805df0bdc0..f8e3d05e6f587e54ef526741ccd29c4e0f7ebce7 100644 --- a/scipost/templatetags/texfilters.py +++ b/scipost/templatetags/texfilters.py @@ -16,3 +16,11 @@ def linebreaktex(value, autoescape=True): if autoescape: value = escape(value) return mark_safe(value.replace('\n', '\\ \n')) + + +@register.filter(is_safe=False, needs_autoescape=True) +def safe_tex_url(value, autoescape=True): + """ + Convert all newlines in a piece of plain text to HTML line breaks + """ + return mark_safe(value.replace('#', '\#')) diff --git a/submissions/templates/submissions/_refereeing_pack_tex_template.html b/submissions/templates/submissions/_refereeing_pack_tex_template.html new file mode 100644 index 0000000000000000000000000000000000000000..38081a3cd0398caede27c10dae487702b3ad1bfd --- /dev/null +++ b/submissions/templates/submissions/_refereeing_pack_tex_template.html @@ -0,0 +1,198 @@ +{% load texfilters %}\documentclass{SciPost} + +% Prevent all line breaks in inline equations. +\binoppenalty=10000 +\relpenalty=10000 + +\hypersetup{ + colorlinks, + linkcolor={red!50!black}, + citecolor={blue!50!black}, + urlcolor={blue!80!black} +} + +\usepackage[bitstream-charter]{mathdesign} +\urlstyle{sf} + +\fancypagestyle{SPstyle}{ +\fancyhf{} +\lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} + +{% if report.doi_string %} + \rhead{\small \href{https://scipost.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} +{% endif %} + +\renewcommand{\headrulewidth}{1pt} +\fancyfoot[C]{\textbf{\thepage}} +} + +\begin{document} + +\pagestyle{SPstyle} + +\begin{center} +\Large\color{scipostdeepblue}{\textbf{ +%%%%%%%%%% TITLE + AUTHORS +Refereeing Package of\href{https://scipost.org{{submission.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{submission.title}} }}by {{submission.author_list}} +}} +\end{center} + +\begin{center} +\Large\color{scipostdeepblue}{\textbf{ +%%%%%%%%%% ARXIV CODE +\href{https://scipost.org{{submission.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{submission.arxiv_identifier_w_vn_nr}} }} +}} +\end{center} + +\vspace{10pt} + +%%%%%%%%%% DATES +\small{\ \\Received {{submission.submission_date|date:'d-m-Y'}}\newline +{% if submission.acceptance_date %}Accepted {{submission.acceptance_date|date:'d-m-Y'}} \newline{% endif %} +Submitted to {{submission.get_submitted_to_journal_display}} +} + + +%%%%% TABLE OF CONTENT +\vspace{10pt} +\noindent\rule{\textwidth}{1pt} +\tableofcontents +\noindent\rule{\textwidth}{1pt} +\vspace{10pt} + + +%%%%%%%%%% CONTENT + +{% for report in submission.reports.accepted %} + \newpage + \setcounter{section}{0} + + \addcontentsline{toc}{section}{\protect\numberline{}Report {{report.report_nr}}{% if report.doi_string %} $\cdot$ doi: {{report.doi_string|safe_tex_url}}{% endif %} } + + \fancypagestyle{SPstylereport{{report.id}} }{ + \fancyhf{} + \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} + + {% if report.doi_string %} + \rhead{\small \href{https://scipost.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} + {% endif %} + + \renewcommand{\headrulewidth}{1pt} + \fancyfoot[C]{\textbf{\thepage}} + } + \pagestyle{SPstylereport{{report.id}} } + + \begin{center} + \Large\color{scipostdeepblue}{\textbf{ + %%%%%%%%%% TITLE + Report {{report.report_nr}} on\href{https://scipost.org{{report.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{report.submission.title}} }}by {{report.submission.author_list}} + }} + \end{center} + + {% if report.doi_string %} + \begin{center} + \Large\color{scipostdeepblue}{\textbf{ + %%%%%%%%%% TITLE + doi:\href{ https://scipost.org{{report.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{report.doi_string|safe_tex_url}} }} + }} + \end{center} + {% endif %} + + \begin{center} + \large\textbf{ + %%%%%%%%%% AUTHORS + Report by {% if report.anonymous %}anonymous{% else %}{{report.author.user.first_name}} {{report.author.user.last_name}}\textsuperscript{1}{% endif %} + } + \end{center} + + {% if not report.anonymous %} + \begin{center} + %%%%%%%%%% AFFILIATIONS + {\bf 1} {{report.author.affiliation}}\\ + \end{center} + {% endif %} + + + \vspace{10pt} + + + \begin{center} + \begin{tabular}{lr} + \begin{minipage}{0.5\textwidth} + \raisebox{-1mm}[0pt][0pt]{\includegraphics[width=12mm]{by.eps}} + + %%%%%%%%%% COPYRIGHT + + {\small Copyright {% if report.anonymous %}anonymous{% else %}{{report.author.user.first_name}} {{report.author.user.last_name}}{% endif %}. \newline + This work is licensed under the Creative Commons \newline + \href{http://creativecommons.org/licenses/by/4.0/}{Attribution 4.0 International License}. \newline + Published by the SciPost Foundation. + } + \end{minipage} + & + \begin{minipage}{0.5\textwidth} + %%%%%%%%%% DATES + {\small Received {{report.date_submitted|date:'d-m-Y'}} + + } + \end{minipage} + \end{tabular} + \end{center} + + \vspace{10pt} + \noindent\rule{\textwidth}{1pt} + + %%%%%%%% CONTENTS + + \section*{Ratings} + \begin{center} + \begin{tabular}{r p{0.15\columnwidth} r l} + {\bf Validity} & {{report.get_validity_display}} & {\bf Clarity} & {{report.get_clarity_display}} \\ + {\bf Significance} & {{report.get_significance_display}} & {\bf Formatting} & {{report.get_formatting_display}} \\ + {\bf Originality} & {{report.get_originality_display}} & {\bf Grammar} & {{report.get_grammar_display}} + \end{tabular} + \end{center} + + \section*{Strengths} + {{report.strengths|linebreaktex}} + + \section*{Weaknesses} + {{report.weaknesses|linebreaktex}} + + \section*{Report} + {{report.report|linebreaktex}} + + + \section*{Requested changes} + {{report.requested_changes|linebreaktex}} + + + {% if report.comment_set.vetted %} + \newpage + \pagestyle{SPstyle} + \section*{Comments and Author Replies to this Report} + + {% for comment in report.comment_set.vetted %} + \addcontentsline{toc}{subsection}{\protect\numberline{}{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} to Report by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + + \subsection*{ {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} to Report by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + {% include 'comments/_comment_tex_template.html' with comment=comment %} + {% endfor %} + {% endif %} + +{% endfor %} + +{% if submission.comments.vetted %} + \newpage + \setcounter{section}{0} + \pagestyle{SPstyle} + + {% for comment in submission.comments.vetted %} + \addcontentsline{toc}{section}{\protect\numberline{}{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + + \section*{ {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + {% include 'comments/_comment_tex_template.html' with comment=comment %} + {% endfor %} +{% endif %} + +\end{document} diff --git a/submissions/templates/submissions/_report_tex_template.html b/submissions/templates/submissions/_report_tex_template.html index 2d652af43a118cedac3bf874ff5261709257d6bd..7d6d3c0c41eacf2df1b55602ae373f772ad03792 100644 --- a/submissions/templates/submissions/_report_tex_template.html +++ b/submissions/templates/submissions/_report_tex_template.html @@ -17,11 +17,11 @@ \fancypagestyle{SPstyle}{ \fancyhf{} \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} -%%%%%%%%%% TODO: PAPER CITATION + {% if report.doi_string %} - \rhead{\small \href{https://scipost.org/{{report.doi_string}} }{ {{report.doi_string}} ({{report.date_submitted|date:'Y'}})}} + \rhead{\small \href{https://scipost.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} {% endif %} -%%%%%%%%%% END TODO: PAPER CITATION + \renewcommand{\headrulewidth}{1pt} \fancyfoot[C]{\textbf{\thepage}} } @@ -30,31 +30,23 @@ \pagestyle{SPstyle} -%\begin{center}{\Large{ \textbf{\color{scipostdeepblue}{ -%Report {{report.report_nr}} -%}}}} \\ -%\end{center} - \begin{center} \Large\color{scipostdeepblue}{\textbf{ -%%%%%%%%%% TODO: TITLE Paste title here -% multiline titles: end with a \\ to regularize line spacing -%%%%%%%%%% END TODO: TITLE -Report {{report.report_nr}} on \href{https://scipost.org/submissions/1702.01010v1/}{\color{scipostdeepblue}{Variation along liquid isomorphs of the driving force for crystallization}} by Ulf R. Pedersen, Karolina Adrjanowicz, Kristine Niss, Nicholas P. Bailey +%%%%%%%%%% TITLE +Report {{report.report_nr}} on\href{https://scipost.org{{report.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{report.submission.title}} }}by {{report.submission.author_list}} }} \end{center} \begin{center} \large\textbf{ -%%%%%%%%%% TODO: AUTHORS +%%%%%%%%%% AUTHORS Report by {% if report.anonymous %}anonymous{% else %}{{report.author.user.first_name}} {{report.author.user.last_name}}\textsuperscript{1}{% endif %} -%%%%%%%%%% END TODO: AUTHORS } \end{center} {% if not report.anonymous %} \begin{center} - %%%%%%%%%% TODO: AFFILIATIONS + %%%%%%%%%% AFFILIATIONS {\bf 1} {{report.author.affiliation}}\\ \end{center} {% endif %} @@ -68,10 +60,10 @@ Report by {% if report.anonymous %}anonymous{% else %}{{report.author.user.first \begin{minipage}{0.5\textwidth} \raisebox{-1mm}[0pt][0pt]{\includegraphics[width=12mm]{by.eps}} -%%%%%%%%%% TODO: COPYRIGHT Include the first author's initials and last name +%%%%%%%%%% COPYRIGHT {\small Copyright {% if report.anonymous %}anonymous{% else %}{{report.author.user.first_name}} {{report.author.user.last_name}}{% endif %}. \newline -%%%%%%%%%% END TODO: COPYRIGHT + This work is licensed under the Creative Commons \newline \href{http://creativecommons.org/licenses/by/4.0/}{Attribution 4.0 International License}. \newline Published by the SciPost Foundation. @@ -79,15 +71,13 @@ Published by the SciPost Foundation. \end{minipage} & \begin{minipage}{0.5\textwidth} -%%%%%%%%%% TODO: DATES -{\small Received {{report.date_submitted}} -%%%%%%%%%% END TODO: DATES +%%%%%%%%%% DATES +{\small Received {{report.date_submitted|date:'d-m-Y'}} -{% if report.doi_string %} -%%%%%%%%%% TODO: DOI -\newline \doi{ {{report.doi_string}} } -%%%%%%%%%% END TODO: DOI +{% if report.doi_string %} +%%%%%%%%%% DOI +\newline \doi{ {{report.doi_string|safe_tex_url}} } {% endif %} @@ -96,15 +86,10 @@ Published by the SciPost Foundation. \end{tabular} \end{center} -%%%%%%%%%% TODO: TOC include a table of contents (optional) -% Guideline: if your paper is longer that 6 pages, include a TOC -% To remove the TOC, simply cut the following block \vspace{10pt} \noindent\rule{\textwidth}{1pt} -%%%%%%%%%% END TODO: TOC -%%%%%%%%% TODO: CONTENTS Contents come here, starting from first \section -%%%%%%%%%% TODO: LINENO Activate linenumbers during proofs stage +%%%%%%%% CONTENTS \section*{Ratings} \begin{center} @@ -115,8 +100,6 @@ Published by the SciPost Foundation. \end{tabular} \end{center} -%\vspace{10pt} - \section{Strengths} {{report.strengths|linebreaktex}} @@ -130,7 +113,5 @@ Published by the SciPost Foundation. \section{Requested changes} {{report.requested_changes|linebreaktex}} -%%%%%%%%% END TODO: CONTENTS - \end{document} diff --git a/submissions/templates/submissions/reports_pdf_compile.html b/submissions/templates/submissions/reports_pdf_compile.html index ec589e3041a93937562bb617f1c15aa68bd8b8a5..9f75ef0eab2261c00bd0560f225e2c2e3347952e 100644 --- a/submissions/templates/submissions/reports_pdf_compile.html +++ b/submissions/templates/submissions/reports_pdf_compile.html @@ -24,7 +24,7 @@ <div class="row"> <div class="col-12"> <h3>Please process this code in your Tex Compiler:</h3> - <pre class="clickfocus"><code>{% include 'submissions/_report_tex_template.html' with report=report %}</code></pre> + <pre class="clickfocus" style="max-height: 200px;"><code>{% include 'submissions/_report_tex_template.html' with report=report %}</code></pre> </div> </div>