\section 和 \input 的问题

\section 和 \input 的问题

新成员在这里。在其他问题的指导和答案方面做得很好,但到了我真的找不到问题的答案的地步。这确实是双重问题。我正在写论文,并使用 \input 连接单独的章节。目前看起来是这样的:

\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}                      

如果这不是最优雅的代码,我很抱歉,我一直在到处添加一些小东西,看看哪些能起作用。我尝试删除我认为不相关的内容,但不想从序言中删去太多内容,以防出现我不知道的冲突!

我目前只有 intro.tex(运行良好)、antranilates.tex 和 sfd.tex 中的内容。后两者生成“扫描 \section 使用时文件结束”错误(但是,anthranilates.tex 中的错误已经消失,但 sfd.tex 中仍然存在)。我该如何解决这个问题?

此外,当 anthranilates.tex 运行时,编译后不出现节名,并且删除行的第一个字母.例如,我的 .tex 文件以以下内容开头:

\section{Overview}
Testing

而且我只是在章节标题后直接得到“esting”,而没有“1.1 概述”标题。请注意,对于 Introdction 章节,我使用了完全相同的东西,效果很好。所以现在不确定出了什么问题。

希望我给你提供了一些有用的信息。任何帮助我都会非常感激!

谢谢 Nat


工作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} 

相关内容