Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Dec 4, 2022
0 parents commit c8d2cf5
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
template_files/
template.pdf
template.tex
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Monash Letter Format Template

This is a Quarto template that assists you in creating a letter on Monash University letterhead

## Creating a new letter

You can use this as a template to create a letter.
To do this, use the following command:

```bash
quarto use template robjhyndman/monash-quarto-letter
```

This will install the extension and create an example qmd file that you can use as a starting place for your letter.

## Installation for existing document

You may also use this format with an existing Quarto project or document.
From the quarto project or document directory, run the following command to install this format:

```bash
quarto install extension robjhyndman/monash-quarto-letter
```
Binary file added _extensions/letter/AACSB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _extensions/letter/AMBA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _extensions/letter/EQUIS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _extensions/letter/MBSportrait.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions _extensions/letter/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: Monash Letter Format Template
author: Rob J Hyndman
version: 0.1.0
contributes:
formats:
pdf:
template: monashletter.tex
pdf-engine: pdflatex
format-resources:
- AACSB.png
- AMBA.png
- EQUIS.png
- MBSportrait.jpg
- monash2.png
- sigfile.png
Binary file added _extensions/letter/monash2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
259 changes: 259 additions & 0 deletions _extensions/letter/monashletter.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
\documentclass[$if(fontsize)$$fontsize$$else$11pt$endif$,a4paper,$for(classoption)$$classoption$$sep$,$endfor$]{letter}
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{bera}
$endif$
$if(linestretch)$
\usepackage{setspace}
\setstretch{$linestretch$}
$endif$

\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
\usepackage[utf8]{inputenc}
$if(euro)$
\usepackage{eurosym}
$endif$
\else % if luatex or xelatex
$if(mathspec)$
\ifxetex
\usepackage{mathspec}
\else
\usepackage{unicode-math}
\fi
$else$
\usepackage{unicode-math}
$endif$
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
$for(fontfamilies)$
\newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
$endfor$
$if(euro)$
\newcommand{\euro}{€}
$endif$
$if(mainfont)$
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
$endif$
$if(mathfont)$
$if(mathspec)$
\ifxetex
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
\else
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
\fi
$else$
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$endif$
$endif$
$if(CJKmainfont)$
\usepackage{xeCJK}
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
$if(verbatim-in-note)$
\usepackage{fancyvrb}
$endif$
$if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes
$endif$
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$else$
\usepackage{geometry}
\geometry{a4paper, top=2cm, bottom=2cm, left=2cm, right=2cm}
$endif$
$if(lang)$
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
$if(babel-newcommands)$
$babel-newcommands$
$endif$
\else
\usepackage{polyglossia}
\setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
$for(polyglossia-otherlangs)$
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
$endfor$
\fi
$endif$
$if(listings)$
\usepackage{listings}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(tables)$
\usepackage{longtable,booktabs}
% Fix footnotes in tables (requires footnote package)
\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{long table}}{}
$endif$
\usepackage{graphicx}
$if(graphics)$
\usepackage{grffile}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
$endif$
$if(strikeout)$
\usepackage[normalem]{ulem}
% avoid problems with \sout in headers with hyperref:
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$
$if(indent)$
$else$
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
$endif$
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
$if(numbersections)$
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
$else$
\setcounter{secnumdepth}{0}
$endif$
$if(subparagraph)$
$else$
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
$endif$
$if(dir)$
\ifxetex
% load bidi as late as possible as it modifies e.g. graphicx
$if(latex-dir-rtl)$
\usepackage[RTLdocument]{bidi}
$else$
\usepackage{bidi}
$endif$
\fi
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\TeXXeTstate=1
\newcommand{\RL}[1]{\beginR #1\endR}
\newcommand{\LR}[1]{\beginL #1\endL}
\newenvironment{RTL}{\beginR}{\endR}
\newenvironment{LTR}{\beginL}{\endL}
\fi
$endif$

\usepackage{color,hyperref,url,fontawesome}
\urlstyle{same} % don't use monospace font for urls
\usepackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\makeatletter
\def\ps@monash{%
\begin{textblock}{4}(2,1)
\includegraphics[height=1.5cm]{monash2}
\end{textblock}%
\begin{textblock}{4}(17,1)
\includegraphics[height=1.5cm]{MBSportrait}
\end{textblock}%
\begin{textblock}{10}(1.2,26.4)
{\fontsize{9}{8}\selectfont\sffamily\color[gray]{0.4}%
\begin{tabular}{@{}l@{}}
\textbf{$fromname$}, $fromqualifications$\\
$fromtitle$\\
Department of Econometrics \& Business Statistics\\
Monash University, Victoria 3800, Australia.\\[0.15cm]
\faicon{envelope} $fromemail$\quad\faicon{phone} $fromphone$\quad
\faicon{home} $fromWWW$\\[0.1cm]
ABN: 12 377 614 012\quad CRICOS Provider Number: 00008C
\end{tabular}}
\end{textblock}%
\begin{textblock}{7}(12.7,28.2)\hfill
\includegraphics[height=0.6cm]{AACSB}~~~
\includegraphics[height=0.6cm]{EQUIS}~~~
\includegraphics[height=0.6cm]{AMBA}
\end{textblock}
\def\thepage{}}

\@ifundefined{opening}{}{%
\renewcommand*{\opening}[1]{\thispagestyle{monash}%
{\@date\par}%
\vspace{2\parskip}%
{\raggedright \toname \\ \toaddress \par}%
\vspace{2\parskip}%
#1\par\nobreak}}
\makeatother

\def\section#1{\vspace{0.3cm}\par{\textsf{\bfseries\Large #1}}\vspace*{0.02cm}\par}
\def\subsection#1{\vspace{0.3cm}\par{\textsf{\bfseries\large #1}}\vspace*{0.02cm}\par} %}

% Date
\def\Date{\number\day}
\def\Month{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi}
\def\Year{\number\year}

% Spacing
\RequirePackage{setspace}

% Fix href problems
\def\href#1{}

$for(header-includes)$
$header-includes$
$endfor$

$if(date)$
\date{$date$}
$else$
\date{\Date~\Month~\Year}
$endif$

\begin{document}
$for(include-before)$
$include-before$
$endfor$
\begin{letter}{$toname$\\$for(toaddress)$$toaddress$$sep$\\$endfor$}
\setstretch{1}
\vspace*{1cm}\enlargethispage*{-2cm}
\opening{$opening$}
\setstretch{$spacing$}
$body$
\closing{$closing$\\[0.2cm]\hspace*{0.5cm}\includegraphics[height=1.5cm]{$fromsignature$}}
$for(include-after)$
$include-after$

$endfor$
\end{letter}


\end{document}
Binary file added _extensions/letter/sigfile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions template.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
fromname: Pierre Curie
fromqualifications: Nobel Prize, PhD
fromtitle: Professor
fromWWW: curie.com
fromemail: [email protected]
fromphone: +61 3 9905 5555
fromsignature: sigfile.png
toname: Helen of Troy
toaddress:
- University of Greece
- Athens
opening: "Dear Helen"
closing: "Best wishes"
spacing: 1.4
ps: |
PS: Lorem ipsum dolor sit amet, *consectetur* adipiscing elit.
format: letter-pdf
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin mollis dolor vitae tristique eleifend. Quisque non ipsum sit amet velit malesuada consectetur. Praesent vel facilisis leo. Sed facilisis varius orci, ut aliquam lorem malesuada in. Morbi nec purus at nisi fringilla varius non ut dui. Pellentesque bibendum sapien velit. Nulla purus justo, congue eget enim a, elementum sollicitudin eros. Cras porta augue ligula, vel adipiscing odio ullamcorper eu. In tincidunt nisi sit amet tincidunt tincidunt. Maecenas elementum neque eget dolor [egestas fringilla](http://example.com):

> Nullam eget dapibus quam, sit amet sagittis magna. Nam tincidunt, orci ac imperdiet ultricies, neque metus ultrices quam, id gravida augue lacus ac leo.
Vestibulum id sodales lectus, sed scelerisque quam. Nullam auctor mi et feugiat commodo. Duis interdum imperdiet nulla, vitae bibendum eros placerat non. Cras ornare, risus in faucibus malesuada, libero sem fringilla quam, ut luctus enim sapien eget dolor.

0 comments on commit c8d2cf5

Please sign in to comment.