[Tex/LaTex] How to set space in the Title

reportsetspacespacing

i want to set the space between the title lines

\newcommand{\reporttitle}{ this is a title with a lot of text bla bla bla}

i used

\usepackage{setspace}
 \setstretch{2}

but nothing happens

\newcommand{\reporttitle}{ this is a title with \setstretch{2} a lot of text bla bla

my entire preambule

\documentclass[a4paper,11pt,final]{article} % Pour une impression recto verso, utilisez plutôt ce documentclass : %\documentclass[a4paper,11pt,twoside,final]{article}

\usepackage[english,francais]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[pdftex]{graphicx} \usepackage{setspace} \usepackage{hyperref} \usepackage[french]{varioref} \newcommand{\reporttitle}{ title with some text and bla bla}     % Titre \newcommand{\reportauthor}{james \textsc{lebois} \\ didier \textsc{mopli}} % Auteur \newcommand{\reportsubject}{Stage d'application} % Sujet \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} \setlength{\parskip}{1ex} % Espace entre les paragraphes

%\usepackage[demo]{graphicx} \usepackage{caption} \usepackage{subcaption}

% add an extra subsection \usepackage{titlesec} \usepackage{hyperref}

\titleclass{\subsubsubsection}{straight}[\subsection]

\newcounter{subsubsubsection}[subsubsection] \renewcommand\thesubsubsubsection{\thesubsubsection.\arabic{subsubsubsection}} \renewcommand\theparagraph{\thesubsubsubsection.\arabic{paragraph}} % optional; useful if paragraphs are to be numbered

\titleformat{\subsubsubsection}   {\normalfont\normalsize\bfseries}{\thesubsubsubsection}{1em}{} \titlespacing*{\subsubsubsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\makeatletter \renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%   {3.25ex \@plus1ex \@minus.2ex}%   {-1em}%   {\normalfont\normalsize\bfseries}} \renewcommand\subparagraph{\@startsection{subparagraph}{6}{\parindent}% {3.25ex \@plus1ex \@minus .2ex}%   {-1em}%   {\normalfont\normalsize\bfseries}} \def\toclevel@subsubsubsection{4} \def\toclevel@paragraph{5} \def\toclevel@paragraph{6} \def\l@subsubsubsection{\@dottedtocline{4}{7em}{4em}} \def\l@paragraph{\@dottedtocline{5}{10em}{5em}} \def\l@subparagraph{\@dottedtocline{6}{14em}{6em}} \makeatother

\setcounter{secnumdepth}{4} \setcounter{tocdepth}{4}



\hypersetup{
    pdftitle={\reporttitle},%
    pdfauthor={\reportauthor},%
    pdfsubject={\reportsubject},%
    pdfkeywords={rapport} {vos} {mots} {clés} }  \usepackage{newunicodechar}  \DeclareUnicodeCharacter{00A0}{ }  \DeclareUnicodeCharacter{00A0}{~}


    \begin{document}

  \include{title}
  \cleardoublepage % Dans le cas du recto verso, ajoute une page blanche si besoin
  \tableofcontents % Table des matières
  \sloppy          % Justification moins stricte : des mots ne dépasseront pas des    paragraphes
  \cleardoublepage
  \include{Abstract}
  \include{Resume}
  \include{remerciements}
  \cleardoublepage
  \include{intro}
  \cleardoublepage
  \include{partie1}
  \cleardoublepage
  \include{partie2}
  \cleardoublepage
   \include{partie3}
  \cleardoublepage
  \include{partie4}
  \cleardoublepage
  \include{concl}
  \cleardoublepage
  \include{references}
\end{document}

i'm just a newbie at lateX , any hints ?

Best Answer

I have no real idea what you are trying to do or what the code fragments are intended to achieve. But perhaps this will help somewhat. Here is some annotated code which is closer, at least, to being minimal. It demonstrates the use of \maketitle, \title and \author.

Comments:

  • I'm not sure what the purpose of \reporttitle etc. is. If you need to access this information after creating the title, take a look at titling.

  • Be careful not to load packages twice, especially with different options.

  • Don't specify a driver to graphicx unless you need to. For pdfTeX, you don't. Let it detect the driver it needs automatically.

  • hyperref should be one of the last packages loaded.

  • Don't mix manual customisation with a package designed to customise the same document elements, or mix different packages designed to customise the same elements. For example, if you use titlesec, stick to that. Don't then customise \paragraph manually: use the interface titlesec provides.

  • Use semantic-markup whenever possible e.g. use \maketitle rather than a home-brewed solution.

  • Don't reinvent the wheel: use existing commands and packages when you can.

  • Load as many packages as you need and no more than you need. For example, use titling rather than going into the home-brewing business, but don't load titlesec if you want to redefine section titles manually.

  • Don't use \sloppy. Certainly, do not use it for your entire document. If absolutely necessary, when the content is finalised, you might, if pushed, need to typeset a particular paragraph sloppily. But you don't want your entire document to be typeset sloppily as sloppy typesetting is, well, sloppy. It is not good.

Code:

\documentclass[a4paper,11pt,final]{article}
\usepackage[english,francais]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\newcommand{\reporttitle}{title with some text and bla bla}     % Titre
\newcommand{\reportauthor}{james \textsc{lebois} and didier \textsc{mopli}}

% % add an extra subsection - if using this and customising section title formats, USE TITLESEC's INTERFACE
% \usepackage{titlesec}
% \titleclass{\subsubsubsection}{straight}[\subsection]
% \newcounter{subsubsubsection}[subsubsection]
% \renewcommand\thesubsubsubsection{\thesubsubsection.\arabic{subsubsubsection}}
% \renewcommand\theparagraph{\thesubsubsubsection.\arabic{paragraph}}
% \titleformat{\subsubsubsection}   {\normalfont\normalsize\bfseries}{\thesubsubsubsection}{1em}{} \titlespacing*{\subsubsubsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
% % if using titlesec, use titlesec to redefine e.g. \paragraph etc.

% no need to pass a driver to graphicx for pdfTeX - better to auto-detect
% \usepackage{graphicx}

\usepackage{hyperref}% should be one of the last packages loaded

\begin{document}

\title{\reporttitle}% note that putting the title as an argument would work just as well
\author{\reportauthor}
\maketitle

\end{document}

output