diff --git a/content/examples/background-latex.pdf b/content/examples/background-latex.pdf new file mode 100644 index 0000000..12af6d9 Binary files /dev/null and b/content/examples/background-latex.pdf differ diff --git a/content/images/cover_palace.jpg b/content/images/cover_palace.jpg new file mode 100644 index 0000000..7e46372 Binary files /dev/null and b/content/images/cover_palace.jpg differ diff --git a/content/tips-letterhead.md b/content/tips-letterhead.md new file mode 100644 index 0000000..f941f00 --- /dev/null +++ b/content/tips-letterhead.md @@ -0,0 +1,41 @@ +--- +Title: Use any letterhead in LaTeX +Date: 2019-04-22 20:00 +Author: Fabrice +Category: tips +Slug: latex-letterhead +Header_Cover: images/cover_palace.jpg +--- + +It sometimes appear that I have to write some official documents from some entities, especially for admin stuff. +However, those letterheads are often provided in some [proprietary format](https://en.wikipedia.org/wiki/Office_Open_XML) with which I do my best to make as few interactions as possible. +Especially, I feel more comfortable editing some LaTeX instead of writting it in [libreoffice](https://libreoffice.org/) (for instance). + +Thus, thanks to [Nicolas Trotignon](https://perso.ens-lyon.fr/nicolas.trotignon/) who found a simple workaround, here is a small trick to do it. +As a preliminary, you have to obtain a pdf version of the letterhead (to do so, I'm using [online office 365](https://en.wikipedia.org/wiki/Office_365) as it works in Linux, yes, shame on me). + +Once this is done, the core of this method is to use the `wallpaper` package to embed the letterhead as a background image, and then play with margins to make it look nice. + +Here follows a minimal example with the [corresponding output](examples/background-latex.pdf). Replace `background.pdf` with your (empty) letterhead of course. +This can also be adapted to other classes, such as [`letter.cls`](https://ctan.org/pkg/letter). + +```tex +\documentclass[a4paper]{article} +% Design and encoding stuff +\usepackage[utf8]{inputenc} +\usepackage[UKenglish]{babel} +\usepackage[T1]{fontenc} +\usepackage{libertine} +% The main trick +\usepackage{wallpaper} +\CenterWallPaper{1}{background.pdf} +% margin +\usepackage[inner=4.5cm,top=6cm]{geometry} +\begin{document} +% blabla +Hello, World! +% … +\end{document} + +``` +