[Tex/LaTex] KOMA-Script scrreprt: How to add Appendix for each Part section

appendiceskoma-scriptparts

EDIT (SOLVED) The below answer by LaRiFaRi successfully allowed me to introduce appendicies where desired, however they have a serious issue with the minitoc. After the first appendix the next chapter loses its minitoc. This does not happen if the appendix is included as \appendix however this does cause every successive chapter to be an appendix (unless there is a known way to stop this command?).
Please could you help fix the interaction between the two? The updated MWE from the original one is included at the bottom of this post.

Original post

I have subdivided my thesis into several parts since they are based on different methods employed. To make things more readable and light I want to move certain common information within each part to an appendix.

How can I insert appendices that show up just at the end of the part section rather than at the end of the entire document?

I know I could add a chapter rather than an appendix for this, however an appendix makes much more sense. Please find my MWE below with my customised chapter heading style with a TOC, Part and Chapter.

\documentclass[
bibliography=totoc,
headings=big,
captions=tableheading,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\usepackage{setspace}
\usepackage{lmodern}

\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections

\begin{document}
\dominitoc
\tableofcontents

\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}

\renewcommand*{\chapterformat}{%
\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{4}{\color{gray}\thechapter}\enskip}}

\setcounter{chapter}{6}\setcounter{page}{199}
\newpage\setcounter{page}{212}

\part{Introduction}

\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc



\section{Summary of Achievements}
Text goes here

\subsection{Papers Submitted}
Text

\subsubsection{I want to go into the TOC}
Testing stuff out

\bibliographystyle{plain}
\bibliography{bibliography}

\end{document} 

UPDATED MWE

\documentclass[
bibliography=totoc,
headings=big,
captions=tableheading,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage[toc]{appendix}

\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections

\begin{document}
\dominitoc
\tableofcontents

\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}

\renewcommand*{\chapterformat}{%
\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{4}{\color{gray}\thechapter}\enskip}}

\setcounter{chapter}{6}\setcounter{page}{199}
\newpage\setcounter{page}{212}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}

%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc

\section{Summary of Achievements}
Text goes here

\subsection{Papers Submitted}
Text

\subsubsection{I want to go into the TOC}
Testing stuff out


%%%%% APPENDIX
\begin{appendices}

\chapter{Some Appendix}
The contents...
\end{appendices}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}

%%%%%%%%%%%%%%%%%%%%
\chapter{The No MiniTOC Chapter}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc

\section{Unfortunate Problems}
This chapter does not have a minitoc for some reason

\subsection{Still no minitoc}
Text

\subsubsection{I want to go into the TOC}
Testing stuff out

%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc

\section{Summary of Achievements}
Text goes here

\subsection{Papers Submitted}
Text



\bibliographystyle{plain}
\bibliography{bibliography}

\end{document} 

Best Answer

With help of the package appendix you can add an appendix whenever you want. When using this package and when using one of the KOMA-classes, minitoc writes the following into the .log-file:

Package minitoc(hints) Info: I0042
(minitoc(hints)) --- The appendix package is loaded.

(minitoc(hints)) See the minitoc package documentation

(minitoc(hints)) for specific precautions.

Package minitoc(hints) Info: I0043

(minitoc(hints)) --- The KOMAScript scrreprt class is loaded.

(minitoc(hints)) See the minitoc package documentation

(minitoc(hints)) for specific precautions.

I looked in the minitoc package documentation and adapted the code for you. But you should definitely read the chapters 1.5.5, 2.20, and 2.35 as you will run in several other problems when adding lof, lot, bib, and so on.

% arara: pdflatex

\documentclass[
bibliography=totoc,
headings=big,
captions=tableheading,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage{appendix}
\let\oldappendices\appendices
\def\appendices{\oldappendices\addtocontents{toc}{\chapterend}} % <----------   set a chapter end mark after each appendix.
\usepackage{blindtext} % <----------   for demo.

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\begin{document}
\dominitoc
\tableofcontents

\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}

\renewcommand*{\chapterformat}{%
\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{4}{\color{gray}\thechapter}\enskip}}

\setcounter{chapter}{6}\setcounter{page}{199}
\newpage\setcounter{page}{212}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}
%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
\blindtext
\subsection{Papers Submitted}
\blindtext
\subsubsection{I want to go into the TOC}
\blindtext
%%%%% APPENDIX
\begin{appendices}
\chapter{Some Appendix}
\blindtext
\end{appendices}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}
%%%%%%%%%%%%%%%%%%%%
\chapter{The No MiniTOC Chapter}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Unfortunate Problems}
This chapter does not have a minitoc for some reason
\subsection{Still no minitoc}
\blindtext
\subsubsection{I want to go into the TOC}
\blindtext
%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
\blindtext
\subsection{Papers Submitted}
\blindtext
\end{document}