# You can't use \unskip' in vertical mode

So I have this strange error You can't use \unskip' in vertical mode in springer latex template. For whatever reason, this is caused by the blank line before the last \end{proof}. Not sure how to generate a smaller example either.

https://www.overleaf.com/2166494628jhkmqjhhjjsv

\documentclass[sn-mathphys,lineno]{sn-jnl}% Math and Physical Sciences Reference Style

\usepackage{microtype}
%\usepackage{xfrac}
%\usepackage{mathtools}
\usepackage{enumerate}
\usepackage{bbm}
%\usepackage{mathbbm}
%\usepackage{thm-restate}
\usepackage{subcaption}
\usepackage{cleveref}
\usepackage{comment}
\usepackage{xcolor}
%\usepackage[textwidth=20mm]{todonotes}

\jyear{2022}%

%% as per the requirement new theorem styles can be included as shown below
\theoremstyle{thmstyleone}%
\newtheorem{theorem}{Theorem}%  meant for continuous numbers
%%\newtheorem{theorem}{Theorem}[section]% meant for sectionwise numbers
%% optional argument [theorem] produces theorem numbering sequence instead of independent numbers for Proposition
\newtheorem{proposition}{Proposition}%
%%\newtheorem{proposition}{Proposition}% to get separate numbers for theorem and proposition etc.

\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}

\theoremstyle{thmstyletwo}%

\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%
\newtheorem{claim}{Claim}
\newtheorem{inva}[theorem]{Invariant}

\raggedbottom
%%\unnumbered% uncomment this for unnumbered level heads
%%end of Springer Template

\newcommand{\hcom}[1]{\textcolor{blue}{#1}}
%  \newcommand{\mmcom}[1]{\mytodo{agcolor}{#1}}

\newcommand{\mmcom}[1]{\textcolor{red}{#1}}

\newcommand{\algorithmautorefname}{Algorithm}
%\newcommand{\definitionautorefname}{Definition}
\newcommand{\trw}{\operatorname{tw}}
\newcommand{\pck}{\operatorname{pack}}
\newcommand{\cover}{\operatorname{cover}}
\newcommand{\lemmaautorefname}{Lemma}
\newcommand{\corollaryautorefname}{Corollary}
%\newcommand{\claimautorefname}{Claim}
\newcommand{\propositionautorefname}{Proposition}
\newcommand{\sectionautoref}{Section}
\newcommand{\remarkautorefname}{Remark}

\newcommand{\poly}[1]{\operatorname{poly}(#1)}
\renewcommand{|}{\vert}

\begin{document}

Let us give the details of the claim in   \cite{ErdosPosaFlorent} that even cycles satisfy the Erdos Posa property with bounding function $f(k)=131k$.

Let $\mathcal{D}$ denote the class of diamonds, that is, graphs that are a subdivision of the graph on two vertices with three parallel edges between them.
Given a set $\mathcal{H}$ of graphs denote by $\pck_\mathcal{H}(G)$ the maximum number of vertex disjoint copies of graphs in $\mathcal{H}$ and by $\cover_\mathcal{H}(G)$ the minimum size of an $\mathcal{H}$-transversal, a set of vertices $X$ for which $G \backslash X$ contains no subgraph isomorphic to a graph in $\mathcal{H}$.
Let $\trw(G)$ denote the treewidth of $G$.
For  $x \in \mathbb{R}$, denote by $\lceil x \rceil$ smallest integer larger than $x$.

%%Denote by $\mathcal{D}$ the set of diamonds

That even cycles satisfy  Erdos-Posa with $f(k)= 131k$ follows as a simple consequence of the following result of  Fomin, Saurabh and Thilikos  \cite{FominErdos}.

\begin{theorem}\label{packing diamonds}
\cite{FominErdos}  For a planar graph $G$ $\pck_\mathcal{D}(G) \leq 131 \cover_\mathcal{D} (G)$.
\end{theorem}

\begin{lemma}
For a planar graph $G$, $\trw(G) \leq 37 \pck(G)^{\frac{1}{2}}$.
\end{lemma}
\begin{proof}
% We show  $\trw(G) \leq 18 \lceil \pck_\mathcal{D} (G)^{\frac{1}{2}} \rceil +1$.
%%  We need the following result of   Robertson, Seymour and  Thomas.
The following lemma
\begin{lemma}\cite{SeymourGrid}
Let $g \geq 1$ be an integer.
Every planar graph with no $g \times g$ grid minor has tree-width   $\leq 6g-5$
\end{lemma}

\end{proof}

\bibliography{temp, EvenCycleTransversal}

\clearpage
\pagebreak
\appendix

\end{document}

• It seems that \end{proof} expands \unskip primitive (because it want to insert something at te end of the proof in horizontal mode. Your blank line generates \par and then the \unskip primitive is in main vertical mode and this is not allowed by TeX. Apr 28 at 17:20
• \end{proof} doesn't like to be preceded by a blank line: just remove it. But don't end a proof with a lemma. Apr 28 at 19:53