1

I want to have a black color underline as shown below:

enter image description here

My MWE seemed a bit long:

\documentclass[12pt,oneside]{book}  % Remove draft option to show figures (for final draft), otherwise keep for faster production

\usepackage{uorthesis} % Loads the LaTeX style package \usepackage[backend=biber, style=authoryear, dashed=false]{biblatex} \addbibresource{references.bib} \usepackage{uorbib}

\usepackage{titlesec} \titleformat{\chapter}[block] {\normalfont\sffamily\LARGE\bfseries\filcenter} {\filcenter\chaptertitlename\ \thechapter\filcenter\}{20pt}{\huge}

% Put custom packages to be loaded here % \usepackage{linguex} % For linguistic examples % \usepackage{tikz} % For drawing

\begin{document}

% Title page \include{structure/title}

% All subsequent pages must be numbered, title page is considered page i, % front matter is numbered in lowercase Roman numerals \pagestyle{fancy} \pagenumbering{roman} \setcounter{page}{2} \doublespacing

% Dedication (optional) \include{structure/dedication}

% Acknowledgments \include{structure/acknowledgements}

% Abstract \include{structure/abstract}

% Table of Contents, List of Tables, List of Figures \tableofcontents

%List of Tables & Figures \include{structure/tablesfigures}

%%%%%%%%%%%%%%%%%%%% DISSERTATION CONTENT %%%%%%%%%%%%%%%%%%%%

% Regular numbering starts now, first page of first chapter is page 1 \clearpage \setcounter{page}{0} \pagenumbering{arabic}

% Body

\include{chapters/01-introduction}

\include{chapters/02-background}

\include{chapters/03-chapter}

\include{chapters/04-chapter}

% References \clearpage \addcontentsline{toc}{chapter}{Bibliography} \markboth{\MakeUppercase{Bibliography}}{} \singlespacing \printbibliography

\appendix \include{chapters/99-appendix}

\end{document}

However, I think the main code is:

\usepackage{titlesec}
\titleformat{\chapter}[block]
  {\normalfont\sffamily\LARGE\bfseries\filcenter}
  {\filcenter\chaptertitlename\ \thechapter\filcenter\\}{20pt}{\huge}
aan
  • 2,663
  • 1
    Do you want to underline the last line of the title or do you want to draw a line between the title and the following text? – henryflower Aug 28 '20 at 16:33
  • @henryflower I want to draw a line between the title and following text. Sorry that my question is not clear enough – aan Aug 29 '20 at 02:10
  • Please provide a minimal working example (MWE) that allows others can compile. Where did you get the files uorthesis.sty and uorbib.sty from? Also, please replace all \include{...} commands with some dummy text. – leandriis Aug 29 '20 at 08:33
  • 1
    Probably \titleformat{\chapter}[block] {\normalfont\sffamily\LARGE\bfseries\filcenter} {\filcenter\chaptertitlename\ \thechapter\filcenter\\}{20pt}{\huge}[{\titlerule[1pt]}] results in the desired output? (See also: Add a rule after chapter title using titlesec) – leandriis Aug 29 '20 at 08:37
  • @leandriis. Thanks. It worked. Brillant. Can you have a look at similar template https://tex.stackexchange.com/questions/560388/how-to-change-a-page-layout-in-a-overleaf-template – aan Aug 29 '20 at 12:57
  • 4
    Since the suggestion to use titlerule from my previous comment as well as from the answer of the question I linked to, seems to have solved your question, I have voted to close your question as a duplicate to the other one. Add a rule after chapter title using titlesec – leandriis Aug 29 '20 at 13:08
  • @leandriis, yes, it answer and your suggestion above worked well too. Between, another similar template, where I want to adjust the page size https://tex.stackexchange.com/questions/560388/how-to-change-a-page-layout-in-a-overleaf-template – aan Aug 29 '20 at 13:11

0 Answers0