0

I am trying to add the abstract to my document in LaTeX and I have two issues:

  1. Abstract title not in center
  2. Abstract not being added in the toc.

Is there any way to do both? There are a lot of solutions that do only one of the above but not both. Also, I wouldn't want the abstract to be a separate chapter.

I have tried using below in the main.tex

\begin{abstract}
    Here goes the body of the abstract
\end{abstract}

This keeps the abstract title itself to the left.

The second attempt I created a new file and called this in the main.tex:

\thispagestyle{plain}
\begin{center}
\phantomsection
\end{center}
\begin{abstract}
    Here goes the body of the abstract
\end{abstract}
\tableofcontents

This does add it to the table of contents but the Abstract title is again to the left. is there any way I could achieve centralizing the abstract title and adding it to the table of contents without making it a chapter? Any help would be appreciated.

Below is the entire class:

\documentclass[12pt,oneside, english, singlespacing,alternatives: onehalfspacing or doublespacing,consistentlayout,]{MastersDoctoralThesis}

\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{float} \usepackage[export]{adjustbox} \usepackage{listings} \usepackage{xcolor} \usepackage{lipsum}

\AtBeginDocument{ \hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title \hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name \hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords }

\begin{document}

\begin{abstract} \addcontentsline{toc}{chapter}{Abstract} Body of the content \end{abstract}

\end{document}

Deepy
  • 1
  • 1
    To be able to help you, you'll have to be a bit more specific: which documentclass are you using, what have you already tried etc. I suppose in your case a so-called minimal working example would be helpful, i.e. a compilable version of your code containing only the relevant parts including the documentclass, related packages and some lines of text. – Markus G. Jun 28 '21 at 15:03
  • Welcome to TeX.SX! From the link I gave you can try the answer given by @Taimoor at the end. You have to compile twice for the content to actually update.. In addition, the report class does make the abstract appear in the center. – SolidMark Jun 28 '21 at 19:11
  • Yes i tried his solution. Abstract is in toc but still not in the center besides my document class is {MasterDoctoralthesis} I guess this is causing the issue. Not sure how to proceed – Deepy Jun 28 '21 at 21:27
  • https://github.com/johannesbottcher/MDT-Quick-Manual#i-want-to-change-the-layout-of-predefined-abstractdeclarationetc-page – Johannes_B Jul 07 '21 at 05:42

0 Answers0