如何仅影响标题页上一个组中的行距?

如何仅影响标题页上一个组中的行距?

我正在尝试为我所修课程的总结设置一个标题页。问题在于标题的行距太小,而我无法更改这一点。

我的.sty 文件包含以下代码(我想要更改的组设置在 %--- 之间):

\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}

我在此文件中使用了标题页代码,例如:

\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}

我已经尝试了setspace-package,正如您在.sty文件的导入中所看到的那样。
\begin{onehalfspace}...\end{onehalfspace}影响了下列的段落也是如此。
\setstretch{2.0}在组内根本没有任何影响。

遗憾的是,除了这两个之外,我没有找到任何其他可能的解决方案。

我怎样才能简单地为该组添加一点行距而不弄乱下面的段落?

编辑:
将行从 改为{\Huge\bfseries \nameJojo}\\[\baselineskip]解决{\Huge\bfseries \nameJojo \par}了问题,正如 Harish Kumar 帮助发现的那样。谢谢!:)

答案1

第一个\center是错误的。使用\centering。并像这样更改标题命令:

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

完整代码:

\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}

在此处输入图片描述

setspace另外,您可以使用\linespread{1.5}\selectfont而不是来摆脱包\setstretch{1.5}(感谢egreg)。

相关内容