1

I have downloaded a LaTeX titlepage template from here and modified it for my own use. However I seem to have inadvertently changed the line spacings for the template, and now there is an error in the code:

\begin{titlepage}
    \drop=0.1\textheight
    \centering
    \vspace*{\baselineskip}
    \rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt}
    \rule{\textwidth}{0.4pt}\\[\baselineskip]
    {\LARGE Title Page\\ [0.3\baselineskip] Errors}\\[0.2\baselineskip]
    \rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt}
    \rule{\textwidth}{1.6pt}\\[\baselineskip]
    \vspace*{2\baselineskip}\\[\baselineskip]
    {\Large Xylius\\
            Chemistry\par}
 \vspace{1cm}
    {\itshape Dr. X\par}
    \vfill
    {\scshape 01/01/2017} \\
\end{titlepage}

Can anyone help me out as to find where the error is?
Thanks in advance

2 Answers 2

2

Although your example is not compilable and hence not complete, a working solution might look like this MWE below.

You had the following code in your example

 \drop=0.1\textheight

I don't know, where this command originates. I removed it from your code. Maybe you used a special package, which provides \drop?

Your main error is in this line:

\vspace*{2\baselineskip}\\[\baselineskip]

Here you order LaTeX to move down (\vspace means to insert Vertical white space) and afterwards, in the middle of nowhere, you ask LaTeX to end the line and start a new (\\)

Remove the \\[\baselineskip] and everything works fine.

BTW: I am not sure, but I guess: adding [\baselineskip] is also doubled, as a new line always inserts the amount of\baselineskipIf you want to add some more extra space, than you could say\[2\baselineskip]` to double that amount.

Here is the MWE:

\documentclass{report}[12pt]

%% As requested by the OP: indent the beginning of a paragraph by 1
%% cm! 
\setlength{\parindent}{1cm}

\begin{document}
\begin{titlepage}
    %\drop=0.1\textheight
    \centering
    \vspace*{\baselineskip}
    \rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt}
    \rule{\textwidth}{0.4pt}\\[\baselineskip]
    {\LARGE Title Page\\ [0.3\baselineskip] Errors}\\[0.2\baselineskip]
    \rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt}
    \rule{\textwidth}{1.6pt}\\[\baselineskip]
    \vspace*{2\baselineskip}
    {\Large Xylius\\
            Chemistry\par}
 \vspace{1cm}
    {\itshape Dr. X\par}
    \vfill
    {\scshape 01/01/2017}
\end{titlepage}
\end {document}

And the result:

enter image description here

1
  • I'm not sure sure what package the \drop command comes under, it seems to originate from this: \usepackage[T1]{fontenc} \newlength{\drop}
    – Xylius
    Feb 1, 2017 at 9:36
2

Replace the lines

\rule{\textwidth}{1.6pt}\\[\baselineskip]
\vspace*{2\baselineskip}\\[\baselineskip]

by something like

\rule{\textwidth}{1.6pt}\\[4\baselineskip]

\vspace*{2\baselineskip} constitutes only vertical stuff which doesn't start a new line, so when encountering \\ following it LaTeX complains that there is no line to end. Just sum up all the vertical space that you want to have at this point and give it as argument to the \\ command before.

2
  • the \\ on the final line might also be a source of the message. Jan 31, 2017 at 14:22
  • @barbarabeeton After the change above I got no more errors for my small document that I had constructed from the OP's fragments.
    – gernot
    Jan 31, 2017 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .