knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
word2grattex
is deigned to make Word to LaTeX conversion faster and more accurate. It is relatively flexible but is most effective when used within the wider Grattan report production ecosystem.
It requires:
R
and pandoc
(which usually ships with R
.)It can do the most if it also has:
.bib
file associated with the report..pdf
chart deck in order of appearance in the report.The function takes a Word document in the Grattan template and:
pandoc
.pandoc
conversion:\protect
, \hyperlink
, \hypertarget
, \texorpdfstring
;\caption
, \unit
, \noteswithsource
(or \notes
/\source
only, or \noteswithsources
, etc);\insertgraphics
for a standard Grattan chart size and inserts the $n^{th}$ page of the name of your PDF chart deck, or defaults to the $n^{th}$ page of chartdeck.pdf
if a PDF is not provided (this can be quickly fixed afterwards with find/replace);fig:figure-caption
.Excel2LaTeX
Excel plugin for assistance there.chap:
, sec:
, subsec:
, etc.See \Cref{subsec:section-name}
.\Cref{fig:figure-caption} shows
.cite
commands.bbib2grattex
function..bib
keys are automatically generated in the format AuthorYearTitle
(title capped to 15 characters). \footcite{Norton2018dropping-out-th}
\footnote{See discussion in \textcite[][10]{Terrill2018unfreezing-disc}.}
. \footcites[][chapter~3]{Daley2018hot-property}[][chapter~3]{Smith1776the-wealth-of-n}.}
. Note: as our Style of Quiet Achievers fails to distinguish between 'not-quite twins', the bib2grattex
conversion tool does too. A solution to this problem is being considered. For now, manual identification of not-quite twins is required. Key point: check your Daley et al. references.
When word2grattex
is finished, it will produce a .tex
file that can be built out of the box. Some things need to be done manually:
FigurePlacementScore
to help.Then, run through chreckGrattan
/Travis
and release.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.