%% \DocumentMetadata
%% {
%% % testphase = phase-I, % tagging without paragraph tagging
%% testphase = phase-II, % tagging with paragraph tagging
%% % testphase = phase-III, % tagging with paragraph sec, toc, blocks and more
%% pdfversion = 2.0, % pdfversion must be set here.
%% pdfstandard=ua-2, % pdfstandard can be set too
%% }
\documentclass[%
11pt,
logo=LU, % {LU/LTH/CHbg/Nfak/LNL}
eng, % {eng/swe}
logocol=false, % {true/false}
Layout=Trad, % {Orig/Access}
]{ulundletter}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%%%%%%%%%% Fonts
\usepackage{mathptmx}
% \usepackage{mathpazo}
\usepackage[scaled=.93]{helvet}
\usepackage{courier}
%%%%%%%%%% Margins
% \raggedright
% \parindent=15pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Footer
\Address{Box 118, 22100 Lund}
\Visiting{Klas Anshelms väg 10, Lund}
\Phone{+46 46 222 4278}
\Mobile{}
\Fax{}
\Email{stefan.host@eit.lth.se}
\Web{www.eit.lth.se}
%% Header
% \DocumentName{}
% \Diarienum{}
\Department{Electrical and Information Technology}
\Admin{Stefan Höst}
%\date{\today}
%% Letter
\signature{Stefan Höst}
%%%%%%%%%%%%% Verbatim code box
\usepackage[skins,listings]{tcolorbox}
\tcbuselibrary{listingsutf8}
\lstdefinestyle{CodeStyle}{basicstyle = \ttfamily}
\newtcblisting{CodeBox}[2][]{% Only code
colframe=black,
colback=white,
arc=1pt,
boxrule=0.5pt,
top=0mm,bottom=0pt,left=0pt,
colbacktitle=gray!40,
coltitle=black,
fonttitle=\sffamily,
listing only,
%% extendedchars=false,
%% inputencoding=utf8,
title=#2,#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%
\begin{letter}{\LaTeX\ users\\ LU / LTH}
\opening{A document class for letters at LU and LTH}
The \LaTeX\ document class mimics the official (word) templates defined at Lund University and LTH. It tries to follow the graphical profile as much as possible. The class is built upon the standard \LaTeX\ class \texttt{letter}, adopted for the LU and LTH letter template. Apart from the \texttt{letter} class it also loads the packages \texttt{geometry}, \texttt{graphicx}, \texttt{tikz} and \texttt{fancyhdr}. All of these are well known standard packages included in all distributions. For more information about \LaTeX-templates at Lund University, please visit the Canvas page: \url{https://canvas.education.lu.se/courses/31833}
\section{Options}
There are a couple of options that can be set for the to the class to control the template, especially the choice of logo.
\begin{itemize}
\item \textit{Affiliation}\newline
The default logo is LU. To change, set option \texttt{logo=<faculty>} to the desired affiliation. So far you can chose \texttt{LU/LTH/CHbg/Nfak/LNL}. That is, to set the logo to Campus Helsingborg use \texttt{logo=CHbg}. The default is \texttt{logo=LU}.
\item \textit{Language}\newline
The template is prepared to be used in Swedish or English, where the default language is Swedish. To change to English use \texttt{eng=true}, or just \texttt{eng}. The switch for Swedish is \texttt{eng=false} or the option \texttt{swe}. The language affects the logo, but also e.g. footer text and date format.
\item \textit{Color or B/W}\newline
The LU seal can be given in color or black, with black as default. To change to colorful logo use \texttt{logocol=true}, or \texttt{logocol}. To set Swedish use \texttt{logocol=false}.
\item \textit{Accessibility template}\newline
For the default Word-templates, there are two versions with a bit different design in the header. Apart from the traditional design there is also one for increased accessibility, that is a bit more clear in the header design. The default is the traditional layout, set with \texttt{Layout=Trad}, and to choose the layout for accessibility choose \texttt{Layout=Access}. For some more information about how to export tagged pdfs, which is a requirement for accessibility for digital documents, se Section Accessibility.
\end{itemize}
Writing a letter with the default setting, i.e. black and white LU-logo in Swedish, one can write:
\begin{CodeBox}{}
\documentclass[11pt]{ulundletter}
\end{CodeBox}
\noindent The option \texttt{11pt} is given since this is used in the official template. To get an english LTH logo in color, and the accessible design, you can add the options for this:
\begin{CodeBox}{}
\documentclass[11pt,logo=LTH, Layout=Access, eng, logocol]{ulundletter}
\end{CodeBox}
\noindent
or
\begin{CodeBox}{}
\documentclass[11pt,logo=LTH, Layout=Access, eng=true, logocol=true]{ulundletter}
\end{CodeBox}
This package has been around for some years, in different versions, and if you have used it earlier than 2025 you have seen a different set of options. Some of these are obsolete but still supported, so old files using the switches \texttt{LTH}, \texttt{LU}, \texttt{swe} and \texttt{logoBW} should still work.
\section{Variables}
In the template teher are some predefined variables (or commands) to set affiliation and other things, used in the header and footer. For the footer the following commands are used:
\begin{CodeBox}{}
\Address{Address}
\Visiting{Visiting}
\Phone{Phone}
\Mobile{Mobile}
\Fax{Fax}
\Email{Email}
\Web{Web}
\end{CodeBox}
\noindent In the header the following commands are used:
\begin{CodeBox}{}
\DocumentName{DocumentName}
\Diarienum{Diarienum}
\Department{Department}
\Admin{Admin}
\end{CodeBox}
\noindent The commands for Department and Admin is what goes under the logo, where Admin is typically the person. To remove any of the variables from the letter layout, set them with an empty argument. For example, to remove the Fax number use \verb|\Fax{}|.
The date can, as usual, be changed with \verb|\date{January 1, 2030}|. By default it uses the current date, set by \verb|\date{\today}|, which is inherited from the parent class \texttt{letter}.
\section{Differences to the official templates}
The template is not an official LU template, but it is an attempt to mimic the official Word-files that are.
As a public authority the university must follow the rules setup about accessibility of documents and web-pages. Even though there is a lot of activities for this in the \TeX\ and \LaTeX\ community, there is still a lot left to do. For more on accessibility see the section about it below.
The sets of fonts, and the default fonts, differ between \TeX\ and Word. In this class the original font setup in \TeX\ is used, i.e. Computer Modern for both rm (cmr), sf (cmss) and tt (cmtt) font. Word, on the other hand, uses Times New Roman and Arial for the rm and sf fonts. The easiest way to get close to this is to load the \texttt{mathptmx} package, which sets the rm font to Times (ptm). Arial does not exist in most \LaTeX\ distributions, and normally Helvetica (phv) is used instead, which can be loaded by the \texttt{helvet} package (with a scaling factor to get the same hight as Times). Finally, it is common to also use Courier (pcr) as the tt font, which is loaded by \texttt{courier}. So adding the following lines to your preamble should get similar fonts:
\begin{CodeBox}{}
\usepackage{mathptmx}
\usepackage[scaled=.93]{helvet}
\usepackage{courier}
\end{CodeBox}
A variant for the rm font is to use Palatino (ppl) which can be loaded with \texttt{mathpazo}. In combination with Helvetica and Courier can be used with the following:
\begin{CodeBox}{}
\usepackage{mathpazo}
\usepackage[scaled=.93]{helvet}
\usepackage{courier}
\end{CodeBox}
The Word templates have ragged right margins, while \LaTeX\ typically has straight right margin. To get ragged right margin use \verb|\raggedright| in the preamble. Notice, that this also sets \verb|\parindent| to zero, meaning the horisontal space denoting new paragraph disappears. In the class this is set to \texttt{15pt}, which needs to be reset:
\begin{CodeBox}{}
\raggedright
\parindent=15pt
\end{CodeBox}
\section{Known issues}
One known issue is that the footer layout does not care about the amount of text that goes into it. That is, especially for the English version, if all fields are used in the first line with addresses and phone numbers, it may exceed the line-length and continue out of the page range. One way to get around this is to put all entries after each other in a box or table with predefined width. Then it can be set in as many lines as necessary. On the other hand, there is a significant risk it might also be quite ugly. I am open for other suggestions.
If there are other issues or bugs with the class, please let me know, the contact information is in the footer on the first page. Of course, that also goes for suggestions of improvements.
\section{Installation}
To install, save the directories \texttt{ulundletter} and \texttt{logo} in the local search path. Notice, you need to install both directories and both are distributed as zip-files. For \textbf{TeXlive} distributions the local folder can be found by entering the command
\begin{CodeBox}{}
> kpsewhich -var-value=TEXMFHOME
\end{CodeBox}
This will give the location of the search directory \verb|<TEXMFHOME>|. If the directory does ot exists, then create it. Also create the path \verb|<TEXMFHOME>/tex/latex/| and save the directories \texttt{ulundletter} and \texttt{logo}. For a standard installation that means the directories:
\begin{itemize}
\item MAC: \verb|~/Library/texmf/tex/latex/ulundletter/|
\item Linux: \verb|~/Library/texmf/tex/latex/ulundletter/|
\item Windows: \verb|<user>\texmf\tex\latex\ulundletter\|
\end{itemize}
and similar for the directory \texttt{logo}.
The Windows path I am a bit uncertain about and would appreciate a confirmation.
For \textbf{MikTeX} distribution I am unsure of where the local path is. If someone knows I will complement the description. For \textbf{Overleaf}, I am looking for a way to install it such that it is accessible by all. But for now the easiest way is to put the files and folders in your working directory.
As an alternative to a real installation of the package, file \texttt{ulundletter.cls} and the directory \texttt{logo} can be saved in the same directory as the \texttt{.tex}-file.
\section{Accessibility}
As an authority, it is required that our documents comply with the accessibility directive. One thing is that the produced pdf-file uses tagging so that reading programmes can understand it. There is an ongoing work in the \LaTeX\ community to comply with this. There are a couple of different activities, but one of them is in the process of being implemented in the core. This is not as easy as it sounds, and currently you will get it with a reasonably new installation, at least from 2024. Then the following lines can be added to your file before the \verb|\documentclass| command. Write:
\begin{CodeBox}{}
\DocumentMetadata
{
% testphase = phase-I, % tagging w/o paragraph tagging
testphase = phase-II, % tagging with paragraph tagging
% testphase = phase-III, % tagging par sec, toc, blocks
pdfversion = 2.0, % pdfversion must be set here.
pdfstandard=ua-2, % pdfstandard can be set too
}
\documentclass[...]{...}
\end{CodeBox}
This will add tags to the pdf-file for Table of contents, chapter and section headers, inmages and other things.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% \begin{letter}{\LaTeX\ users\\ LTH}
%% \opening{Example code}
\section{Example code}
Since the class is based on the standard class \texttt{letter.cls} it is used the same way. A basic letter without any settings can be started with the following code,
\begin{CodeBox}{}
\documentclass[11pt]{ulundletter}
\usepackage[utf8]{inputenc} % To get UTF-1 coding
\usepackage[T1]{fontenc} % e.g. Swedish letters åäö
\signature{Your Name}
\begin{document}
\begin{letter}{To whom it may concern}
\opening{About the letter}
Text
\closing{Kind regards,}
\end{letter}
\end{document}
\end{CodeBox}
The preamble of this document is (excluding the accessibility code snippet):
\begin{CodeBox}{}
\documentclass[%
11pt,
logo=LU,% {LU/LTH/CHbg/Nfak/LNL}
eng=false,% {true/false}
logocol=false,% {true/false}
Layout=Orig,% {Orig/Access}
]{ulundletter}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%%%%%%%%%% Fonts
\usepackage{mathptmx}
% \usepackage{mathpazo}
\usepackage[scaled=.93]{helvet}
\usepackage{courier}
%%%%%%%%%% Margins
% \raggedright
% \parindent=15pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Footer
\Address{Box 118, 22100 Lund}
\Visiting{Klas Anshelms väg 10, Lund}
\Phone{+46 46 222 4278}
\Mobile{}
\Fax{}
\Email{stefan.host@eit.lth.se}
\Web{www.eit.lth.se}
%% Header
% \DocumentName{}
% \Diarienum{}
\Department{Electrical and Information Technology}
\Admin{Stefan Höst}
%% Letter
\signature{Stefan Höst}
\end{CodeBox}
\closing{Happy \TeX-ing,}
\end{letter}
\end{document}