SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 4213e06f authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Add Tex/Django-Templates

parent 0a2397b4
No related branches found
No related tags found
No related merge requests found
...@@ -16,3 +16,11 @@ def linebreaktex(value, autoescape=True): ...@@ -16,3 +16,11 @@ def linebreaktex(value, autoescape=True):
if autoescape: if autoescape:
value = escape(value) value = escape(value)
return mark_safe(value.replace('\n', '\\ \n')) 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('#', '\#'))
{% 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}
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
\fancypagestyle{SPstyle}{ \fancypagestyle{SPstyle}{
\fancyhf{} \fancyhf{}
\lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} \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 %} {% 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 %} {% endif %}
%%%%%%%%%% END TODO: PAPER CITATION
\renewcommand{\headrulewidth}{1pt} \renewcommand{\headrulewidth}{1pt}
\fancyfoot[C]{\textbf{\thepage}} \fancyfoot[C]{\textbf{\thepage}}
} }
...@@ -30,31 +30,23 @@ ...@@ -30,31 +30,23 @@
\pagestyle{SPstyle} \pagestyle{SPstyle}
%\begin{center}{\Large{ \textbf{\color{scipostdeepblue}{
%Report {{report.report_nr}}
%}}}} \\
%\end{center}
\begin{center} \begin{center}
\Large\color{scipostdeepblue}{\textbf{ \Large\color{scipostdeepblue}{\textbf{
%%%%%%%%%% TODO: TITLE Paste title here %%%%%%%%%% TITLE
% multiline titles: end with a \\ to regularize line spacing 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 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
}} }}
\end{center} \end{center}
\begin{center} \begin{center}
\large\textbf{ \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 %} 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} \end{center}
{% if not report.anonymous %} {% if not report.anonymous %}
\begin{center} \begin{center}
%%%%%%%%%% TODO: AFFILIATIONS %%%%%%%%%% AFFILIATIONS
{\bf 1} {{report.author.affiliation}}\\ {\bf 1} {{report.author.affiliation}}\\
\end{center} \end{center}
{% endif %} {% endif %}
...@@ -68,10 +60,10 @@ Report by {% if report.anonymous %}anonymous{% else %}{{report.author.user.first ...@@ -68,10 +60,10 @@ Report by {% if report.anonymous %}anonymous{% else %}{{report.author.user.first
\begin{minipage}{0.5\textwidth} \begin{minipage}{0.5\textwidth}
\raisebox{-1mm}[0pt][0pt]{\includegraphics[width=12mm]{by.eps}} \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 {\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 This work is licensed under the Creative Commons \newline
\href{http://creativecommons.org/licenses/by/4.0/}{Attribution 4.0 International License}. \newline \href{http://creativecommons.org/licenses/by/4.0/}{Attribution 4.0 International License}. \newline
Published by the SciPost Foundation. Published by the SciPost Foundation.
...@@ -79,15 +71,13 @@ Published by the SciPost Foundation. ...@@ -79,15 +71,13 @@ Published by the SciPost Foundation.
\end{minipage} \end{minipage}
& &
\begin{minipage}{0.5\textwidth} \begin{minipage}{0.5\textwidth}
%%%%%%%%%% TODO: DATES %%%%%%%%%% DATES
{\small Received {{report.date_submitted}} {\small Received {{report.date_submitted|date:'d-m-Y'}}
%%%%%%%%%% END TODO: DATES
{% if report.doi_string %}
%%%%%%%%%% TODO: DOI
\newline \doi{ {{report.doi_string}} } {% if report.doi_string %}
%%%%%%%%%% END TODO: DOI %%%%%%%%%% DOI
\newline \doi{ {{report.doi_string|safe_tex_url}} }
{% endif %} {% endif %}
...@@ -96,15 +86,10 @@ Published by the SciPost Foundation. ...@@ -96,15 +86,10 @@ Published by the SciPost Foundation.
\end{tabular} \end{tabular}
\end{center} \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} \vspace{10pt}
\noindent\rule{\textwidth}{1pt} \noindent\rule{\textwidth}{1pt}
%%%%%%%%%% END TODO: TOC
%%%%%%%%% TODO: CONTENTS Contents come here, starting from first \section %%%%%%%% CONTENTS
%%%%%%%%%% TODO: LINENO Activate linenumbers during proofs stage
\section*{Ratings} \section*{Ratings}
\begin{center} \begin{center}
...@@ -115,8 +100,6 @@ Published by the SciPost Foundation. ...@@ -115,8 +100,6 @@ Published by the SciPost Foundation.
\end{tabular} \end{tabular}
\end{center} \end{center}
%\vspace{10pt}
\section{Strengths} \section{Strengths}
{{report.strengths|linebreaktex}} {{report.strengths|linebreaktex}}
...@@ -130,7 +113,5 @@ Published by the SciPost Foundation. ...@@ -130,7 +113,5 @@ Published by the SciPost Foundation.
\section{Requested changes} \section{Requested changes}
{{report.requested_changes|linebreaktex}} {{report.requested_changes|linebreaktex}}
%%%%%%%%% END TODO: CONTENTS
\end{document} \end{document}
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h3>Please process this code in your Tex Compiler:</h3> <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>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment