This is the repository containing the configuration files for reports in the style of the Grattan Institute, Melbourne.
See https://github.com/grattan/grattex/blob/master/doc/grattexDocumentation.pdf for the documentation.
Staff starting a new report need to "clone the grattex
repository on Github" (copy the report template) and "import the repository to edit in Overleaf" (open the template in Overleaf). This can be done using the following steps.
If you do not have a Github account that is connected to the Grattan organisation:
- Create a Github account at github.com using your @grattaninstitute email address and a username that makes it easy to identify yourself (and remember). [Skip if you already have a Github account]
- Ask Will to add you to the Grattan Github organisation.
If you do not have an Overleaf account:
- Create an Overleaf account at overleaf.com using your
@grattaninstitute
email address. - Ask Will to add you to the Grattan Institute premium account.
- Under 'Account Settings', ensure your account is linked to both Dropbox and Github.
- Logged into your github account, go to
https://github.com/grattan/grattex
- Click on
Use this template
(the green button on the top-right of the panel) - Change the Owner to
grattan
. Give your new repository a name that will clearly identify the project now and in the future. A good example isEnergy-2018-stranded-assets
. A bad example ishealth-report
. - Select
Private
, and make sure theInclude all branches
is unchecked. - Click
Create repository from template
. This will take a minute to copy. - Once it has finished, you have successfully cloned the
grattex
repository (copied the report template). You can find it athttps://github.com/grattan/[your-repository-name]
. Now it's time to open and edit it in Overleaf.
- Log into your account at at overleaf.com.
- Click
New Project > Import from GitHub
. - Locate the repository you just created, and click
Import to Overleaf
. - Once imported the document will open and attempt to compile.
- At the top right, click
Share
and:- add collaborators via their email address. Please add all the LaTeXnicians (Will, Owain and Ingrid), as well as the members of your team, plus Paul and Kat.
- copy the
Anyone with this link can edit the project
link and paste it just under\documentclass{grattan}
as a comment, i.e.:
\documentclass{grattan}
% Anyone with this link can edit the project:
% https://www.overleaf.com/abcdefghi12345
so that your coauthors can also invite people to edit the document in your absence
- And that's it. You've now created a new report on Github and Overleaf.
You can get a long way in Latex using Overleaf's 'Rich Text' editor. When you open an Overleaf project and select a file ending in .tex
from the left sidebar, code will appear in the centre panel of the screen. At the top left of the code is a toggle button, allowing you to see the file as 'Source' code (which looks code-ish) or 'Rich Text' (which looks a bit more like Microsoft Word, including buttons you can click for section heading or bold text).
Now you can write almost as easily as you would in more user-friendly text editors like Word.
For anything more advanced (footnotes, referencing, tables, figures and other miscellaneous troubleshooting), there are three resources that might help.
- Using LaTeX in reports at Grattan is a more-than-one-hundred page document that should contain the answer. It lives in the Grattan Dropbox under
Grattan Team > Templates > LaTeX > grattexDocumentation.pdf
. While super helpful and comprehensive, the document is very long -- the best strategy is toctrl+F
for whatever you need assistance with. - The latexShowcase project in Overleaf contains many examples of code that you might find useful, including how to use boxes and complex tables. Ask Will Mackey to invite you to this project if you didn't already receive the invite during your induction.
- Your colleagues have probably encountered any issues you might have. Breaking a Latex document can be unnerving and frustrating, but the fix usually takes only a few seconds. Ask around! Will, James and Kate are the designated 'Latexnicians' as of November 2019, and are more than happy to help.
The purpose of using LaTeX is to improve the quality of our final publications. One of the main ways this happens is by running the document through a series of checks. Here's how it works:
- A week before publication, an associate will need to download the Overleaf project and run some R code (details below) that checks the project.
- These checks will make sure we have all the punctuation, capital letters, cross-references and many, many other features that make a document clean and precise.
- The bibliography will also be scoured, identifying duplicate entries and some other errors.
- The process is very stop-start. Each time R finds an error, it must be manually corrected for the process to continue. R will not give you a list of errors to fix. The associate will fix the error in the offline version of the project that they downloaded, then run the check again.
- The rest of the team must not be working on the Overleaf project when this process is carried out. That's because the final step is...
- ... the associate will copy their offline version of the project into the Dropbox folder where the online Overleaf project lives, replacing all duplicate files. That means any changes made to the Overleaf project will be overwritten.
- To release a report, there are a few additional steps (also outlined below).
For associates, once you've told your team that you're going to check the report (so that they stop editing it), the process of checking the document is as follows:
- Ensure that your computer has both R and RStudio installed. Details on how to do this can be found here. This guide will also explain how to run code in R.
- Install the
grattanReporter
package by running the following code:
install.packages('devtools') # Only if you don't already have the devtools package
devtools::install_github('grattan/grattanReporter')
library(grattanReporter)
- Download your project from Overleaf. Head to
https://www.overleaf.com/project
, find your project in the list, and click on the download button on the right side of the screen. - Most likely, a
.zip
file will appear in yourDownloads
folder. Open the file (it will unzip into a folder). - There are multiple ways of telling R where to look for files. You can start an R project, remember the path to your file, or set your 'working directory' to the folder you just downloaded. For now, we'll stick to the latter:
setwd('/Users/myusername/Downloads/MyUnzippedOverleafProject')
. On a PC, your path may look different. - Now you can start running checks. The command is
checkGrattanReport()
. This will kick off a series of tests and will run until it encounters an error. The checks include:- The report's authors match the recommended citation
- Dashes are used correctly
- Quote marks are used correctly
- Footnotes end in full stops
- Sentences ending in a capital letter (e.g. I went to the USA.) include
\@.
in LaTeX (i.e.I went to the USA\@.
) - There aren't any obviously missing parentheses
- The bibliography looks healthy and doesn't contain obvious duplicates
- There aren't obvious typos -- words that fail the spellcheck can be added to a custom dictionary in
Report.tex
- Figures, tables and boxes have labels
- All figures and tables have a cross-reference in the text (this can be manually overwritten by including the following command on a new line after the dictionary:
% may_be_left_unreferenced: fig:label_of_thing_i_dont_want_referenced
)
- Expect to get an error. This means that
checkGrattanReport()
has found something for you to fix. It should say what the error is, the file where it occurred, the line where it happened, and possibly even what you should do to fix it. In the folder you downloaded, make the necessary change, save it, and run the check again. If you're not sure how to resolve an error, consultgrattexDocumentation.pdf
or chat to a Latexnician. - Repeat until there's no further issues. Then run
checkGrattanReport(compile = TRUE)
until there are no further issues (this performs some additional checks, like making sure your references aren't broken/missing). - Copy the contents of the downloaded folder into the Overleaf project folder in Dropbox (assuming you've linked Overleaf and Dropbox; if not, see a Latexnician). Replace all of the duplicated files.
- Wait a minute, open Overleaf, compile the document and check that everything looks as it should. If not, now is the perfect time to seek out a Latexnician.
Releasing a report involves adding the front cover, updating the logos/affiliates on page 2, adding the ISBN and report number, and running the report through checkGrattanReport
again -- but this time with some extra checks.
- To add the front cover, ensure that there is a folder in the Overleaf project called
FrontPage
, which must contain the front cover as a PDF with the nameFrontPage.pdf
. InReport.tex
, change the first line of code from\documentclass[embargoed]{grattan}
to\documentclass[FrontPage]{grattan}
. - Check with Central Services what ISBN and report number your report should have. Replace whatever ISBN/report number is currently in
Report.tex
with the correct one. - Now download your Overleaf project again -- just as you did one week ago, it's time to run
checkGrattanReport()
, ensuring that your team is not trying to make any final changes to the document. - This time, however, we're going to add some extra arguments to
checkGrattanReport()
. These extra arguments will check that\CenturyFootnote
is used correctly (seegrattexDocumentation.pdf
), and will build the final PDF for us.
# To update affiliates/logos, you need to update the 'classfile'. Here's how:
checkGrattanReport(update_grattan.cls = TRUE)
# Final release checks are included with the following argument
checkGrattanReport(compile = TRUE, pre_release = TRUE)
# And a publication-ready pdf will be built with the following:
checkGrattanReport(compile = TRUE, pre_release = TRUE, release = TRUE)
- A new folder will be created called
RELEASE
, and inside will be a PDF of your report. This is what you will send to Central Services so that they can upload it to the Grattan website in time for its 9pm publication. - Copy the offline files back into the Overleaf folder on Dropbox to update them.
- Breathe a small sigh of relief. It's almost over! But inevitably, on a final read-through, you or a team member will pick up on something you need changed (hopefully just typographical at this stage). If so, you'll need to make the change and repeat this process, sending a new, updated PDF to Central Services in time for release.
And if something goes badly wrong -- you can't get checkGrattanReport()
to make you a PDF, and no Latexnician is available -- rest assured that you can always use the PDF that Overleaf compiles as a workaround. However, it may not have the updated affiliates, and there's a greater risk of bugs in the document if it hasn't passed checkGrattanReport()
. But at least you'll have a usable document, and you can talk to a Latexnician on Monday to fix anything outstanding.
- Penalties for hyphenation increased
- Fix issue #102 which manifested on TeX Live distributions (like Travis-CI) where
Ibid. (<page ref>)
resulted in thep
being uppercase (PR #114). Thanks to JD for filing.
- Increase hyphenation penalties. Closes #85
- Add
\note(s)withsource(s)
permutations. Closes #81
- Add
centredsmallbox
.
- Enable the detection of page-straddling cross-references via additional entries in
.log
- Appendix chapter titles are named 'Appendix A' etc.
- New option 'submission'.
- Add
\Chapref
and friends for neater hyperlinks to chapters - Add
\ie
\eg
\etc
macros.
- Allow long URLs in bibliography, line-breaking at width #36
- Box footnotes are now non-italic #43
- New command,
\doublecolumnfigure
now used #46 - Documentation moved to
./doc/
New features:
-
New option
embargoed
enables a command\EmbargoDate
which prints an Embargo mark on the title page and in the headers #32 -
Patched bug in
cleveref
wherevarioref
's phrase ``on the previous page'' is never used. #39 -
[t]
floats have captions aligned with the baseline. 076df622e7fec025382b804e1b809319aef2fe11 -
KOMA-warnings' advice about
footheight
,headheight
etc has been accepted. #40 -
Glue component of space between footnote area and text has been reduced to 14pt (which is closer to the current leading). aec03a693b0aad85daa03ceef16316ef855b5b4a
-
Manual specification of
\textfloatsep
has now been dropped in favour of the default -
Allow citations in acknowledgements #37