1

new member here. Have been doing really well with guidance and answers to other problems but got to a point where I really cannot find the answer to my problem. Two-pronged problem, really. I am writing my thesis and using \input to join separate chapters. It's looking something like this at the moment:

\documentclass[11pt,a4paper,twoside,]{book}     
\usepackage{warwickthesis,setspace,graphicx}
\usepackage[left=4cm,right=2cm,top=2cm=bottom=2cm]{geometry}
\usepackage{fancyhdr, fullpage}
\pagestyle{fancy}
\headsep 20pt
\rhead{\rightmark}
\chead{}
\lhead{\leftmark}
\rfoot{}
\cfoot{\thepage}
\lfoot{} 
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1}{} }
\usepackage{amsfonts, amsmath, amssymb, amsthm, bm}
\usepackage{wasysym}
\usepackage[hypcap]{caption}
\usepackage{graphicx,subcaption}
\usepackage{pdflscape}
\usepackage{wrapfig}
\usepackage{verbatim}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{textcomp}
\usepackage{color}
\usepackage{hyperref}
\hypersetup{hidelinks=true, plainpages=false} 
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\Huge\bfseries}{\thechapter}{0.5em}{\vspace{0.5ex}}[\titlerule]
\titlespacing*{\chapter}{0pt}{0pt}{5pt}

\renewcommand{\chaptername}{}                  
\usepackage{enumerate}
\usepackage[numbers, super, comma, sectionbib]{natbib}
\usepackage{chapterbib}

\begin{document}

\pagenumbering{arabic} 
\begin{thesisabstract}              
\input{abstract.tex}
\end{thesisabstract}

\chapter{Introduction}
\input{intro.tex}

\chapter{Techniques and Methodology}
\input{experimental.tex}

\chapter{Cinnamates}
\input{cinnamates.tex}

\chapter{Anthranilates}
\input{anthranilates.tex}

\chapter[Structure-Function-Dynamics]{Structure-Function-Dynamics:\\From fundamental science\\to product}
\input{sfd.tex}

\chapter{Conclusion and Outlook}
\input{conclusion.tex}

\begin{appendix}
    \renewcommand{\chaptername}{}
    \addcontentsline{toc}{chapter}{Appendices}
    \input{app.tex}
\end{appendix}

    \end{document}                      

I'm sorry if it is not the most elegant code, I've been adding bits and bobs here and there seeing what works. I tried deleting what I thought was not relevant but didn't want to take much from the preamble in case there is something conflicting that I am not aware of!

I currently only have content in intro.tex (which works fine), antranilates.tex and sfd.tex. The latter two generate a 'File ended while scanning use of \section.' error (which has, however, since disappeared for anthranilates.tex but still there for sfd.tex. How do I solve this problem?

Also, while anthranilates.tex is working, the section name does not appear after compile, and the first letter of the line is deleted. I.e. my .tex file starts with:

\section{Overview}
Testing

And I simply get 'esting' straigth after the chapter title, with no '1.1 Overview' title. Note that, for the Introdction chapter, I used the exact same thing and it worked a treat. So not sure what is going wrong now.

I hope I've given you something you can work with. Any help would be much appreciated!

Thanks Nat


working MWE

\documentclass[11pt,a4paper,twoside,]{book}     
%\usepackage{warwickthesis,setspace,graphicx}
\usepackage[left=4cm,right=2cm,top=2cm=bottom=2cm]{geometry}
\usepackage{fancyhdr, fullpage}
\pagestyle{fancy}
\headsep 20pt
\rhead{\rightmark}
\chead{}
\lhead{\leftmark}
\rfoot{}
\cfoot{\thepage}
\lfoot{} 
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1}{} }
\usepackage{amsfonts, amsmath, amssymb, amsthm, bm}
\usepackage{wasysym}
\usepackage[hypcap]{caption}
\usepackage{graphicx,subcaption}
\usepackage{pdflscape}
\usepackage{wrapfig}
\usepackage{verbatim}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{textcomp}
\usepackage{color}
\usepackage{hyperref}
\hypersetup{hidelinks=true, plainpages=false} 
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\Huge\bfseries}{\thechapter}{0.5em}{\vspace{0.5ex}}[\titlerule]
\titlespacing*{\chapter}{0pt}{0pt}{5pt}

\renewcommand{\chaptername}{}                  
\usepackage{enumerate}
\usepackage[numbers, super, comma, sectionbib]{natbib}
\usepackage{chapterbib}

\begin{document}

\pagenumbering{arabic} 
%\begin{thesisabstract}              
%\input{abstract.tex}
%\end{thesisabstract}

\chapter{Introduction}
%\input{intro.tex}
iiii

\chapter{Techniques and Methodology}
%\input{experimental.tex}
eeee

\chapter{Cinnamates}
%\input{cinnamates.tex}
ccc

\chapter{Anthranilates}
%\input{anthranilates.tex}
\section{Overview}
Testing

\chapter[Structure-Function-Dynamics]{Structure-Function-Dynamics:\\From fundamental science\\to product}
%\input{sfd.tex}
sss

\chapter{Conclusion and Outlook}
%\input{conclusion.tex}
ccc

\begin{appendix}
    \renewcommand{\chaptername}{}
    \addcontentsline{toc}{chapter}{Appendices}
    %\input{app.tex}
\end{appendix}

\end{document} 

closed as too broad by Bobyandbob, marmot, Kurt, Troy, moewe Mar 23 '18 at 13:51

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    \input has essentially no affect on latex, it is just as if the contents of the file were copied in to the main document at that point. the error File ended while scanning use of \section. means you have \section{foo with a missing } somewhere, but hard to say where, given the information provided. – David Carlisle Jan 21 '18 at 11:33
  • Yes, I understand that, but if \input only copies things into the document, and the file I am copying has \section{title} on it, then surely the title should be printed onto the main document? Or am I missing something? Regarding the error, I will look more closely for a missing }. Thank you! – Nat RodLopes Jan 21 '18 at 11:41
  • 1
    we could not run your example as it inputs your section files and uses a non standard warwickthesis class, however I added a version that can be run but the Testing and Overview section appear as expected. Can you edit that example adding enough bits of warwickthesis so that it breaks? – David Carlisle Jan 21 '18 at 11:41
  • 1
    After you get any error then any behaviour or pdf output is essentially accidental behaviour due to error recovery. TeX does not try to make sensible output after an error, just allow the document to be further processed for syntax checking. – David Carlisle Jan 21 '18 at 11:43
  • Ok so I deleted all the text from the sfd.tex file and the error went away, so it must have been something in that text - I will go through it more carefully later to make sure. About the rest - I can share the .sty file if that would be easier? if not, should I simply go over the code and comment out parts until it works? – Nat RodLopes Jan 21 '18 at 11:52