I hope that everyone is safe and all right with the health crisis we're facing.
My question today is maybe a elementary one but let's go :
Some months ago, one among us has said, in an answer to a question of mine, that my preamble was messy, that we couldn't know where you're going with this, what you try to do with it.
I would like first to thank him a lot for it and ask the question :
How to organize a preamble ? I've had a few classes about using LaTeX but nobody did care about presenting us a way to efficiently organize the preamble so we could read and re-read it later.
I'm actually facing problems myself in figuring where some things are just because I don't feel there 's any structure to it (but maybe it's a more general problem about me).
Here below, I show you my preamble (with screenshots, it's easier for me to not get the whole messy copy/paste I then did when that good user made the remarks about it).
%-----(A CORRIGER)-----%
% corriger la hauteur des "en-têtes" pour permettre l'insertion des en-têtes intermédiaires qui reprennent les titres de chapitres/section". (cf log triangle jaune) --> solution trouvée avec les titres courts => \chapter [titre court] {titre long}%
%--------------------------%
%-----(BEGIN PREAMBLE)-----%
%--------------------------%
\documentclass[a4paper,12pt ,twoside ,openright ,extrafontsizes]{memoir}
\raggedbottom
%[twoside] est utilisé pour indiquer que le document sera imprimé recto-verso.%
%[openright] est utilisé pour indiquer que tout nouveau chapitre doit commencer sur un recto.%
%[extrafontsizes] est utilisé pour permettre, si l'on veut, le recours à des tailles de polices d'écritures dépassant les 25pt.
%-----( BEGIN PACKAGEs)-----%
%---------------------------%
\usepackage[utf8]{inputenc} %obligatoire%
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{xcolor}%pour surligner du texte (la commande en cours de frappe est : \colorbox{couleur}{texte à surligner}%
\usepackage{soulutf8} %la commande pour surligner est : \texthl{texte à surligner}
\usepackage{ulem}
%-----(BEGIN MACRO)-----%
%-----------------------%
%enclenche le style de chapitre utilisé (pour d'autres exemples compatibles, voir "the memoir class (2018) p.385 et sq.)
\newcommand*{\sclabel}[1]{\normalfont\scshape #1} %à voir si je conserve, permet de personnaliser les étiquettes des items des listes...
\OnehalfSpacing %interligne 1,5
%-----CHAPTER STYLE "ELL" (BEGIN)-----%
\makeatletter %ne pas oublier cette balise lorsque l'on copie/colle un bout de code tel quel%
\makechapterstyle{ell}{%
\chapterstyle{default}
\renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily}
\renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily}
\settowidth{\chapindent}{\chapnumfont 111}
% \renewcommand*{\chapterheadstart}{\begingroup
% \vspace*{\beforechapskip}%
% \begin{adjustwidth}{}{-\chapindent}%
% \hrulefill
% \smash{\rule{0.4pt}{15mm}}
% \end{adjustwidth}\endgroup}
\renewcommand*{\printchaptername}{}
\renewcommand*{\chapternamenum}{}
\renewcommand*{\printchapternum}{%
% \begin{adjustwidth}{}{-\chapindent}
% \hfill
% \raisebox{10mm}[0pt][0pt]{\chapnumfont \thechapter}%
% \hspace*{1em}
% \end{adjustwidth}\vspace*{-3.0\onelineskip}
\chs@ell@helper{\thechapter}%
}
\renewcommand\printchapternonum{%
\chs@ell@helper{}\afterchapternum}
\renewcommand*{\printchaptertitle}[1]{%
%\vskip\onelineskip
\raggedleft {\chaptitlefont ##1}\par\nobreak}}
\makeatother % et ne pas oublier celle-ci pour clore le cadre créé par \makeatletter en début de copier/coller.
%-----CHAPTER STYLE "ELL" (END)-------%
\chapterstyle{ell}%à placer après la section ci-dessus qui reparamètre certains aspects du "chapterstyle ELL". Si on place la commande avant, elle chargera la configuration d'origine au lieu de prendre encompte les modifications ci-dessus.
\setsecnumdepth{section}%indique à partir de quel niveau de titre on numérote
\maxsecnumdepth{subsubsection}%indique jusqu'à quel niveau de titre on numérote
\setlength{\headheight}{15.5pt}
%-----(END MACRO)-----%
%---------------------%
%--------------------------%
%------(END PREAMBLE)------%
%--------------------------%
I only ask for advice on how to do the things.
I use the memoir class as you can see and I've maybe wrongly named my sections. Because I realize now that the entire " 'ELL' chapter style code" I copied/pasted from the memoirclass source file is not a "macro" in any way.
Anyway, I would like to thank that person and all of you who will come by, read me and maybe provide me some advice,
Thanks again and stay safe !
Elrad
{}on it in the editor orctrl+kon your keyboard. For more information on that see How do I mark code blocks?. – leandriis Apr 02 '20 at 10:25hyperref,cleverefand some others. Probably add a comment on that as well. – leandriis Apr 02 '20 at 10:25I thank everyone for your answers :
@Mico : no I didn't I'll do it.
– Elradsoldier Apr 02 '20 at 11:13