Historique des modifications [retour]
cliquez ici pour masquer/afficher la révision 5
modif' mineure

01 Nov '16, 01:25

Pathe's gravatar image

Pathe
7.6k49210252

Voici une solution utilisant le package [etoolbox](https://www.ctan.org/pkg/etoolbox). Pour les environnements (abstract, tableaux, citations,...) : \AtBeginEnvironment{ENVI}{\singlespacing} Pour les commandes (`\tableofcontents`, `\listoffigures`, `\listoftables` et `\printbibliography`...) \preto{\CMD}{\singlespacing} \appto{\CMD}{\onehalfspacing} Pour les titres de plus d'une ligne : \patchcmd\@sect{\begingroup}{\begingroup\setbox0=\hbox{\hskip #3\relax\@svsec #8}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} \patchcmd\@ssect{\begingroup}{\begingroup\setbox0=\hbox{#5}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} **Exemple complet** complet :** \documentclass{article} \usepackage{lipsum} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[frenchb]{babel} \usepackage[backend=bibtex]{biblatex} \addbibresource{mybib.bib} %-------------------------- à mettre dans un fichier difspace.tex et \input{difspace} \usepackage{setspace} \onehalfspacing \usepackage{etoolbox} \preto{\tableofcontents}{\singlespacing} \appto{\tableofcontents}{\onehalfspacing} \preto{\listoffigures}{\singlespacing} \appto{\listoffigures}{\onehalfspacing} \preto{\listoftables}{\singlespacing} \appto{\listoftables}{\onehalfspacing} \preto{\printbibliography}{\singlespacing} \appto{\printbibliography}{\onehalfspacing} \AtBeginEnvironment{abstract}{\singlespacing} \AtBeginEnvironment{tabular}{\singlespacing} \AtBeginEnvironment{quote}{\singlespacing} \AtBeginEnvironment{thebibliography}{\singlespacing} \makeatletter \patchcmd\@sect{\begingroup}{\begingroup\setbox0=\hbox{\hskip #3\relax\@svsec #8}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} \patchcmd\@ssect{\begingroup}{\begingroup\setbox0=\hbox{#5}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} \makeatother %------------------------------------------ \begin{document} \nocite{*} \begin{abstract} \lipsum[1] \end{abstract} \tableofcontents \listoffigures \listoftables \section{Titre très très long pour montrer proprement ce style, mais qui ne sert à rien d'autre} \lipsum[1] \begin{quote} \lipsum[1] \end{quote} \lipsum[1] \section{Titre d'une section} \subsection{Foo} Bla bla \footnote{\lipsum[1]} \lipsum[1] \subsection{Foo bar} \lipsum[1] \begin{tabular}{|c|c|c|} \hline 1111 & 12 & a \\ \hline 21 & 22 & b \\ \hline 31 & 32 & c \\ \hline 4444 & 42 & d \\ \hline 51 & 52 & e \\ \hline \end{tabular} Bla bla\footnote{\lipsum[1]} \printbibliography \lipsum[1] \end{document}
cliquez ici pour masquer/afficher la révision 4
modif' mineure

01 Nov '16, 01:24

Pathe's gravatar image

Pathe
7.6k49210252

Voici une solution utilisant le package [etoolbox](https://www.ctan.org/pkg/etoolbox). Pour les environement environnements (abstract, tableaux, citations,...) citations,...) : \AtBeginEnvironment{ENVI}{\singlespacing} pour Pour les commandes (`\tableofcontents`, `\listoffigures`, `\listoftables` et `\printbibliography` ...) `\printbibliography`...) \preto{\CMD}{\singlespacing} \appto{\CMD}{\onehalfspacing} Pour les titres de plus d'une line ligne : \patchcmd\@sect{\begingroup}{\begingroup\setbox0=\hbox{\hskip #3\relax\@svsec #8}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} \patchcmd\@ssect{\begingroup}{\begingroup\setbox0=\hbox{#5}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} **Exemple complet** \documentclass{article} \usepackage{lipsum} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[frenchb]{babel} \usepackage[backend=bibtex]{biblatex} \addbibresource{mybib.bib} %-------------------------- à mettre dans un fichier difspace.tex et \input{difspace} \usepackage{setspace} \onehalfspacing \usepackage{etoolbox} \preto{\tableofcontents}{\singlespacing} \appto{\tableofcontents}{\onehalfspacing} \preto{\listoffigures}{\singlespacing} \appto{\listoffigures}{\onehalfspacing} \preto{\listoftables}{\singlespacing} \appto{\listoftables}{\onehalfspacing} \preto{\printbibliography}{\singlespacing} \appto{\printbibliography}{\onehalfspacing} \AtBeginEnvironment{abstract}{\singlespacing} \AtBeginEnvironment{tabular}{\singlespacing} \AtBeginEnvironment{quote}{\singlespacing} \AtBeginEnvironment{thebibliography}{\singlespacing} \makeatletter \patchcmd\@sect{\begingroup}{\begingroup\setbox0=\hbox{\hskip #3\relax\@svsec #8}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} \patchcmd\@ssect{\begingroup}{\begingroup\setbox0=\hbox{#5}\ifdim\wd0>\linewidth\singlespacing\fi}{}{\errmessage{some thing bad happen}} \makeatother %------------------------------------------ \begin{document} \nocite{*} \begin{abstract} \lipsum[1] \end{abstract} \tableofcontents \listoffigures \listoftables \section{Titre très très long pour montrer proprement ce style, mais qui ne sert à rien d'autre} \lipsum[1] \begin{quote} \lipsum[1] \end{quote} \lipsum[1] \section{Titre d'une section} \subsection{Foo} Bla bla \footnote{\lipsum[1]} \lipsum[1] \subsection{Foo bar} \lipsum[1] \begin{tabular}{|c|c|c|} \hline 1111 & 12 & a \\ \hline 21 & 22 & b \\ \hline 31 & 32 & c \\ \hline 4444 & 42 & d \\ \hline 51 & 52 & e \\ \hline \end{tabular} Bla bla\footnote{\lipsum[1]} \printbibliography \lipsum[1] \end{document}
cliquez ici pour masquer/afficher la révision 3

01 Mai '16, 12:14

touhami's gravatar image

touhami
9.9k410

cliquez ici pour masquer/afficher la révision 2

30 Avr '16, 21:38

touhami's gravatar image

touhami
9.9k410

cliquez ici pour masquer/afficher la révision 1

30 Avr '16, 19:26

touhami's gravatar image

touhami
9.9k410