2

I would like the abstract on the title page in the following style: 1. The word 'Abstract' centred above the text 2. A horizontal line immediately underneath the word 'Abstract', with a width equal to that of the text 3. A horizontal line of that same length immediately underneath the text 4. The word 'Keywords:' at the left-side that allows me to put some keywords specific to the thesis.

I have been trying to get this right, but apparently I am missing something. Thanks for the help! Current code can be found here:

\renewenvironment{abstract}
{\begin{quote}
\noindent \rule{\linewidth}{.5pt}\par{\bfseries \abstractname.}}
{\medskip\noindent \rule{\linewidth}{.5pt}
\end{quote}
}

Picture of the end result I aspire:

enter image description here

Sean
  • 151

3 Answers3

2

A solution based on tabularx, threeparttable and xparse for the keywords: it defines the abstract as a threeparttable – the abstract itself being a single row of a tabularx environment, and the list of keywords, input as an optional argument of the environment, inserted as a table note.

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{lipsum}
\usepackage{tabularx, threeparttable, booktabs}
\usepackage{xparse} 
\title{Some Title}
\author{Some One}
\RenewDocumentEnvironment{abstract}{o}%
{\small\noindent\threeparttable\tabularx{\linewidth}{@{}>{\arraybackslash}X@{}}\bfseries\centering \abstractname\tabularnewline\addlinespace[1.5ex]\midrule\addlinespace[1ex]}%
{\endtabularx\vspace{-2ex}\hrule\IfNoValueF{#1}{ \begin{tablenotes}[flushleft, online]\smallskip\item[Keywords: ] #1
\end{tablenotes}}
\endthreeparttable\vspace*{6ex}}%

\begin{document}

\maketitle
\begin{abstract}%[small $\beta$s, Fama-MacBeth two-pass procedure; foreign currency portfolios; factor pricing; stochastic discount factors; weak identification; principal components]
\lipsum[1]
\end{abstract}
\lipsum[2-8]

\end{document} 

enter image description here

Bernard
  • 271,350
1

It might help to look at the definitions is the base folder (article.cls for example).

Since \rule expands in hmode, it always takes up \baselineskip, while \hrule expands in vmode and adds NO extra vertical space. The center environment add extra space at the end, which can be removed using \unskip.

\documentclass{article}
\usepackage{lipsum}% MWE only
\usepackage{showframe}% MWE only

\renewenvironment{abstract}
{\begin{center}\bfseries \abstractname
  \end{center}\unskip
  \smallskip\hrule\smallskip\par}%
{\medskip\hrule\smallskip}

\begin{document}
%\begin{titlepage}
\begin{abstract}
\lipsum[1]
\end{abstract}
\noindent\lipsum[2]
%\end{titlepage}
\end{document}

demo

Bernard
  • 271,350
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
1

I said it before and I will say it again: There is no need to redefine the abstract environment.

seanTitlepage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Masters/Doctoral Thesis 
% LaTeX Template
% Version 2.6 (26/4/18)
%
% This template was downloaded from:
% http://www.LaTeXTemplates.com
%
% Version 2.x major modifications by:
% Vel (vel@latextemplates.com)
%
% This template is based on a template by:
% Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)
% Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)
%
% Template license:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[
english, % ngerman for German
chapterinoneline, % Uncomment to place the chapter title next to the number on one line
]{MastersDoctoralThesis} % The class file specifying the document structure
\usepackage{blindtext}
\usepackage{showframe}
\renewcommand{\chaptermarkformat}{\thechapter\space}
\ihead{\headmark Author p X}
\begin{document}
\begin{titlepage}
    {\centering
    {\scshape\LARGE Columbidae University \par}
    \vspace{1cm}
    {\scshape\Large Final year project\par}
    \vspace{1.5cm}
    {\huge\bfseries Pigeons love doves\par}
    \vspace{2cm}
    {\Large\itshape John Birdwatch\par}
    \vfill
    supervised by\par
    Dr.~Mark \textsc{Brown}

    \vspace{1cm}\textbf{Abstract}\par}
    \noindent\raisebox{.5ex}{\rule{\linewidth}{.4pt}}\par
    \blindtext\par
    \noindent\raisebox{.5ex}{\rule{\linewidth}{.4pt}}\par
    \noindent Keywords: Alpaca, Wombat, Capybara

    \vfill
    {\centering\large \today\par}
\end{titlepage}
\chapter{Wombat}
\blindtext[10]
\appendix
\addchap{Appendix}
\end{document}  
Johannes_B
  • 24,235
  • 10
  • 93
  • 248