如果我不包含 \input{ChapterHeading.tex},下面的代码就可以工作,但如果可能的话我想包含它?
\documentclass{article}
\begin{document}
\input{title.tex}
\tableofcontents
\clearpage
\input{ChapterHeading.tex}
\chapter{(Chapter One)} \input{Introduction.tex}
\chapter{Chapter Two} \input{rv-NSS.tex}
\end{document}
这是 ChapterHeading.tex 文件
\documentclass{book}
\usepackage{graphics}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\raggedleft}
{\MakeUppercase{\chaptertitlename}%
\rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
{10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\setcounter{chapter}{0}
\begin{document}
\pagenumbering{gobble}
\chapter{Introduction}
\end{document}
答案1
如果你把的序言放在ChapterHeading.tex
里面HeadingPreamble.tex
,你可能会实现:
\documentclass{article}
\input{HeadingPreamble.tex}
\begin{document}
\input{title.tex}
\tableofcontents
\clearpage
\input{ChapterHeading.tex}
\chapter{(Chapter One)} \input{Introduction.tex}
\chapter{Chapter Two} \input{rv-NSS.tex}
\end{document}
HeadingPreamble.tex
文件
\usepackage{graphics}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\raggedleft}
{\MakeUppercase{\chaptertitlename}%
\rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
{10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\setcounter{chapter}{0}
ChapterHeading.tex
文件
\pagenumbering{gobble}
删除是明智的ChapterHeading.tex
,因此主要文档将是:
\documentclass{article}
\input{HeadingPreamble.tex}
\begin{document}
\input{title.tex}
\tableofcontents
\clearpage
\pagenumbering{gobble}
\chapter{(Chapter One)} \input{Introduction.tex}
\chapter{Chapter Two} \input{rv-NSS.tex}
\end{document}