I'm writing an article and I want to show just the chapter titles at the beginning of them. The problem is with the appendix, since now I'd like to show "Appendix A".
My main.tex is
\documentclass[a4paper, 12pt, titlepage]{report}
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge}{\thechapter.}{20pt}{\bfseries\huge}
\usepackage[utf8]{inputenc}
\usepackage[title]{appendix} %appendices
\begin{document}
\maketitle
\tableofcontents
\input{ch1/chapter1}
\bibliography{mybib}
\bibliographystyle{plain}
\begin{appendices}
\input{app1/appendix1}
\end{appendices}
\end{document}
The beginning of chapter1.tex is
\chapter{Introduction}
I have some text in this chapter just like this.
It has survived not only
five centuries, but also the leap into electronic typesetting, remaining
essentially unchanged.
Part of file appendix1.tex is:
\chapter{Attached files to the project}
This is a description of the files and images that you will find in the several folders in the DVD.
My chapter title is like:
- Introduction
and appendix is:
A. Attached files to the project
but I'd like to see as appendix title:
Appendix A
Attached files to the project
I know it is related with the command "\titleformat" but how can I fix it in order to show Appendix A + appendix title?
Best Answer
To make the code compile, we need to remove
\maketitle
and the bibliography from the example and integrate the code fragments provided in the question.Having done that, we can redefine the chapter style within the
appendices
environment to include the\appendixname
in the chapter label which precedes the title.For example:
I gather this is what you want, although I'm not entirely certain.
EDIT
To put the appendix title on a new line, you can add back the default
display
shape when redefining the format in theappendices
environment: