Filling in the first page using a script

From Free Neuropathology Wiki
Jump to navigation Jump to search

Note

The process does not work if there are special characters in the .csv file. Special characters include:

  • inverted commas
  • non-English letters (which may occur in family names or article titles, such as ä, α)
  • characters such as @
  • characters with an accent (as in Guillain‐Barré syndrome, for example)
These should be left out at this point and replaced later in the final format. (Make sure to take a note for yourself so you don't forget about these while refining the first page.)

The first page's info will automatically be inserted into the layout from a separate data file.

This method lets you save time, as it automatically fills in the right parts, but it requires more initial engagement with the software on your part.

Here's how it works:

  1. Download and unpack the file ScribusGenerator.zip.
  2. Download either the file fnp_EU.csv or fnp_US.csv, respectively, which is used to enter a paper's metadata, i.e. the name(s) of its author(s), their affiliation, etc. You can edit this file using Microsoft Excel or any other text editor (e.g. Microsoft Notepad). The script will read out this file and automatically fill in the content on the article's first page. Choose the right file for your location/your computer's region settings.
  3. Download and open the file fnp_script_Windows_1.5.5.sla
    • The first page of the template looks very messy by default because it contains a lot of variables (%VAR_...). These parts of the text will automatically be replaced with content.
  4. Open the file fnp_EU.csv or fnp_US.csv using a spreadsheet software (e.g. Microsoft Excel) or simple text editing software of your choosing to enter the metadata of an article.
    • If the file does not look like a spreadsheet when opened in Microsoft Excel, you might have to use the other file because Excel interprets this type of file differently depending on the language system of your computer.
    • Any field that is not applicable can be left blank.
    • Important: Do not change the structure of this file, e.g. by removing, adding or rearranging columns!
    • Glossary of layout variables you have to fill in (or leave blank):
      • issue: FNP is in its third year, so this field will contain 3 for now.
      • number: The paper's number in this year's running count.
      • year: The year of publication.
      • doi: The paper's identifier, which will be at the end of its doi internet address. (This four‐digit number can be found from the submission's metadata in OJS).
      • firstsurname: For a paper with more than one author this field must contain the first author's surname (e.g. Kennedy). For a paper with a single author this field will contain the author's first name, middle initial (if applicable), and surname (e.g. John F. Kennedy).
      • etal: For a paper with more than one author this field should contain et al ‐ for a paper with a single author this field can be left blank.
      • type: The article type, e.g. Original Paper, Review, Opinion Piece, Letter, Reflections, ...
      • title: The article's main title.
      • subtitle: This can be left blank if the article does not have a subtitle.
      • corresauthor: The first name and surname of the article's corresponding author (e.g. Jane Doe).
      • correslab, corresinstitute, corresuniversity, correscity, correscountry, corresmail: These variables will constitute the stated contact information of the article's corresponding author. Elements that are not applicable can be left blank.
      • submitted, accepted, published: The article's publication history, which can be obtained from OJS. Date format: DD Month YYYY (e.g. 09 March 2021).
      • copyeditor: Your full name.
      • keyword1 etc.: Up to 20 individual keywords can be entered here. If a paper has more than 20 keywords you will have to manually edit this section in the final layout later. The first word of a keyword consisting of more than one word has to be capitalized (e.g. Tau pathology).
      • author1, affilllab1, affillinstitute1, affilluniversity1, affillcity1, affillcounty1: These fields contain the affiliations for up to 15 authors.
  5. Save the .csv file and then back in the Scribus main menu click ScripterExecute Script...
  6. In the Scribus Generator window, choose the file ScribusGenerator.py, which is located in the folder ScribusGenerator‐master that you unpacked earlier. Under Scribus file choose fnp_Windows_1.5.5.sla and under Data File choose the .csv file. You have to type in ; (semicolon) as the Data Field Separator. On the center on the right you can choose a Format. Since we want to keep working on the layout, choose Scribus. Click Generate and the folder containing the template will now contain another Scribus template with the first page of the paper almost ready to go.
    • If an error occurs there was most probably a character in the .csv file that isn't accepted by the script. Please check each field carefully and remove characters that might cause problems. Sometimes "invisible" special characters that look like blank spaces might sneak into a cell when copy‐and‐pasting info from another file into the .csv file. So if you encounter an error message we recommend going through the cells and re‐entering info manually. It is also imperative that no column position or cell content in the .csv file be modified; you should also not add columns. If you think the file is messed up, just re‐download it.
    • If there's still an error try , (comma) as the Data Field Separator.
  7. You can now close this Scribus window and open the new .sla file.

Next step

Now you can proceed refining the first page.