2

I am using a fancy chapter title for normal chapters, but i want chapters in appendix to look different

\documentclass{report}
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage[pagestyles, outermarks, newparttoc]{titlesec}
\usepackage[title]{appendix}
\makeatletter
\titleformat{\chapter}[frame]
{\normalfont}{\filright\enspace \@chapapp~\thechapter\enspace}
{20pt}{\Huge\bfseries\filcenter}%20pt the small line that close the box
\titlespacing*{\chapter}
{0pt}{-35pt}{0pt}
\makeatother
\begin{document}
    \chapter{Appedix testing}
\begin{appendices}
\chapter{Appendix A}
\section{subappendix}
\chapter{Appendix B}
\end{appendices}
\end{document}

enter image description here

1 Answer 1

3

Simply change the titleformat at the point in your document where you want to change it:

\documentclass{report}
\usepackage[pagestyles, outermarks, newparttoc]{titlesec}
\usepackage[title]{appendix}

\makeatletter
    \titleformat{\chapter}[frame]
        {\normalfont}{\filright\enspace \@chapapp~\thechapter\enspace}
        {20pt}{\Huge\bfseries\filcenter}
    \titlespacing*{\chapter}
        {0pt}{-35pt}{0pt}
\makeatother

\begin{document}
    \chapter{Appendix testing}
    
    \begin{appendices}
        \makeatletter
            \titleformat{\chapter}{\Large\bfseries}{\@chapapp~\thechapter:}{.5em}{}
        \makeatother
        \chapter{Theory}
        \section{subappendix}
        \chapter{Appendix B}
    \end{appendices}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.