[Tex/LaTex] Showing “Appendix A with appendix title” and not chapter 1

appendicesnumberingtitles

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:

  1. 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:

\documentclass[a4paper, 12pt, titlepage]{report}
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge}{\thechapter.}{20pt}{\bfseries\huge}
\usepackage[utf8]{inputenc}
\usepackage[title]{appendix} %appendices

\begin{document}
\tableofcontents

\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.

\begin{appendices}
  \titleformat{\chapter}{\normalfont\huge}{\appendixname{} \thechapter.}{20pt}{\bfseries\huge}
  \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.
\end{appendices}

\end{document}

chapter and appendix

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 the appendices environment:

\titleformat{\chapter}[display]{\normalfont\huge}{\appendixname{} \thechapter.}{20pt}{\bfseries\huge}

+display