Text FormattingForcing an empty line, causes error

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
SuzuBell
Posts: 14
Joined: Sat Dec 13, 2014 7:08 am

Forcing an empty line, causes error

Post by SuzuBell »

I am trying to force an empty line. I tried \vspace and \vspace{5mm} ,but I get the error message:

LaTeX Error: There's no line here to end

Code: Select all

% !TeX program = pdfLaTeX
\documentclass[journal]{vgtc}                % final (journal style)
\let\ifpdf\relax
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}
\usepackage{graphicx,xcolor}
\usepackage{sidecap}
\usepackage{times}
\usepackage{dblfloatfix}
\usepackage{fixltx2e}
\usepackage{mwe}
\usepackage{natbib}
\usepackage{fullpage}
\usepackage{color}
%\usepackage[dvipsnames,svgnames]
\usepackage[bookmarks,backref=true,linkcolor=black]{hyperref} %,colorlinks
\usepackage{listings} %% addedR
\hypersetup{
  pdfauthor = {},
  pdftitle = {},
  pdfsubject = {},
  pdfkeywords = {},
  colorlinks=true,
  linkcolor= black,
  citecolor= black,
  pageanchor=true,
  urlcolor = black,
  plainpages = false,
  linktocpage
}
\usepackage{wrapfig,float}
\usepackage{caption} %%% added
\captionsetup[figure]{slc=off}  %%% added
\usepackage{subcaption}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{url}
\usepackage{ulem}
\usepackage[section]{placeins}
\usepackage[export]{adjustbox}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{fancyhdr} 
\fancyhf{}
\cfoot{\thepage}
\pagestyle{fancy}

\newcommand{\hh}[1]{{\color{orange} #1}}
\graphicspath{{figure/}}
\renewcommand{\floatpagefraction}{.99}
\newcommand{\done}[2][inline]{\todo[color=SpringGreen, #1]{#2}}
\newcommand{\newdo}[1]{\todo[inline, color=Plum]{#1}}
\newcommand{\comment}[2][inline]{\todo[color=SkyBlue, #1]{#2}}
\newcommand{\newtext}[1]{\todo[inline, color=White]{ \color{OliveGreen}{#1}}}

\renewcommand{\headrulewidth}{0pt}

% Added for R code
\usepackage{listings}
\usepackage{color}
\lstset{ %
  language=R,                     % the language of the code
  basicstyle=\footnotesize,       % the size of the fonts that are used for the code
  numbers=left,                   % where to put the line-numbers
  numberstyle=\tiny\color{gray},  % the style that is used for the line-numbers
  stepnumber=1,                   % the step between two line-numbers. If it's 1, each line
                                  % will be numbered
  numbersep=5pt,                  % how far the line-numbers are from the code
  backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}
  showspaces=false,               % show spaces adding particular underscores
  showstringspaces=false,         % underline spaces within strings
  showtabs=false,                 % show tabs within strings adding particular underscores
  frame=single,                   % adds a frame around the code
  rulecolor=\color{black},        % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. commens (green here))
  tabsize=2,                      % sets default tabsize to 2 spaces
  captionpos=b,                   % sets the caption-position to bottom
  breaklines=true,                % sets automatic line breaking
  breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
  title=\lstname,                 % show the filename of files included with \lstinputlisting;
                                  % also try caption instead of title
  keywordstyle=\color{blue},      % keyword style
  commentstyle=\color{dkgreen},   % comment style
  stringstyle=\color{red},      % string literal style
  escapeinside={\%*}{*)},         % if you want to add a comment within your code
  morekeywords={*,...}            % if you want to add more keywords to the set
} 
\begin{document}

Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah :

\vspace{10 mm}

\begin{lstlisting}
blah blah blah
\end{lstlisting}

\end{document}
Any ideas greatly appreciated!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Forcing an empty line, causes error

Post by mas »

SuzuBell wrote:I am trying to force an empty line. I tried \vspace and \vspace{5mm} ,but I get the error message:

LaTeX Error: There's no line here to end

Any ideas greatly appreciated!
You *really* should post a Infominimal working example. The following should help you:

Code: Select all

\documentclass{article}

\begin{document}
Some blah Some blah Some blah Some blah Some blah Some blah Some blah
Some blah Some blah Some blah Some blah Some blah Some blah Some blah
Some blah Some blah Some blah Some blah Some blah Some blah 
\\[10mm]

More blah More blah More blah More blah More blah More blah More blah
More blah More blah More blah 

\vspace*{25mm}
Extra blahs Extra blahs Extra blahs Extra blahs Extra blahs Extra blahs
Extra blahs Extra blahs Extra blahs Extra blahs Extra blahs Extra blahs
Extra blahs Extra blahs Extra blahs Extra blahs Extra blahs Extra blahs
Extra blahs Extra blahs 
  
\end{document}

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Forcing an empty line, causes error

Post by Stefan Kottwitz »

I don't get that error with this code. Look closer to the error message, it should tell a line number. Post that part of code here. And, as mas said, a minimal example would be great. Click on the link in his post, to learn why and how, this is useful and mostly a guarantee for a solution.

Sometimes just a \\ at the wrong place causes this error. \\ is often used for a paragraph break by mistake, or for making space, also by mistake. It's for ending a line without paragraph break, like in tabular. Normal text rarely need \\.

Stefan
LaTeX.org admin
Post Reply