1

Is there a way to make the title of my Abstract centered (horizontally)? I am using

\altchapter{\centering Abstract}

but it does not work.

\documentclass[12pt]{ucalgthes1}% similar to github.com/markwgirard/ucalgarythesis
\usepackage[letterpaper,top=1in, bottom= 1in, left= 1in, right= 1in]{geometry}
% to make chapter titles left aligned
\usepackage{titlesec}

\newcommand*{\justifyheading}{\raggedright}

\titleformat{\chapter}[display]
  {\normalfont\large\bfseries\justifyheading}{\chaptertitlename\ \thechapter} {20pt}{\large}

\begin{document}

\altchapter{\bf {Abstract}}

\end{document}
3
  • chapters are left aligned by default. Your template (where to get it) seems to do something different. That is a hint, that it really should be different.
    – Johannes_B
    Commented Mar 25, 2018 at 5:31
  • 1
    Where can we find ucalgthes1.cls? Is it an altered version of ucalgarythesis.cls? Or something else? Please provide a link to the class.
    – Werner
    Commented Mar 25, 2018 at 5:45
  • Yes, it is similar to (github.com/markwgirard/ucalgarythesis)
    – Hossein
    Commented Mar 25, 2018 at 6:03

1 Answer 1

2

Switch the orientation with the switch you defined. The following example uses the class mentioned in the comments.


If you do not have to use this template, do not use it. See https://en.wikibooks.org/wiki/LaTeX/Scientific_Reports


\documentclass[12pt]{ucalgarythesis}
% to make chapter titles left aligned
\usepackage{titlesec}

\newcommand*{\justifyheading}{\raggedright}

\titleformat{\chapter}[display]
{\normalfont\large\bfseries\justifyheading}{\chaptertitlename\ \thechapter} {20pt}{\large}

\begin{document}

\renewcommand*{\justifyheading}{\centering}
\chapter{Abstract}
\renewcommand*{\justifyheading}{\raggedright}
\chapter{Alpaca}

\end{document}
2
  • 1
    +1 for "If you do not have to use this template, do not use it."
    – Mico
    Commented Mar 25, 2018 at 7:04
  • 1
    @Mico It loads book and tries to pass options to the class later. What is going on there?
    – Johannes_B
    Commented Mar 25, 2018 at 7:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .