From fb5345b5d92dbe5abe82cc975a76ab41ebb237e0 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Sat, 24 Dec 2016 04:57:13 +0100
Subject: [PATCH] Correct Commentary vet refusal bug; work on prod docs

---
 commentaries/views.py                         | 20 +++----
 .../editorial_administrators/production.rst   | 56 ++++++++++++++++---
 2 files changed, 57 insertions(+), 19 deletions(-)

diff --git a/commentaries/views.py b/commentaries/views.py
index 88f4d7c69..1f1330477 100644
--- a/commentaries/views.py
+++ b/commentaries/views.py
@@ -61,7 +61,7 @@ def request_commentary(request):
                            'errormessage': errormessage,
                            'existing_commentary': existing_commentary}
                 return render(request, 'commentaries/request_commentary.html', context)
-            
+
             # Otherwise we can create the Commentary
             contributor = Contributor.objects.get(user=request.user)
             commentary = Commentary (
@@ -84,7 +84,7 @@ def request_commentary(request):
                 )
             commentary.parse_links_into_urls()
             commentary.save()
-            
+
             context = {'ack_header': 'Thank you for your request for a Commentary Page',
                        'ack_message': 'Your request will soon be handled by an Editor. ',
                        'followup_message': 'Return to your ',
@@ -120,7 +120,7 @@ def prefill_using_DOI(request):
                            'errormessage': errormessage,
                            'existing_commentary': existing_commentary}
                 return render(request, 'commentaries/request_commentary.html', context)
-            
+
             # Otherwise we query Crossref for the information:
             try:
                 queryurl = 'http://api.crossref.org/works/%s' % doiform.cleaned_data['doi']
@@ -133,12 +133,12 @@ def prefill_using_DOI(request):
                 for author in doiqueryJSON['message']['author'][1:]:
                     authorlist += ', ' + author['given'] + ' ' + author['family']
                 journal = doiqueryJSON['message']['container-title'][0]
-                
+
                 try:
                     volume = doiqueryJSON['message']['volume']
                 except KeyError:
                     volume = ''
-                
+
                 pages = ''
                 try:
                     pages = doiqueryJSON['message']['article-number'] # for Phys Rev
@@ -148,7 +148,7 @@ def prefill_using_DOI(request):
                     pages = doiqueryJSON['message']['page']
                 except KeyError:
                     pass
-                
+
                 pub_date = ''
                 try:
                     pub_date = (str(doiqueryJSON['message']['issued']['date-parts'][0][0]) + '-' +
@@ -209,7 +209,7 @@ def prefill_using_identifier(request):
                 queryurl = ('http://export.arxiv.org/api/query?id_list=%s'
                             % identifierform.cleaned_data['identifier'])
                 arxivquery = feedparser.parse(queryurl)
-                
+
                 # If paper has been published, should comment on published version
                 try:
                     arxiv_journal_ref = arxivquery['entries'][0]['arxiv_journal_ref']
@@ -223,7 +223,7 @@ def prefill_using_identifier(request):
                                     + '. Please comment on the published version.')
                 except (IndexError, KeyError):
                     pass
-                
+
                 if errormessage:
                     form = RequestCommentaryForm()
                     doiform = DOIToQueryForm()
@@ -231,7 +231,7 @@ def prefill_using_identifier(request):
                                'errormessage': errormessage,
                                'existing_commentary': existing_commentary}
                     return render(request, 'commentaries/request_commentary.html', context)
-                
+
                 # otherwise prefill the form:
                 metadata = arxivquery
                 pub_title = arxivquery['entries'][0]['title']
@@ -334,7 +334,7 @@ def vet_commentary_request_ack(request, commentary_id):
                               + '.\n\nThank you for your interest, \nThe SciPost Team.')
                 if form.cleaned_data['email_response_field']:
                     email_text += '\n\nFurther explanations: ' + form.cleaned_data['email_response_field']
-                emailmessage = EmailMessage('SciPost Commentary Page activated', email_text,
+                emailmessage = EmailMessage('SciPost Commentary Page not activated', email_text,
                                             'SciPost commentaries <commentaries@scipost.org>',
                                             [commentary.requested_by.user.email],
                                             ['commentaries@scipost.org'],
diff --git a/docs/contributors/editorial_administrators/production.rst b/docs/contributors/editorial_administrators/production.rst
index a9a7d7d06..d29030793 100644
--- a/docs/contributors/editorial_administrators/production.rst
+++ b/docs/contributors/editorial_administrators/production.rst
@@ -78,6 +78,19 @@ LaTeX file preparation
    your initials and surname in this block.
 
 
+General LaTeX tips
+~~~~~~~~~~~~~~~~~~
+
+   * Prefer the ``align`` (from package ``amsmath``) environment to ``eqnarray``.
+     For a technical discussion, see *e.g.* `this link <http://tug.org/TUGboat/tb33-1/tb103madsen.pdf>`_.
+
+     You do **not** have to systematically replace all ``eqnarray`` with ``align``.
+     However, if you do reformat some equations, do shift to ``align``.
+
+
+Step-by-step procedure
+~~~~~~~~~~~~~~~~~~~~~~
+
    #. TODO: PAPER CITATION 1 and 2
 
       In these two places, fill the missing numbers in the citation header::
@@ -122,6 +135,7 @@ LaTeX file preparation
 
       If the authors have redefined commands, paste the redefinitions in this block.
 
+      Discard (namely: do not copy and paste) any length (and similar) redefinitions.
 
 
    #. TODO: TITLE
@@ -157,8 +171,10 @@ LaTeX file preparation
 
 	``\href{mailto:[email]}{\small \sf [email]}``
 
-      prepended with ``*`` if corresponding author. If a web link is offered,
-      use the format ``{\small \url{[url]}}``.
+      prepended with ``*`` if corresponding author. If no email is to be given,
+      comment out the ``* \href{mailto:[email]}{\small \sf [email]}`` line.
+
+      If a web link is offered, use the format ``{\small \url{[url]}}``.
 
 
    #. TODO: ABSTRACT
@@ -176,6 +192,15 @@ LaTeX file preparation
       As a general guideline, the paper should contain a table of contents
       if it has more than 6 pages.
 
+      If a TOC should be included, leave the skeleton as it is. If no TOC
+      should be there, simply comment out the lines::
+
+	\vspace{10pt}
+	\noindent\rule{\textwidth}{1pt}
+	\tableofcontents\thispagestyle{fancy}
+	\noindent\rule{\textwidth}{1pt}
+	\vspace{10pt}
+
 
    #. TODO: COPYRIGHT
 
@@ -243,14 +268,24 @@ LaTeX file preparation
    correct** ``.bib`` **file**.
 
 
+
+
 Simple issues
 ~~~~~~~~~~~~~
 
-   * *LaTeX Error: environment acknowledgements undefined*.
+   * *LaTeX Error: environment acknowledgements undefined* or
+     *Undefined control sequence \acknowledgements*
 
      The users have used ReVTeX; simply change the ``\begin{acknowledgements}``
-     to ``\section*{Acknowledgements}`` and remove ``\end{acknowledgements}``.
+     or ``\acknowledgements``
+     to ``\section*{Acknowledgements}`` (of course also removing any eventual
+     ``\end{acknowledgements}``).
+
 
+   * *LaTeX Error: Environment widetext undefined.*
+
+     The authors have used ReVTeX; simply comment out all ``\begin{widetext}``
+     and ``\end{widetext}`` markers.
 
 
 Problems
@@ -262,9 +297,7 @@ Problems
 
      Solution: [from `this link <http://phaseportrait.blogspot.nl/2007/08/lineno-and-amsmath-compatibility.html>`_]: paste this in the preamble::
 
-       {\small
-       \begin{verbatim}
-       %% Patch lineno when used with amsmaths
+       %% Patch lineno when used with amsmath
        \newcommand*\patchAmsMathEnvironmentForLineno[1]{%
        \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
        \expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
@@ -290,7 +323,7 @@ Problems
      Simply prevent by forcing equations into a math atom by surrouding them with braces,::
 
        \begin{verbatim}
-       Here is an equation that shouldn't be broken: ${E=mc^2}$.
+       Here is an equation that should not be broken: ${E=mc^2}$.
        \end{verbatim}
 
 
@@ -318,7 +351,9 @@ References formatting
 
       * Commas separate all elements.
 
-      * All doi are present and displayed in format doi:[doi].
+      * All doi are present and displayed in format doi:[doi]. Note that the doi does
+	*not* include any ``http://doi.org`` or similar URL prefix. Instead, it should
+	be of the form ``10.###[...]/[...]``.
 
       * The reference is closed by a ``.``
 
@@ -329,6 +364,9 @@ Layout verification
    The whole paper should be scanned through, and the layout of equations
    and figures should be checked and corrected if necessary.
 
+   In particular, the punctuation of equations should be checked and corrected
+   if necessary.
+
 
 Proofs
 ------
-- 
GitLab