From 82aa8b2aab008bf86730dac61cabbf84460cb3d8 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 13 Dec 2023 18:37:36 +0100 Subject: [PATCH] chore: reformat and translate --- Makefile | 40 +++++++++++----------- easyLetter.cls | 93 +++++++++++++++++++++++--------------------------- 2 files changed, 63 insertions(+), 70 deletions(-) diff --git a/Makefile b/Makefile index 3e6feb4..2e246b6 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,19 @@ -NAME = _letter -TEX = $(NAME).tex -FULLNAME = Lettre +NAME = _letter +TEX = $(NAME).tex +FULLNAME = Lettre DIRECTORIES = $(filter-out "." ".git",$(shell find . -maxdepth 1 -type d -printf "\"%f\" ")) -TEMP_FILES = aux log tns fdb_latexmk fls synctex.gz pdf out TEMPLATE = Template -TEXMK = latexmk -lualatex -RM = rm -f -CP = cp -r +TEXMK = latexmk -lualatex +RM = rm -f +CP = cp -r all: build -clean: - @for dir in $(DIRECTORIES); do \ - cd "$$dir"; \ - $(RM) $(foreach i,$(TEMP_FILES),$(NAME).$(i)); \ - cd ..; \ - done; - -clean-full: - $(MAKE) clean - $(RM) *.pdf +new: + @echo Nom du dossier ? + @read line; echo $$line | xargs -i $(CP) '$(TEMPLATE)' {}/ build: @for dir in $(filter-out "$(TEMPLATE)",$(DIRECTORIES)); do \ @@ -31,6 +23,14 @@ build: cd ..; \ done; -new: - @echo Nom du dossier ? - @read line; echo $$line | xargs -i $(CP) '$(TEMPLATE)' {}/ +EXTS = aux log tns fdb_latexmk fls synctex.gz pdf out +clean: + @for dir in $(DIRECTORIES); do \ + cd "$$dir"; \ + $(RM) $(foreach e,$(EXTS),$(NAME).$(e)); \ + cd ..; \ + done; + +clean-full: + $(MAKE) clean + $(RM) *.pdf diff --git a/easyLetter.cls b/easyLetter.cls index 8fcacc2..2007bb9 100644 --- a/easyLetter.cls +++ b/easyLetter.cls @@ -3,70 +3,63 @@ \LoadClass[a4paper,12pt]{lettre} -\AtEndPreamble{ - % Encoding - \RequirePackage[utf8]{inputenc} - \RequirePackage[T1]{fontenc} - \RequirePackage{lmodern} +% Langue +\RequirePackage[french]{babel} - % Language - \RequirePackage[french]{babel} +% Police +\RequirePackage{fontspec} +\setmainfont[Numbers={Monospaced}]{Fira Sans} +\setmonofont{Fira Code} - % Font - \RequirePackage{fontspec} - \setmainfont[Numbers={Monospaced}]{Fira Sans} - \setmonofont{Fira Code} +% Retire la ligne ajoutée pour la séparation entête/corps de la lettre +\renewcommand*{\rule@length}{0} - % Remove the extra line - \makeatletter - \newcommand*{\NoRule}{\renewcommand*{\rule@length}{0}} - \makeatother - \NoRule - - % Clickable links + metadata - \RequirePackage[pdfauthor={\@author}, - pdftitle={\@title}, - pdfsubject={\@subject}, - pdfkeywords={\@author, lettre\@keywords}, - pdfcreator={LaTeX with 'easyLetter' preset}, - % Hide links - hidelinks - ]{hyperref} -} - -% Title +% Titre \newcommand*{\titre}[1]{\def\@title{#1}} -% Author +% Auteur \newcommand*{\auteur}[1]{\def\@author{#1}} -% Opening -\newcommand{\ouverture}[1]{\def\@opening{#1}} - -% Closing -\newcommand{\cloture}[1]{\def\@closing{#1}} - -% Subject +% Sujet \def\@subject{\,} \newcommand*{\sujet}[1]{\def\@subject{#1}} -% Keywords +% Mot-clés \def\@keywords{\,} \newcommand*{\motscles}[1]{\def\@keywords{\if#1\empty\else, #1\fi}} -% Receiver +% Clickable links + metadata +\AtEndPreamble{ + \RequirePackage[ + pdfauthor={\@author}, + pdftitle={\@title}, + pdfsubject={\@subject}, + pdfkeywords={\@author, lettre\@keywords}, + pdfcreator={LaTeX with 'easyLetter' preset}, + % Hide links + hidelinks + ]{hyperref} +} + +% Introduction +\newcommand{\ouverture}[1]{\def\@opening{#1}} + +% Conclusion +\newcommand{\cloture}[1]{\def\@closing{#1}} + +% Destinataire \newcommand{\destinataire}[3]{\def\@receivername{#1}\def\@receiverAddress{#2}\def\@receiverCity{#3}} -% Letter content +% Contenu de la lettre \newenvironment{easyLetter}{ - \begin{letter}{ - % Destinataire - \@receivername \\ - \@receiverAddress \\ - \textsc{\@receiverCity} - } - \conc{\@title} - \opening{\@opening}}{ - \closing{\@closing} - \end{letter} + \begin{letter}{ + % Destinataire + \@receivername \\ + \@receiverAddress \\ + \textsc{\@receiverCity} + } + \conc{\@title} + \opening{\@opening}}{ + \closing{\@closing} + \end{letter} }