I am trying to add the abstract to my document in LaTeX and I have two issues:
- Abstract title not in center
- 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}
documentclassare 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 thedocumentclass, related packages and some lines of text. – Markus G. Jun 28 '21 at 15:03reportclass does make the abstract appear in the center. – SolidMark Jun 28 '21 at 19:11