TeXnique.fr is a French question-and-answer site for TeX and LaTeX. Here are the newest 20 questions. Sorry that the code formatting is not preserved through the RSS feed.

  • Yathesis: biblographie locale dans table des matières
    by GreenMaker on June 16, 2025 at 2:29 pm

    La documentation de yathesis indique en Annexe D.9 Comment supprimer la bibliographie des sommaire, table des matières et signets. Mais la réponse ne s'applique que pour la bibliographie complète du document. Pour la bibliographie locale, elle n'apparaît pas dans les tables des matières locales ou globale. Existe-il une option pour faire apparaître les bibliographies locales dans les tables de matières (locale, et automatiquement donc globale) sans ajouter de numérotation ?

  • Yathesis: personnalisation en tête/pied de page
    by GreenMaker on June 16, 2025 at 1:54 pm

    Quelle commande serait-il possible d'utiliser pour personnaliser les en-tête et pied-de-page dans yathesis ? Plus précisément on me demande de placer les numéros de page en pied-de-page et de mettre les titres des chapitres/section sur le côté externe (là où il y a la pagination actuellement).

  • Incruster une courbe sur une photo
    by Pathe on June 13, 2025 at 11:07 pm

    Pour un dossier technique, j'ai à représenter un câble suspendu entre deux points, qui sont des éléments de la toiture d'un bâtiment. Je vais donc réaliser une image dont le fond sera une élévation de ce bâtiment, sur laquelle je vais dessiner le câble. La forme que prend ce câble est déterminée par différents facteurs : la hauteur des deux points d'accroche et le poids du câble. Il en résulte une fonction quadratique, dont il me faut faire une représentation graphique dans un intervalle donné : celui représenté par l'image des deux points sur l'axe des abscisses. Peu m'importe le moteur graphique utilisé, pgfplots, metapost ou pstricks. Voici une ébauche en pgfplots : \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{transparent} \usepackage{graphicx} \begin{document} \begin{tikzpicture} \begin{axis}[ width=19cm, % ĺongueur entre deux points d'accroche 190 m height=20.5mm, % hauteur des deux points d'accroche 20.5 m xmin=0, xmax=190000, domain=0:190000, samples=200, axis lines=none, axis background/.style={fill=none}, tick label style={font=\small}, ] \addplot[ thick, red ] {0.000000928755431197484 * x^2 - 0.176463531927522 * x + 20394.20381157492}; \end{axis} \end{tikzpicture} \end{document} Comment ajouter, en fond, l'image représentant le bâtiment ? J'ai essayé de faire que la partie centrale de la courbe soit rouge (entre x = 19000 et x = 171000) tandis que ses deux extrémités soient noires, sans y réussir : comment faire ? Enfin, j'aimerais être certain que l'échelle des abscisses est la même que celle des ordonnées, car c'est le cas de l'élévation du bâtiment sur laquelle je représente ce câble. Est-ce le cas ? J'en doute un peu, j'ai l'impression que le câble est trop « tendu ».

  • BibLaTeX : définir un filtre avec un mot-clé contenant un espace.
    by polymorphisme on June 12, 2025 at 3:51 pm

    \documentclass{article} \begin{filecontents*}{\jobname.bib} @online{apqcAPQCProcessClassification2025, title = {{{APQC Process Classification Framework}} (PCF)}, author = {{APQC}}, keywords = {{business process modelling}} } \end{filecontents*} \usepackage{biblatex} \addbibresource{\jobname.bib} % Define biblatex filter. \defbibfilter{si}{keyword={{business process modelling}}}% \begin{document} \nocite{*} \printbibliography[title={Système d'information},filter={si}]% \end{document}

  • TikZ : trouver une longueur (distance)
    by joseph-tux on June 12, 2025 at 9:53 am

    Est-il possible de trouver la distance entre 2 points connus pour l'utilisez ensuite (par exemple comme rayon d'un cercle, ou pour tracer un segment de longueur identique), comme on le fait avec un compas «dans la vraie vie»?

  • TikZ : autres syntaxes pour tracer un arc avec d'autres coordonnées ?
    by joseph-tux on June 12, 2025 at 9:50 am

    Existe-t-il un moyen de tracer un arc en connaissant le centre, les extrémités sans connaître le rayon? Existe-t-il un moyen de tracer un arc à partir d'un cercle, en connaissant les angles des extrémités? Existe-t-il d'autres façons de tracer un arc?

  • TikZ : intersections
    by joseph-tux on June 9, 2025 at 4:26 pm

    Le point Phi est attendu à l'intersection du cercle rouge de centre d et de la droite G-D là où il est noté en bleu. Le code suivant l'expose au point $O$ (centre du cercle noir). Où est l'erreur? \documentclass[a4paper,11pt,french,]{scrartcl} \usepackage{tcolorbox} \tcbuselibrary{skins} \usepackage{tikz,pgf} \usetikzlibrary{intersections} \usetikzlibrary{arrows,shapes,snakes,calc, angles,quotes,positioning,automata,shadows,patterns} \usepackage[french]{babel} \begin{document} Le point $\Phi$ est attendu à l'intersection du cercle rouge de centre $d$, et de la droire rouge G--D, là où il est noté en bleu. Le code suivant l'expose au point $O$ (centre du cercle noir). Où est l'erreur? \begin{tikzpicture}[scale=0.25] % % Cercle \coordinate (H) at (0,10); \coordinate (D) at (10,0); \node[right] at (D) {$D$}; \coordinate (G) at (-10,0); \node[left] at (G) {$G$}; \node at (0,0) {$O$}; \draw[very thick] (0,0) circle (10); % % Carré: \coordinate (X) at (-10,10); \coordinate (Y) at (10,-10); \draw[] (X) rectangle (D); % %% centre d et cercle de rayon d-H: \coordinate (d) at (5,0); \draw[dotted,thick] (H) -- (d); \node[above] at (d) {\tcbox[size=fbox,coltext=red,colframe=white]{$d$}}; \node[red] at (5,0) {\footnotesize |}; %%% Intersection Phi: (BUG) \draw[name path=d,red] (5,0) circle (11.18); \draw[name path=GD,red] (G) -- (D); \node[thick,red,name intersections={of=d and GD}] (intersection-1) {\footnotesize |}; \node[thick,red,above,name intersections={of=d and GD}] (intersection-1) {$\Phi$}; %%% Par sa mesure: \coordinate (Phi) at (-6.18,0); % TODO À TROUVER avec intersections \node[above,blue] at (Phi) {\tcbox[size=fbox,coltext=blue,colframe=white]{$\Phi$}}; % TODO TROUVÉ avec intersections \node[blue] at (-6.18,0) {\footnotesize |}; % TODO TROUVÉ avec intersections \end{tikzpicture} \end{document}

  • Erreur incomprise de tcbminted
    by joseph-tux on June 4, 2025 at 9:33 am

    Compilé avec XeLaTeX (via latexmk et avec --shell-escape) Voici le message bloquant: (./ECM_arc.aux) ! LaTeX Error: Environment tcbminted undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.22 \begin{tcbminted} {text} et l'exemple complet (presque) minimum: \documentclass[french]{scrartcl} \usepackage{minted} \usepackage{tcolorbox} \tcbuselibrary{skins,minted} \tcbset{listing engine=minted} \usepackage{tikz} \usepackage[french]{babel} \begin{document} La syntaxe pour la construction d’un arc de cercle est la suivante : \verb+ \tikz\draw (a,b) arc (\alpha:\beta:r); + \itemize{% \item (a, b) les coordonnées du point de départ de l’arc. \item \verb+\alpha+ est l’angle de départ en degré, c’est l’angle orienté, dans le sens trigonométrique, formé par le vecteur OA et l’axe orizontal, où O est le centre de l’arc et A le point de départ. \item \verb+\beta+ est l’angle de l’arc, c’est l’angle orienté formé par les vecteurs OA et OB, où B est le point d’arrivé. \item r le rayon de l’arc. } Exemples: \begin{tcbminted}{text} \begin{tikzpicture} \draw[thick,latex-latex] (0,6) -- (0,0) -- (6,0) ; \foreach \x in {0,1,2,...,5} \draw[black] (\x,-0.04) -- (\x,0.04); \foreach \y in {0,1,2,...,5} \draw[black] (-0.04,\y) -- (0.04,\y); \draw[blue] (3,0) arc (-15:180:1.5); \draw[red] (3,0) arc (30:240:1.5); \draw[green] (3,0) arc (-45:150:1.5); \end{tikzpicture} \end{tcbminted} \end{document} Le message implique tikzpicture, mais n'intervient qu'avec tcbminted. Dans \begin{tcbminted}, j'ai essayé sans indiquer {text} et surtout en essayant {tex} et {latex} dans différentes casses, en vain

  • Note ; filet ; position
    by MFerrer on May 8, 2025 at 1:31 pm

    En bas de page, je souhaiterais pouvoir modifier la longueur de l’amorce de filet maigre des notes : i. fixer une longueur en cm ; ii. fixer la longueur à 1/5 de la justification. Sur une page creuse, je souhaiterais rapprocher la note du texte.

  • Package chronosys et centrage du texte dans une boîte
    by Pathe on May 5, 2025 at 6:38 pm

    Grâce à @samcarter, j'ai pu obtenir, avec le package chronosys, des boîtes dont je contrôle la couleur du fond. Mais comment centrer le texte de la boîte ? Dans l'exemple ci-dessous, j'aimerais que « Caliorne » et « Bredindin » soient centrés sous « 1915 » (qui est parfaitement centré par rapport à la ligne indiquant l'année en question). \documentclass[a5paper, landscape]{scrartcl} \usepackage{chronosys} \usepackage{xcolor} \pagecolor{brown!30} \begin{document} \startchronology[startyear=1900,startdate=false,stopyear=1932,stopdate=false,color=yellow,height=10ex,width=\hsize] \chronoevent[markdepth=-80pt,ifcolorbox=false,textwidth=1.2cm,colorbox=brown!30]{1915}{\color{blue}Caliorne Bredindin} \stopchronology \end{document}

  • Package chronosys et couleur de fond des boîtes
    by Pathe on May 4, 2025 at 8:48 am

    Malgré la parution de deux packages de frises chronologiques le mois dernier (timechart, qui est très facile à utiliser, et chronos, très impressionnant... mais que je ne suis pas foutu de faire fonctionner), j'en reste à chronosys. J'ai le code suivant : \documentclass[a5paper, landscape]{scrartcl} \usepackage{chronosys} \usepackage{xcolor} \pagecolor{brown!30} \begin{document} \startchronology[startyear=1945, startdate=false, stopyear=2025, stopdate=false, color=yellow, height=10ex, width=\hsize] \chronoevent[markdepth=-120pt, ifcolorbox=false]{2017}{\color{red}Bidule} \chronoevent[markdepth=-80pt,ifcolorbox=false]{2022}{\color{blue}Caliorne Bredindin} \stopchronology \end{document} La chaîne « Caliorne Bredindin » dépasse sur la ligne verticale correspondant à 2017 : ce n'est pas très heureux. Je spécifie donc une largeur pour la boîte contenant cette chaîne : \chronoevent[markdepth=-80pt,ifcolorbox=false,textwidth=1.2cm]{2022}{\color{blue}Caliorne Bredindin}. J'obtiens le code suivant : \documentclass[a5paper, landscape]{scrartcl} \usepackage{chronosys} \usepackage{xcolor} \pagecolor{brown!30} \begin{document} \startchronology[startyear=1945,startdate=false,stopyear=2025,stopdate=false,color=yellow,height=10ex,width=\hsize] \chronoevent[markdepth=-120pt, ifcolorbox=false]{2017}{\color{red}Bidule} \chronoevent[markdepth=-80pt,ifcolorbox=false,textwidth=1.2cm]{2022}{\color{blue}Caliorne Bredindin} \stopchronology \end{document} C'est beaucoup mieux, mais la boîte « Caliorne Bredindin » a maintenant un fond blanc ! Comment éviter cela ?

  • Texte avec plusieurs fontes
    by fred02840 on April 29, 2025 at 10:43 am

    Je n'arrive pas à retrouver la méthode pour utiliser ponctuellement une autre fonte (Computer Modern, par ex., sans empattements) que celle qui a été définie par défaut (kpfonts, par ex.). Cela me serait utile pour quelques paragraphes et quelques phrases en particulier. J'ai examiné la question posée par @Pathe, il y a quelques années, mais je ne comprends pas comment il parvient à utiliser Computer Modern sans qu'on en trouve mention dans le préambule… \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{kpfonts} \begin{document} Ce paragraphe en kpfonts : normal. Mais ce paragraphe-ci en Computer Modern (sans empattements, je le rappelle). Et je remets kpfonts. Aaaah ben non : ce sera Computer Modern (toujours sans empattements). Et puis, tiens, la suite est en `kpfonts` (quel farceur…). \end{document}

  • Mode math: espace entre nombre et unité physique
    by joseph-tux on April 26, 2025 at 1:13 pm

    N'utilisant jamais les mathématiques avec LaTeX (XeLaTeX), j'ignore comment LaTeX gère l'espace entre un nombre et l'unité qui suit. Quel est l'indication à donner dans le source respectant la bonne pratique typographique? Ici, il n'y a aucune espace: \documentclass{article} \begin{document} $56 g$ pour $24 cm³$ = densité de $2,33$ \end{document}

  • Tableau à double entrée avec Nicematrix
    by endomorphisme on April 22, 2025 at 2:57 pm

    Dans le code suivant, la case de double entrée est trop petite : \documentclass[11pt, french]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} \usepackage{nicematrix} \usepackage{babel} \begin{document} \[ \begin{NiceArray}{*{5}{c}}[hvlines] \diagbox{b\,[4]}{c\,[4]} & 0 & 1 & 2 & 3 \\ 0 & 0 & 1 & 0 & 1 \\ 1 & 1 & 2 & 1 & 2 \\ 2 & 0 & 1 & 0 & 1 \\ 3 & 1 & 2 & 1 & 2 \end{NiceArray} \] \end{document} J'ai tenté d'utiliser les options du package diagbox, mais le résultat est encore pire: \documentclass[11pt, french]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} \usepackage{nicematrix} \usepackage{babel} \begin{document} \[ \begin{NiceArray}{*{5}{c}}[hvlines] \diagbox[width=7em,height=3em]{b\,[4]}{c\,[4]} & 0 & 1 & 2 & 3 \\ 0 & 0 & 1 & 0 & 1 \\ 1 & 1 & 2 & 1 & 2 \\ 2 & 0 & 1 & 0 & 1 \\ 3 & 1 & 2 & 1 & 2 \end{NiceArray} \] \end{document} Comment solutionner ce problème ?

  • Mettre un barre verticale à gauche de Blockquote
    by GreenMaker on April 14, 2025 at 12:54 pm

    Je voudrai afficher une ligne verticale sur la gauche des citations longues avec \blockquote, ma solution actuelle est de mettre mon texte dans un tableau et d'afficher le contour gauche. Existe-t-il un moyen de d'incorporer ça directement dans la commande de \blockquote ? \documentclass[]{yathesis} \usepackage[backend=biber,safeinputenc]{biblatex} \usepackage{lipsum} \usepackage[autostyle]{csquotes} \newenvironment{italicquote}{\quote\itshape}{\endquote} \SetBlockEnvironment{italicquote} \begin{document} \lipsum[1] \blockquote{\lipsum[2]} %Solution temporaire \begin{center} \begin{tabular}{|p{13cm}} \textit{\lipsum[3]} \end{tabular} \end{center} \end{document}

  • TeX Live et getnonfreefonts
    by Pathe on April 7, 2025 at 11:47 am

    J'utilise une TeX Live 2025 à jour, sur un système GNU/Linux. J'ai besoin d'une fonte fournie par getnonfreefonts. Me référant à la page dédiée, je fais : ~ wget https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts --2025-04-07 13:40:54-- https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts Resolving www.tug.org (www.tug.org)... 46.4.94.215 Connecting to www.tug.org (www.tug.org)|46.4.94.215|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 33640 (33K) [application/octet-stream] Saving to: ‘install-getnonfreefonts’ 0K .......... .......... .......... .. 100% 1.64M=0.02s 2025-04-07 13:40:54 (1.64 MB/s) - ‘install-getnonfreefonts’ saved [33640/33640] Je continue l'installation : ~ texlua install-getnonfreefonts Detected System: x86_64-linux Detected Installation: /usr/local/texlive/2025 Installing texmf-dist/scripts/getnonfreefonts/getnonfreefonts.pl ... install-getnonfreefonts:994: /usr/local/texlive/2025/texmf-dist/scripts/getnonfreefonts/getnonfreefonts.pl: Permission denied Il est vrai que j'avais eu besoin de sudo pour installer ma TeX Live. Je fais donc sudo texlua install-getnonfreefonts : ~ sudo texlua install-getnonfreefonts Detected System: x86_64-linux Detected Installation: /usr/local/texlive/2025 Installing texmf-dist/scripts/getnonfreefonts/getnonfreefonts.pl ... [done] Installing texmf-dist/doc/man/man1/getnonfreefonts.1 ... [done] Installing texmf-dist/doc/man/man1/getnonfreefonts.man1.pdf ... [done] md5sum: fcc12b475cb7b1e11125e0deeadd2bca getnonfreefonts.pl ... [ok] md5sum: 7eedbc34762d571db90637c4c29c6d7a getnonfreefonts.1 ... [ok] md5sum: 0e4bbb9a732fb9e7b9e1d80e993ffb47 getnonfreefonts.man1.pdf ... [ok] Fixing File Permissions ... [done] Creating symlink in 'bin/x86_64-linux' ... [done] mktexlsr: Updating /usr/local/texlive/2025/texmf-dist/ls-R... mktexlsr: Done. « Chouette, ça a fonctionné », me dis-je. Mais voilà : ~ getnonfreefonts --sys --help zsh: command not found: getnonfreefonts Y ajouter une pincée de sudo n'aide pas : ~ sudo getnonfreefonts --sys --help sudo: getnonfreefonts: command not found Il se passe quoi ?

  • Page de table des matières numérotée
    by LaTeXBold on April 4, 2025 at 12:39 pm

    Je souhaite récupérer une numérotation des pages en style romain et centrée sur chaque page où il y a une table des matières présente (pas sur les pages blanches qui précèdent ou suivent ladite table). J'arrive à changer le style des pages affichées dans la table, mais pas la numérotation des pages de la table elle-même. Voici le template : $passoptions.latex()$ \documentclass[ $for(babel-otherlangs)$ $babel-otherlangs$, $endfor$ $if(babel-lang)$ $babel-lang$, $endif$ $if(fontsize)$ $fontsize$, $endif$ $for(classoption)$ $classoption$$sep$, $endfor$ ]{$documentclass$} $if(beamerarticle)$ \usepackage{beamerarticle} % needs to be loaded first $endif$ \usepackage{amsmath,amssymb} % -- % -- section numbering % -- $if(numbersections)$ \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$} $else$ \setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$ $fonts.latex()$ $font-settings.latex()$ $common.latex()$ $for(header-includes)$ $header-includes$ $endfor$ $after-header-includes.latex()$ $hypersetup.latex()$ $if(title)$ \title{$title$$if(thanks)$\thanks{$thanks$}$endif$} $endif$ $if(subtitle)$ \usepackage{etoolbox} \makeatletter \providecommand{\subtitle}[1]{% add subtitle to \maketitle \apptocmd{\@title}{\par {\large #1 \par}}{}{} } \makeatother \subtitle{$subtitle$} $endif$ \author{$for(author)$$author$$sep$ \and $endfor$} \date{$date$} % ============================= % Metadata configuration % ============================= \hypersetup{pdftex, pdfauthor={Your Name}, pdftitle={The Title}, pdfsubject={The Subject}, pdfkeywords={Some Keywords}, pdfproducer={Latex with hyperref, or other system}, pdfcreator={pdflatex, or other tool}} % ============================= % Package loading % ============================= \usepackage{xcolor} % Color management \usepackage{ifthen} % Condition handling \usepackage{fancyhdr} % Header and footer customization \usepackage{fontspec} % Allows using custom fonts with LuaLaTeX \usepackage{titlesec} % Title styles customization \usepackage{textcase} % Case conversion \usepackage{graphicx} % Image management \usepackage{geometry} % Margin definition \usepackage{newunicodechar} % Unicode character support % ============================= % Counter management % ============================= \setcounter{secnumdepth}{1} % Sets the numbering level (H1 to H5) % ============================= % LaTeX configuration section % ============================= % Command to insert cover page with specified image \newcommand{\insertcover}{ \newgeometry{margin=0pt} % Removes margins for cover \begin{titlepage} % Start of title page \noindent\includegraphics[width=1\paperwidth,height=1\paperheight]{./assets/covers/$cover-image$} \end{titlepage} \restoregeometry % Restores default margins } % Command to insert back cover with specified image \newcommand{\insertbackcover}{ \newgeometry{margin=0pt} % Removes margins for back cover \begin{titlepage} % Start of back cover page \includegraphics[width=\paperwidth,height=\paperheight]{./assets/covers/$back-cover-image$} \end{titlepage} \restoregeometry % Restores default margins } % ============================= % Modifiable parameters % ============================= \definecolor{colorH1}{RGB}{4, 32, 80} % Color definition for H1 % Title configuration variables \newcommand{\TitleUppercase}{true} % Enable/disable uppercase for titles \newcommand{\TitleNumbering}{true} % Enable/disable title numbering \newcommand{\HOneColor}{colorH1} % H1 titles color \newcommand{\HTwoColor}{black} % H2 titles color \newcommand{\HThreeColor}{black} % H3 titles color \newcommand{\HFourColor}{black} % H4 titles color \newcommand{\HFiveColor}{black} % H5 titles color % Function to handle title uppercase formatting \newcommand{\TitleFormat}[1]{% \ifthenelse{\equal{\TitleUppercase}{true}}{\MakeUppercase{#1}}{#1}% } % ============================= % Main font configuration % ============================= \setmainfont{Playfair Display} % Main font for the document \newfontfamily\codeFont{Hack} % Font for code blocks % Title font configuration \newfontfamily\hOneFont{Russo One} % H1 title font \newfontfamily\hTwoFont{Russo One} % H2 title font \newfontfamily\hThreeFont{Russo One} % H3 title font \newfontfamily\hFourFont{Russo One} % H4 title font \newfontfamily\hFiveFont{Russo One} % H5 title font % No native H6 title with LaTeX % Emoji configuration \newfontfamily{\notoemojiFont}{Noto Emoji Regular}[ Renderer=HarfBuzz, Scale=1.0 ] \DeclareTextFontCommand{\notoemojiSymbol}{\notoemojiFont} \renewcommand{\baselinestretch}{1.2} % Global line spacing configuration % ============================= % Title styles definition % ============================= % --- Title H1 --- \titleformat{\chapter} [block] % Block format to take full width {\hOneFont\fontsize{32pt}{36pt}\bfseries\color{\HOneColor}} % Style: font, size, bold, color {\ifthenelse{\equal{\TitleNumbering}{true}}{\thechapter\hspace{-0.5em}}{}} % Conditional numbering {1em} % Spacing before title {\TitleFormat} % Apply format (uppercase if enabled) % --- Section H2 --- \titleformat{\section} {\hTwoFont\fontsize{24pt}{28pt}\bfseries\color{\HTwoColor}} % H2 title style {\ifthenelse{\equal{\TitleNumbering}{true}}{\thesection\hspace{-0.5em}}{}} % Conditional numbering {1em} % Spacing before title {\TitleFormat} % Title format % Force a new page for each new section except the first \let\OldSection\section \renewcommand{\section}{\ifnum\value{section}=0\clearpage\fi\OldSection} % --- Subsection H3 --- \titleformat{\subsection} {\hThreeFont\fontsize{18pt}{22pt}\bfseries} % H3 title style {\thesubsection}{1em}{} % --- Sub-subsection H4 --- \titleformat{\subsubsection} {\hFourFont\fontsize{16pt}{20pt}\bfseries} % H4 title style {\thesubsubsection}{1em}{} % --- H5 --- \titleformat{\paragraph} {\hFiveFont\fontsize{14pt}{18pt}\bfseries} % H5 title style {\theparagraph}{1em}{} % ============================= % Margin and layout management % ============================= \usepackage[strict]{changepage} % Advanced margin management \geometry{ paperwidth=190mm, % Paper width paperheight=230mm, % Paper height inner=24mm, % Inner margin (binding side) outer=24mm, % Outer margin top=24mm, % Top margin bottom=40mm, % Bottom margin footskip=18mm, % Distance between text and page number bindingoffset=12mm % Binding offset } % Defines space between text and footnotes \renewcommand{\footnoterule}{\vspace{18pt}\hrule width 0.3\textwidth \vspace{5pt}} % ============================= % Page number management % ============================= \fancyhf{} % Clear default headers and footers \fancyhead[C]{\fontsize{9pt}{10pt}\selectfont\leftmark} % Header: using same size for font and leadingfor consistent sizing \fancyfoot[LE,RO]{\thepage} % Page numbering on left for odd pages and right for even pages \pagestyle{fancy} % Activate custom style \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}} \assignpagestyle{\chapter}{empty} % ============================= % Inline code and code block formatting % ============================= \usepackage[listings, skins, breakable]{tcolorbox} % Load package with correct options % ============================= % Inline code (gray background, rounded, Hack font) % ============================= \DeclareTotalTCBox{\texttt}{m}{% fontupper=\codeFont, colback=gray!10, % Gray background arc=4pt, % Rounded corners boxrule=0pt, % No border left=4pt, right=4pt, % Horizontal internal spacing top=0pt, bottom=0pt, % Vertical internal spacing boxsep=0.5pt, % Spacing around text on line}{\strut#1} % ============================= % Code blocks (gray background, rounded, Hack font) % ============================= \DeclareTCBListing{verbatim}{}{ colback=gray!10, % Light gray background for block arc=4pt, % Rounded corners (4px) boxrule=0pt, % Border thickness listing only, % No extra space around breakable, % Allow page break fontupper=\codeFont, % Apply code font enhanced, % Improve background and border rendering listing engine=listings, listing options={basicstyle=\codeFont\small} } % ============================= % Alerts % ============================= % Color definitions for each alert type \definecolor{notecolor}{HTML}{183394} % Blue for notes \definecolor{tipcolor}{HTML}{339418} % Green for tips \definecolor{importantcolor}{HTML}{FFC800} % Yellow for important \definecolor{warningcolor}{HTML}{FF7500} % Orange for warning \definecolor{cautioncolor}{HTML}{BD0404} % Red for caution % Custom alert block configuration % #1: vertical line color % #2: icon name (without extension) \newtcolorbox{alertblock}[2]{ enhanced, % Enable advanced features fontupper=\raggedright, % Align text to left colback=gray!5, % Light gray background (5%) boxrule=0pt, % No border arc=4pt, % Rounded corners frame empty, % No frame left=4mm, % Left margin right=2mm, % Right margin top=4mm, % Top margin bottom=4mm, % Bottom margin before upper={ % Start of block structure \begin{minipage}[c]{8mm} % Icon area (8mm) \raisebox{-.5\height}{\includegraphics[height=7mm]{#2.pdf}} % Centered icon vertically \end{minipage}% \hspace{3mm}\textcolor{#1}{\vrule width 0.6pt}\hspace{6mm} % Colored vertical line \begin{minipage}[t]{\dimexpr\linewidth-22mm\relax} % Text area }, after upper={% % Close environments \end{minipage}% } } \begin{document} % Remove page numbers for cover and following blank page \pagestyle{empty} % Insert cover on first page \insertcover \clearpage % Add a single blank page after cover \mbox{} % Reactivate page style but without displaying number on this blank page \pagestyle{empty} \pagenumbering{arabic} \setcounter{page}{1} % Display page numbers from the first real content page \clearpage \pagestyle{fancy} %$if(has-frontmatter)$ %\frontmatter %$endif$ $if(title)$ \maketitle $if(abstract)$ \begin{abstract} $abstract$ \end{abstract} $endif$ $endif$ $for(include-before)$ $include-before$ $endfor$ $if(toc)$ $if(toc-title)$ \renewcommand*\contentsname{$toc-title$} $endif$ { $if(colorlinks)$ \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$} $endif$ \setcounter{tocdepth}{$toc-depth$} \addtocontents{toc}{\protect\vspace{20mm}} % Space between title and toc \clearpage \thispagestyle{empty} % Remove header on this page \tableofcontents \clearpage \thispagestyle{empty} % Also remove header on the next page } $endif$ $if(lof)$ \listoffigures $endif$ $if(lot)$ \listoftables $endif$ $if(linestretch)$ \setstretch{$linestretch$} $endif$ %$if(has-frontmatter)$ %\mainmatter %$endif$ % Main content $body$ %$if(has-frontmatter)$ %\backmatter %$endif$ $if(nocite-ids)$ \nocite{$for(nocite-ids)$$it$$sep$, $endfor$} $endif$ $if(natbib)$ $if(bibliography)$ $if(biblio-title)$ $if(has-chapters)$ \renewcommand\bibname{$biblio-title$} $else$ \renewcommand\refname{$biblio-title$} $endif$ $endif$ \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} $endif$ $endif$ $if(biblatex)$ \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ $endif$ $for(include-after)$ $include-after$ $endfor$ % New page before the last cover \newpage \insertbackcover \end{document}

  • [yathesis] problème de passage de langue à algorithm2e
    by Maxime on March 29, 2025 at 8:32 pm

    La configuration des langues avec yathesis (que je recommande beaucoup autour de moi, notamment pour des HDR) pose un problème avec le package algorithm2e qui prend en compte le français, peu importe le mainlangage de yathesis ou l’option pour algorithm2e. Le problème n’est pas présent avec la classe book. \documentclass[mainlanguage=english,french]{yathesis} %\documentclass{book} \usepackage[algo2e]{algorithm2e} \begin{document} \mainmatter \begin{algorithm2e}[ht]\caption{Test}\label{alg:PPCG} Test\; \For{Test}{ Test\; } \end{algorithm2e} \end{document}

  • Indexation perturbée
    by fred02840 on March 29, 2025 at 12:24 pm

    J'ai un document de 200 pages environ, dont l'utilisation serait simplifiée par une indexation des noms et une autre pour les lieux. Exemple fictif de ce que j'ai fait : \documentclass{scrbook} \usepackage[T1]{fontenc} \usepackage[xindy]{indextools} \makeindex[name=p,title=Index des personnes] \makeindex[name=lx,title=Index des lieux] \begin{document} Lorem\index[p]{\textsc{Lorem} Marcel} ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore\index[lx]{Dolore} magna\index[p]{\textsc{Magna} Charles} aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor\index[lx]{Dolore} in reprehenderit in voluptate velit esse cillum dolore\index[lx]{Dolore} eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \newpage \printindex[p] \printindex[lx] \end{document} Là dessus, compilation : pdflatex - latexmk - pdflatex Cela fonctionne très bien, mais l'index présente des répétitions d'occurrences. En vérifiant Le fichier p.idx présente en effet quelques bizarreries : des espaces apparaissent entre \textsc et le nom propre auquel il se rapporte, d'où la double indexation. Je n'ai pas encore tenté le diable en créant un index des lieux lx.idx… \indexentry{\textsc{Royaux} Paul}{5} \indexentry{\textsc {Royaux} Paul}{42} \indexentry{\textsc{Geelen} Pierre}{7} \indexentry{\textsc {Geelen} Pierre}{11} \indexentry{\textsc{Heyermans} André}{40} \indexentry{\textsc {Heyermans} André}{42} J'ai vérifié la typographie : aucune erreur. J'ai détruit p.idx pour en créer un nouveau : mêmes problèmes. La seule solution serait de faire une correction de p.idx, ce qui serait assez fastidieux.

  • Table des matières: formater les numéros de page ?
    by joseph-tux on March 28, 2025 at 7:24 pm

    Est-il possible de formater seulement les numéros de page dans la table des matières? (tableofcontents et hyperref) Par exemple, je souhaiterais y mettre une couleur et peut-être un cadre (fbox, tcbox...) Sur un gros document composé majoritairement de documents inclus (beaucoup de pdf et quelques jpg ou png), j'ai supprimé l'affichage du numéro en bas de page (avec le greffon nopageno), et ajouté les numéros de page avec une fonction de tampon (avec un document pdf ne contenant que les numéros de page collé par pdftk et sa fonction multistamp sur le document) Ces numéros en bas de page sont volontairement «flashies», dans une tcbox et en couleur, afin de ressortir dans un format identique sur tous les documents inclus, et d'être bien différenciés des numéros de page des documents inclus avec des formats variés. \documentclass[a4paper,11pt,french]{scrartcl} \usepackage{pdfpages} \usepackage{includegraphicx} \usepackage{caption} \usepackage{lipsum} \usepackage{tcolorbox} \usepackage[french]{babel} \usepackage[hidelinks,linktoc=all]{hyperref} \begin{document} \setcounter{tocdepth}{2} \tableofcontents \pagebreak \section{Introduction} \lipsum{1} \addcontentsline{toc}{section}{Premiers documents} \input{prem.tex} \includepdf[% pages=-,% pagecommand*={\phantomsection\addcontentsline{toc}{subsection}{Contrat}} ]{Contrat.pdf} \includegraphics[width=0.95\textwidth]{Photos24.jpg} \captionof{figure}{La photo du jour} \end{document} Ci dessous la page 1 des calques (un pdf de 500 pages) recouvrant le fichier final (le cadre est ajouté pour cet exposé):