2

I am trying to add abstract for some selected chapters in my thesis. I am using shareLatex and I selected a template they offer for free (the Cambridge one). The problem is that it has lots of folders in that file and you have to work in each file independently of the other. I am still somehow new to latex in this way and I would like a detail explanation please. For example, in this shareLatex one of the folders is called "Macros" the other are called "Classes" and so on. The thesis.tex has the following %input macros (i.e. write your own macros file called MacroFile1.tex)

%\include{Macros/MacroFile1}

 \documentclass[oneside,12pt]{Classes/CUEDthesisPSnPDF}


\ifpdf
    \pdfinfo { /Title  (CUED PhD and MPhil Thesis Classes)
               /Creator (TeX)
               /Producer (pdfTeX)
               /Author (######@gmail.com)
               /CreationDate (D:20030101000000)  %format D:YYYYMMDDhhmmss
               /ModDate (D:20030815213532)
               /Subject (Writing a PhD thesis in LaTeX)
               /Keywords (PhD, Thesis)}
    \pdfcatalog { /PageMode (/UseOutlines)
                  /OpenAction (fitbh)  }
\fi

\title{Writing a PhD Thesis\\[1ex]
        in \LaTeXe}

\ifpdf
  \author{\href{mailto:####5@gmail.com}{######}}
  \collegeordept{\href{http://business-school.exeter.ac.uk/research/areas/topics/economics}{Department of Economics}}
  \university{\href{http://www.exeter.ac.uk}{University of Exeter}}
% insert below the file name that contains the crest in-place of 'UnivShield'
  \crest{\includegraphics[width=90mm]{UnivShield}}
\else
  \author{####}
  \collegeordept{######}
  \university{#######}
% insert below the file name that contains the crest in-place of 'UnivShield'
  \crest{\includegraphics[bb = 0 0 292 336, width=30mm]{UnivShield}}
\fi
%
% insert below the file name that contains the crest in-place of 'UnivShield'
% \crest{\IncludeGraphicsW{UnivShield}{40mm}{14 14 73 81}}
%
%\renewcommand{\submittedtext}{change the default text here if needed}
\degree{Doctor of Philosophy}
\degreedate{Yet to be decided}

% turn of those nasty overfull and underfull hboxes
\hbadness=10000
\hfuzz=50pt

% Put all the style files you want in the directory StyleFiles and usepackage like this:
\usepackage{StyleFiles/watermark}

% Comment out the next line to get single spacing
\onehalfspacing

\usepackage{natbib}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{etex,etoolbox}
\usepackage{amsthm,amssymb}
\usepackage{thmtools}
\usepackage{environ}
\usepackage{thmtools,thm-restate}
% ------------------------------------------------------------------------

\bibliographystyle{agsm}

% ------------------------------------------------------------------------


\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{proposition}{Proposition}
\newtheorem{claim}{Claim}
\newtheorem{fact}{Fact}
\newtheorem{corollary}{Corollary}
\newtheorem{assumption}{Assumption}
\newtheorem{algoritheorem}{Algoritheorem}
\newtheorem{remark}{Remark}
\newtheorem{definition}{Definition}



\newtheoremstyle{named}{}{}{\itshape}{}{\bfseries}{.}{.5em}{\thmnote{#3's }#1}
\theoremstyle{named}
\newtheorem*{namedtheorem}{Theorem}



% ------------------------------------------------------------------------    
\newcommand\equDis{\,{\buildrel d \over =}\,} 
\newcommand\AsyDis{\xrightarrow[]{d}}
\newcommand\AsyArrow{\xrightarrow[]{}}

% ------------------------------------------------------------------------    


% ------------------------------------------------------------------------
\DeclareMathOperator{\PR}{\mathbb{P}}
\DeclareMathOperator{\RNB}{\mathbb{R}} % Real NUmber Bold
\DeclareMathOperator{\sign}{sign} % sign Operator 

% ------------------------------------------------------------------------




\begin{document}

%\language{english}

% A page with the abstract on including title and author etc may be
% required to be handed in separately. If this is not so, then comment
% the below 3 lines (between '\begin{abstractseparte}' and 
% 'end{abstractseparate}'), normally like a declaration ... needs some more
% work, mind as environment abstracts creates a new page!
% \begin{abstractseparate}
%   \input{Abstract/abstract}
% \end{abstractseparate}




% Using the watermark package which is in StyleFiles/
% and to remove DRAFT COPY ONLY appearing on the top of all pages comment out below line
%\watermark{DRAFT COPY ONLY}


\maketitle

%set the number of sectioning levels that get number and appear in the contents
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\frontmatter % book mode only
\pagenumbering{roman}
\include{Dedication/dedication}
\include{Acknowledgement/acknowledgement}
\include{Abstract/abstract}

\tableofcontents
\listoffigures
\printnomenclature  %% Print the nomenclature
\addcontentsline{toc}{chapter}{Nomenclature}

\mainmatter % book mode only
\include{Introduction/introduction}
\include{Chapter1/chapter1}
\include{Chapter2/chapter2}
\include{Chapter3/chapter3}
\include{Conclusions/conclusions}

\backmatter % book mode only
\appendix
\include{Appendix1/appendix1}
\include{Appendix2/appendix2}



\renewcommand{\bibname}{References} % changes default name Bibliography to References
\bibliography{References/references} % References file

\end{document}
  • Is that template confusing? Yes it is. But your real question, which seems to be in the title, isn't explained further. Can you elabrate a bit on that? – Johannes_B May 11 '16 at 17:24
  • Like I basically am dealing with sharelatex.com/project there is templates that I like and I am using is great I just want to amend it such that I may insert abstract in each chapter for a certain reason it is not as easy. If you have an account in sharelatex the template is that of university of Cambridge sharelatex.com/templates/thesis/… Like for example the first chapter Then it has \begin{abstract} Then chapter 2 \begin{abstract} ... – rsc05 May 11 '16 at 18:21
2

Going through the internet, it seems evident that each latex file has its own document class (\documentclass) in latex. In the template, I was using I should have to access a folder called "Classes" and follow "CUEDthesisPSnPDF". In the file "CUEDthesisPSnPDF" I have searched for abstract under this I have written the following environment

\newenvironment{chapabstract}
{
    \begin{center}%
    \vspace*{1.5cm}
      \Large \bfseries Abstract \vspace{-.5em}\vspace{0pt}
    \end{center}
    \list{}{%
    \setlength{\leftmargin}{5mm}% <---------- CHANGE HERE
    \setlength{\rightmargin}{\leftmargin}%
  }%
  \item\relax
}
{\par}
\makeatother

Therefore, in each chapter, I have done the following

\chapter{Hello}
\begin{chapabstract}
     I am good
\end{chapabstract}
\section{ One}
  • That really should go into your main tex file, not the class file. – Johannes_B May 12 '16 at 6:13
  • In that template, there is no main tex file. There is a file known as thesis.tex which I think it is the main. However, over there, there are no \newenvironment. But in the one I showed there is. If you have any suggestions, please have your answer so that everyone benefits. Thank you in advance – rsc05 May 12 '16 at 9:07
  • You can savely move that definition to thesis.tex and remove it from the class. This is just some copyright issue on the one hand, and different files with the same name (but different content). It is a mess for helpers. – Johannes_B May 12 '16 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.