[Tex/LaTex] How to affect line spacing in only one group on the title page

formattingline-spacing

I am trying to set up a title page for my summaries of the classes I take. The problem lies with the line spacing for the title being too small and me not being able to change just that.

My .sty-file contains the following code (the group I want to change is set between %—):

\ProvidesPackage{setupJojo}[2015/04/11 v0.1 Setup]

% Language, character and typeset setup
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[german]{babel}
\RequirePackage{lmodern}

% Maths setup
\RequirePackage[intlimits]{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}

% Formating
\RequirePackage{parskip}
\RequirePackage{setspace}
\RequirePackage[hidelinks]{hyperref}

% Custom commands
\newcommand*{\newWord}[1]{\textit{#1}}

% Title page
\newcommand*{\titleJojo}{
    \pagestyle{empty}
    \begingroup
    \center
    \vspace*{2\baselineskip}

    {\LARGE A summary of}\\[\baselineskip]

    % ------------------------------------------------
    {\Huge\bfseries \nameJojo}\\[\baselineskip] % the name of the class
    % ------------------------------------------------

    {held by}\\[0.25\baselineskip]
    {\large \textsc{\dozentJojo}} % name of the lecturer

    \vfill
    {\textsc{J0hj0h}}\par

    \endgroup}

I use the title page code e.g. in this file:

\documentclass[12pt,a4paper]{report}
\usepackage{setupJojo}

\newcommand*{\nameJojo}{The name of the class}
\newcommand*{\dozentJojo}{The professor's name}

\begin{document}
    \titleJojo
    \tableofcontents

% all my stuff...

\end{document}

I already tried the setspace-package, as you can see in the imports of the .sty-file.
\begin{onehalfspace}...\end{onehalfspace} affected the following paragraph, too.
\setstretch{2.0} inside the group had no effect at all.

Apart from those two, I didn't manage to find any more possible solutions, sadly.

How can I simply add a bit more line spacing to that one group without messing up the following paragraph?

EDIT:
Changing the line from {\Huge\bfseries \nameJojo}\\[\baselineskip] to {\Huge\bfseries \nameJojo \par} solved the problem, as Harish Kumar helped to discover. Thanks! 🙂

Best Answer

First \center is wrong. Use \centering. And change the title command like this:

% ------------------------------------------------
    {\setstretch{1.5} \Huge\bfseries \nameJojo \par\vspace{\baselineskip}} % the name of the class %% or          \onehalfspacing or \doublespacing
% ------------------------------------------------

Full code:

\documentclass[12pt,a4paper]{report}
%\usepackage{setupJojo}
%----your package here ----------------
\ProvidesPackage{setupJojo}[2015/04/11 v0.1 Setup]

% Language, character and typeset setup
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[german]{babel}
\RequirePackage{lmodern}

% Maths setup
\RequirePackage[intlimits]{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}

% Formating
\RequirePackage{parskip}
\RequirePackage{setspace}
\RequirePackage[hidelinks]{hyperref}

% Custom commands
\newcommand*{\newWord}[1]{\textit{#1}}

% Title page
\newcommand*{\titleJojo}{
    \pagestyle{empty}
    \begingroup
    \centering               %%% \center is wrong
    \vspace*{2\baselineskip}

    {\LARGE A summary of}\\[\baselineskip]

    % ------------------------------------------------
    {\setstretch{1.5} \Huge\bfseries \nameJojo \par} % the name of the class %% or          \onehalfspacing or \doublespacing
    % ------------------------------------------------
    \vspace{\baselineskip}
    {held by}\\[0.25\baselineskip]
    {\large \textsc{\dozentJojo}} % name of the lecturer

    \vfill
    {\textsc{J0hj0h}}\par

    \endgroup}
%--------------------------------------

\newcommand*{\nameJojo}{The name of the class just more text to show the line spacing just more text to show the line spacing just more text to show the line spacing just more text to show the line spacing just more text to show the line spacing }
\newcommand*{\dozentJojo}{The professor's name}

\begin{document}
    \titleJojo
    \tableofcontents

% all my stuff...

\end{document}

enter image description here

Also, you can get rid of setspace package by using \linespread{1.5}\selectfont instead of \setstretch{1.5} (Thanks to egreg).

Related Question