Implemented core functionality.

This commit is contained in:
Achim D. Brucker 2016-07-28 13:29:02 +01:00
parent 0df84790f7
commit 067c73d3bc
5 changed files with 177 additions and 0 deletions

BIN
tuos-letter/example.pdf Normal file

Binary file not shown.

47
tuos-letter/example.tex Normal file
View File

@ -0,0 +1,47 @@
\documentclass[a4paper]{tuos-letter}
\usepackage[english]{babel}
\LoadLetterOption{personal}
\begin{document}
\setkomavar{subject}{Guidance on letter layout}
\begin{letter}{
Mr C Eague\\
Job Title\\
Company Name\\
House Name/number, Street\\
District\\
Town/City\\
Country\\
Postcode
}
\opening{Dear Colin,}
If a reference line is necessary, put it in bold, ranged left as in
the example above.
Do not change the size of the text as set in the template you
download. All the body of the letter should be ranged left, ragged
right, like this. Never indent the text, justify it or change the
margins provided in the template. Text should be single line spaced,
with two returns (one line space) between paragraphs.
In the body of your letter, if you need to make text stand out put
it in bold. For example, \textbf{please return this form by 1
December 2008.} Never underline text.
To quote a web address leave out the http:// part, remove the
hyperlink (by using the Word Insert menu) and put the web address in
bold with no underline and no full stop at the end, like this:
\url{www.sheffield.ac.uk}
If quoting the title of a publication, put it into italics like
this: \textit{Home from Home.}
There is useful guidance on the style, tone and content of letters
at \url{www.sheffield.ac.uk/ marcoms/visualid/stationeryfaqs.htm}
\closing{Yours sincerely}
\end{letter}
\end{document}

36
tuos-letter/personal.lco Normal file
View File

@ -0,0 +1,36 @@
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% OR
%% The 2-clause BSD-style license.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Letter Class Option for
%
\ProvidesFile{adb-s1-4dp-ex.lco}[%
2016/06/28 Personal Letter Setup (Achim Brucker, S1 4DP)]
\setkomavar{department}{Department\newline of\newline Computer Science}
\setkomavar{departmentheadtitle}{Professor}
\setkomavar{departmentheadname}{Guy J. Brown}
\setkomavar{departmenturl}{www.sheffield.ac.uk/dcs}
\setkomavar{fromname}{Dr. Achim D. Brucker}
\setkomavar{fromurl}{www.brucker.uk}
\setkomavar{fromblog}{logicalhacking.com/blog}
\setkomavar{fromphone}{+44 114 22 21806}
\setkomavar{fromemail}{a<lastname>@sheffield.ac.uk}
\setkomavar{signature}{Achim D. Brucker\\Senior Lecturer (Software Security \& Assurance)}
\setkomavar{fromaddress}{Regent Court\\211 Portobello St.\\Sheffield S1 4DP, UK}
\endinput
%
% End of Letter Class Option Achim Brucke
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -0,0 +1,30 @@
%% Copyright (C) 2016 Achim D. Brucker, https://www.brucker.ch
%%
%% License:
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% OR
%% The 2-clause BSD-style license.
%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{tuos-letter}%
[2016/07/28 LaTeX letter class following the cooperate design of The University of Sheffield]
\LoadClassWithOptions{scrlttr2}[2016/06/14]
\RequirePackage{tuos-fonts}
\RequirePackage[T1]{fontenc}
\RequirePackage{tuos-logo}
\RequirePackage{xcolor}
\RequirePackage{hyperref}
\KOMAoptions{
refline=dateleft,
foldmarks=off,
backaddress=off,
refline=dateleft,
subject=afteropening,
subject=left,
}
\LoadLetterOption{tuos}
\endinput

64
tuos-letter/tuos.lco Normal file
View File

@ -0,0 +1,64 @@
%% Copyright (C) 2016 Achim D. Brucker, https://www.brucker.ch
%%
%% License:
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% OR
%% The 2-clause BSD-style license.
%%
\ProvidesFile{tuos.lco}[%
2016/07/28 Letter layout for tuos-letter.]
% type-setting the subject line
\setkomafont{subject}{\normalcolor\bfseries}
% type-setting URLs
\hypersetup{pdfborder=0 0 0}
\renewcommand{\UrlFont}{\bfseries}
\renewcommand{\familydefault}{\sfdefault}%
\raggedright
\renewcommand*{\raggedsignature}{\raggedright}
% new variables
\newkomavar{department}
\newkomavar{departmentheadtitle}
\newkomavar{departmentheadname}
\newkomavar{departmenturl}
\newkomavar[Blog:]{fromblog}
\providecaptionname{american,australian,british,canadian,%
english,newzealand,UKenglish,USenglish}\phonename{Telephone}%
% Define first head
\@setplength{firstheadhpos}{0mm}
\@setplength{firstheadwidth}{\paperwidth}
\@addtoplength[-1]{firstheadvpos}{14pt}
\setkomavar{firsthead}{%
\parbox[b]{.55\paperwidth}{\tuosLogoLight}%
\parbox[b]{.45\paperwidth}{%
\Huge\textcolor{black!40}{\rmfamily\usekomavar{department}.\vspace{.3cm}}}
}
% Define loc stuff (e.g., back address)
\@setplength{lochpos}{0mm}
\@setplength{locwidth}{.35\paperwidth}
\@addtoplength{locheight}{165pt}
\setkomavar{location}{\raggedright\rmfamily%
\ifkomavarempty{departmentheadtitle}{%
\ifkomavarempty{departmentheadname}{\bigskip}{}}{\usekomavar{departmentheadtitle}\\}%
\ifkomavarempty{departmentheadname}{}{\usekomavar{departmentheadname}\\\bigskip}%
%
\usekomavar{fromaddress}\\\bigskip
\ifkomavarempty{fromphone}{}{\usekomavar*{fromphone}~\usekomavar{fromphone}\\}%
\ifkomavarempty{fromfax}{}{\usekomavar*{fromfax}~\usekomavar{fromfax}\\}%
\ifkomavarempty{fromemail}{}{\usekomavar*{fromemail}~\usekomavar{fromemail}\\}%
\ifkomavarempty{fromblog}{}{\usekomavar*{fromblog}~\usekomavar{fromblog}\\}%
\ifkomavarempty{departmenturl}{}{\usekomavar{departmenturl}\\}%
\ifkomavarempty{fromurl}{}{\usekomavar{fromurl}\\}%
}