For my thesis, I want to compile various tex docs as chapters. Unfortunately, when trying to link the various chapters, I receive the following error:
File: chapter_1/tex/chapter1 "!Missing number, treated as zero.}\section{introduction}
File: chapter_1/tex/chapter1 "!Illegal unit of measure (pt inserted).}\section{introduction}
Below a snippet of my LaTex code:
The main document i.e. the compiler of the various chapters:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass
[
paper=a4, % choose page size e.g. a4 or b5 (common booklet size)
fontsize=12pt,
headings=big,
parskip, %indent at paragrafs?
numbers=noendperiod, % 2.3.1 vs 2.3.1. (no dot after the last chapter number)
twoside=true, %choose two sided for a booklet style, semi leaves the margings the same
headinclude,
pagesize,
appendixprefix=false,
headsepline,
toc=bibliography, % Bibliography appears in Table of Contents (without a number)
version=last % Use latest version of the KOMA-Script
]{Thesis_Template}
% Add the configuration and packages
\input{definitions/configuration}
\input{definitions/packages_commands}
\input{definitions/hyphenation}
% ad hoc settings
\interfootnotelinepenalty=10000
%import packages that need to be imported separately
\usepackage[subpreambles=false]{standalone}
\usepackage{import}
%toggle for footnotes to continue over the chapters
\counterwithout{footnote}{chapter}
\flipbindingmargins
% ad hoc spacing for sections
\setlength\parskip{1em plus 0em minus 0.1em}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{1em plus 0em minus 0.1em}{1em plus 0em}
\titlespacing*{\subsection}{0pt}{1em plus 0em minus 0.1em}{.6em plus 0em}
\titlespacing*{\subsubsection}{0pt}{1em plus 0em minus 0.1em}{.6em plus 0em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\frontmatter
\headerpage
%% Startmain content
\mainmatter
\chapter[Chapter 1]{Chapter 1 long title} \label{chapt 1}
%import actual chapter tex
\import{chapter_1/tex/}{chapter1}
\end{document}
An exemplary code of a chapter:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,11pt]{article}
\usepackage{standalone} \standalonetrue %to allow it to be part of thesis
\usepackage{hyperref}
\usepackage[english]{babel}
\usepackage{fullpage}
\usepackage{fancyvrb}
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage{amssymb}
\usepackage[flushleft]{threeparttable}
\usepackage{amsthm}
\usepackage{tikzscale}
\usepackage{graphicx}
\usepackage{eurosym}
\usepackage{bm}
\usepackage{bibentry}
\usepackage{natbib}
\usepackage{csquotes}
\usepackage{booktabs}
\usepackage[font=small]{caption}
\usepackage{nameref}
\usepackage{caption}
\usepackage[toc,page]{appendix}
\usepackage{tabularx}
\usepackage{subcaption}
\usepackage{subfiles}
\usepackage{mathrsfs}
\usepackage{standalone}
\usepackage{lscape}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{dcolumn}
\usepackage{cleveref}
\usepackage[nomessages]{fp}
\usepackage{ifthen}
\usepackage{tablefootnote}
%Settings
\tolerance=2000
\usepackage[usenames,dvipsnames]{color}
\hypersetup{
colorlinks,
citecolor=blue,
linkcolor=blue,
urlcolor=blue
}
\usepackage{tikz}
\usepackage{pst-plot}
\usepackage{pst-func}
\usepackage{animate}
\usepackage{graphicx}
\usepackage[explicit]{titlesec}
%sections setup
\titleformat{\section}{\normalfont\bfseries}{\thesection.}{.5em}{\hyperlink{toc}{{\black{#1}}}}
\titleformat{\subsection}{\normalfont}{\thesubsection.}{.5em}{\hyperlink{toc}{\it{\black{#1}}}}
\titleformat{\subsubsection}{\normalfont}{\thesubsubsection.}{.5em}{\it{#1}}
\titlespacing*{\subsubsection}{0pt}{11pt}{0pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\ifstandalone
\title{\sc{Title}
\unskip\thanks{Thanks to ...}
}
\author{John Doe}
}
\date{\today}
\maketitle
\vspace{-1.5em}
%%%%%%% ABSTRACT %%%%%%%
\begin{center}
\parbox[t]{.9\textwidth}{
\begin{small}
\singlespacing
Abstract text here.
\clearpage
\doublespacing
\fi
%%%%%%% Introduction %%%%%%%
\section{Introduction}
Introduction text here
\end{document}
I am using TeX Maker. I also made sure that all packages are up to date.
I read online in other posts that it might have something to do with the titlesec package but could not figure out a solution.
Many thanks for your support!
\import
here, probably more like the features from thestandalone
package.